Auth0 Home Blog Docs

Auth failure with MVC and OWIN using documentation



I’ve been bashing this for hours with no good direction from the forum or other sources on the internet.

I’m trying to integrate Auth0 into an existing MVC application while I’m also working on a future SPA+Web Api solution to ultimately replace it.

I have followed the documentation at, followed by

I have my OWIN security configuration as follows. It uses a custom cookie provider where I do some claims augmentation.

            new CookieAuthenticationOptions
                Provider = cookieProvider,
                AuthenticationType = CookieAuthenticationDefaults.AuthenticationType,
                LoginPath = new PathString("/Authentication/SignIn")

        // Configure Auth0 authentication
        var options = new Auth0AuthenticationOptions
            Domain = Settings.Domain,
            ClientId = Settings.ClientId,
            ClientSecret = Settings.ClientSecret

The authentication/signin view contains the following:

    ViewBag.Title = "Sign In";

<div id="root" style="width: 320px; margin: 40px auto;">

    var lock = new Auth0Lock('@Settings.ClientId', '@Settings.Domain',
            container: 'root',
            auth: {
                redirectUrl: window.location.origin + '/signin-auth0',
                responseType: 'code',
                params: {
                    scope: 'openid email profile'
            theme: {
                authButtons: {
                    "AzureADv2": {
                        displayName: "Microsoft"

Once authenticated, the browser redirects to /signin-auth0 which returns a 302 without a location header. This leaves the browser with a blank page.

Chrome provides the following for the /signin-auth0 request

![alt text][1]

Where is this going wrong? I’m expecting that the user should be authenticated and redirected to the original page they were requesting.



ASP MVC should forward the call to a default controller and function “/Auth0Account/ExternalLoginCallback”.
That function will convert the external cookie to an application cookie. I see that it is not documented on that page that you listed.

However on the page you can browse some sample code. What it seems that you are missing is located here:

If you would like to change the URL, you can specify a “redirectPath” in the app.UseAuth0Authentication settings.
Also please review the used AuthenticationType in the cookie authentication. The example is using “DefaultAuthenticationTypes.ApplicationCookie” instead “CookieAuthenticationDefaults.AuthenticationType” what you are using.