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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -