CookieAuthenticationOptions.LoginPath Property

The LoginPath property informs the middleware that it should change an outgoing 401 Unauthorized status code into a 302 redirection onto the given login path. The current url which generated the 401 is added to the LoginPath as a query string parameter named by the ReturnUrlParameter. Once a request to the LoginPath grants a new SignIn identity, the ReturnUrlParameter value is used to redirect the browser back to the url which caused the original unauthorized status code. If the LoginPath is null or empty, the middleware will not look for 401 Unauthorized status codes, and it will not redirect automatically when a login occurs.

Namespace:  Microsoft.Owin.Security.Cookies
Assembly:  Microsoft.Owin.Security.Cookies (in Microsoft.Owin.Security.Cookies.dll)


Public Property LoginPath As PathString 
Dim instance As CookieAuthenticationOptions 
Dim value As PathString 

value = instance.LoginPath

instance.LoginPath = value
public PathString LoginPath { get; set; }
property PathString LoginPath {
    PathString get ();
    void set (PathString value);
member LoginPath : PathString with get, set
function get LoginPath () : PathString 
function set LoginPath (value : PathString)

Property Value

Type: Microsoft.Owin.PathString
Returns PathString.

See Also


CookieAuthenticationOptions Class

Microsoft.Owin.Security.Cookies Namespace