Rule Violations when Authenticating from a WinForms Application

Currently, I create a new Auth0Client and call the LoginAsync() method and the login window shows. When I log in with a user that will violate a rule, the login window closes and the LoginResult object I get back has an undescriptive error message which is just “unauthorized”.

Is there any way I can get the custom error message in the rule to show up as an error in the login window?

If not, is there any way for me to get the custom error message into my WinForms application through the LoginResult object or a different way?

I am using a custom login from hosted by Auth0 using Auth0.js as well as the Auth0.OidcClient.WinForms and Auth0.ManagementAPI NuGet packages.

Hi @afrank,

Welcome to the Community!

Have you taken a look at this doc that describes how error pages are handled?

Let me know,
Dan

Hi @dan.woda,

Thanks for the reply.

We got around the issue by deciding not to use the Auth0.OidcClient.WinForms package and hitting the /authorize endpoint directly through a browser in a new windows form and also directly calling the authentication api.

This way, we had complete control over when the login window would close and we were able to catch the redirect link to get the custom error message.

We then called the login page again this time with the custom error message as an extra parameter and now the rule error messages show up on the login window.

The only issue is that now when a user violates a rule the page refreshes to show the error message and what they typed in for their email and password goes away but this is not a big deal.

I just wanted to put my solution out there in case anyone else ever comes across the same issue.

Thanks,
Andrew

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