authentication - ASP.NET MVC 5: Custom Login URL based on localized route parameter -
in asp.net mvc 5 specify login path url in method configureauth(...)
called application_start()
:
app.usecookieauthentication(new cookieauthenticationoptions { authenticationtype = defaultauthenticationtypes.applicationcookie, loginpath = new pathstring("/account/login") });
i need someway specify login path according localized route parameter.
one way have in mind redirect user in application_authenticaterequest()
desired login page in case request.isauthenticated
false. not sure whether idea or not.
using owin, can't assume application_authenticaterequest iis programming model. should assume owin's programming model.
anyway, on cookieauthenticationoptions, there's provider property. on there's applyredirect event ca handle. in there alter redirect url.
Comments
Post a Comment