0

So i am basically following this auth0 tutorial:

https://auth0.com/docs/quickstart/webapp/aspnet-core/01-login

https://github.com/auth0-samples/auth0-aspnetcore-mvc-samples/tree/master/Quickstart/01-Login

on my localhost and my test-environment the login completely works. Although the error i am getting now on my staging environment also rings a bell, and had that before. But I do not know how I fixed it at that point.

During logging in it gets redirect to the callback url => callback, and not following my redirect url as i am setting it.

as in the accountcontroller

[HttpGet]
[Route("login")]
public async Task Login(string returnUrl = "/home")
{
    await HttpContext.ChallengeAsync(Auth0Constants.Auth0Scheme, new AuthenticationProperties
    {
        RedirectUri = returnUrl
    });
}

so the big question; what am I missing?

EDIT: looking at the network traffic: the one that does work:

working-auth0

I see that I have 2 authorize calls (not sure why?).

and in the one that is not working:

not-working-auth0

where does the second Login call come from..?

2 Answers 2

1

it was due to the encryption. When running multiple instances the encryption key is different:

when keeping track of the key it is fixed:

https://learn.microsoft.com/en-us/aspnet/core/security/data-protection/implementation/key-storage-providers?view=aspnetcore-2.2&tabs=visual-studio

Sign up to request clarification or add additional context in comments.

Comments

0

I don't know much about Auth0 but does it have the URL for each environment?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.