Native app UWP Universal login returns BadRequest on wrong password but Classic login works

I created a UWP app with the Auth0.OidcClient.UWP Nuget package, as the quickstart for UWP shows. The app was configured with Universal login on the dashboard by default. It works fine if you enter the credentials correctly. I get the access token and the login window closes. If you enter the password wrong, you would expect to see a message, but the window closes and returns with “BadRequest”. If I switch to the Classic login window, and type a password incorrectly, I get a warning message and am allowed to retype the password.

This is my code:
var authClient = new Auth0Client(new Auth0ClientOptions
{
Domain = “my domain”,
ClientId = “my client id”
});

var extraParameters = new Dictionary<string, string>();
extraParameters.Add(“connection”, “Username-Password-Authentication”);
extraParameters.Add(“audience”, “my API audience ID”);

var loginResult = await authClient.LoginAsync(extraParameters: extraParameters);

//This has BadRequest when using Universal login and typing a bad password
//loginResult.Error

I read that this might be caused by a missing ‘state’ parameter on non-UWP forums. But, my understanding is that the ‘state’ parameter is automatically handled in the Oidc SDK. I don’t see anywhere to set it in the client if not. Thanks for any suggestions.

This was resolved with latest version of the Oidc Nuget package.

1 Like

Glad to hear that and thanks for sharing with the rest of community!