How to force Auth0Client LoginAsync to show the login form every time

I have a Windows Forms app using Auth0.OidcClient.WinForms to login to Auth0. Something seems to be getting cached and sometimes the login form doesn’t show.

Desired
LoginAsync() opens the browser window so the user sees the login form every time.

Actual
LoginAsync() sometimes does not open the browser window and the user is logged in automatically.
This is a problem because we’re seeing this issue: if the user gives the wrong email and receives “access_denied”, they will get this message forever. They never get a chance to see the login form again.

There’s nothing special about the code. Most of it came from the quickstart:

Auth0ClientOptions clientOptions = new Auth0ClientOptions
{
     Domain = _domain,
     ClientId = _clientId
};
_client = new Auth0Client(clientOptions);
clientOptions.PostLogoutRedirectUri = clientOptions.RedirectUri;

...

var extraParameters = new Dictionary<string, string>();            extraParameters.Add("organization", orgID);

...

LoginResult loginResult = await _client.LoginAsync(extraParameters: extraParameters);

How can I ensure the login form will pop up every time?

Hi @kendyl.drayer,

Welcome to the Auth0 Community!

You can use the prompt="login" parameter to force the login prompt. Alternatively, you can use the logout endpoint to terminate the session if you need to do so.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.