c# - Login url gets changed on redirection with authorize attribute -
i using owin custom authentication , asp.net identity , have login url this:
http://localhost:1927/
now after login user redirected dashboard page , url this:
http://localhost:1927/dashboard/index
now after user logout redirecting user login page , url still fine below:
but when enter url http://localhost:1927/dashboard/index
directly in browser again redirecting login page , url changes below url:
http://localhost:1927/authentication/login?returnurl=%2fdashboard%2findex
i know because have decorated both authentication , dashboard controller
authorize attribute
.
code:
[authorize] public class authenticationcontroller : controller { } [authorize] public class dashboardcontroller : controller { } public partial class startup { // more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?linkid=301864 public void configureauth(iappbuilder app) { // enable application use cookie store information signed in user app.usecookieauthentication(new cookieauthenticationoptions { authenticationtype = defaultauthenticationtypes.applicationcookie, loginpath = new pathstring("/authentication/login") }); // use cookie temporarily store information user logging in third party login provider app.useexternalsignincookie(defaultauthenticationtypes.externalcookie); } }
web.config:
<authentication mode="none" /> <modules> <remove name="formsauthenticationmodule" /> </modules>
so possible have url below on redirecting login page:
http://localhost:1927/
if yes how??
Comments
Post a Comment