Closed shv07 closed 2 years ago
Do you have a state parameter in the authentication url? Could you share the url you use? (Feel free to obfuscate some of the parameters but keep the gist of it)
Also when you say the state parameter is different what is it in WinUIEx and what is it in Maui?
When using with Maui (in Android), the state parameter is something like oQo5B7yiFBin9DmyNSacjT
, whereas while using with WinUIEx (in Windows), it is like:- appInstanceId=f232469d-80cf-4e79-8994-8f568eb7bcf6&signinId=06cded67-erf5-5e25-9925-490841bb29ca
.
The auth url I use points to https://localhost:5000 (where my identity server is running)
Thanks for confirming. I submitted a fix
Thanks for the prompt response!
v1.4.2 should be available on nuget in 10-15 mins. Let me know if that fixes it for you
v1.4.2 works perfectly as expected. Appreciate the help.
Awesome. Thanks for pointing this one out.
I tried using the WebAuthenticator class with OidcClient library as a replacement for
Microsoft.Maui.Authentication.WebAuthenticator
in a Maui desktop application. Unlike the latter, the web browser opens now and on receiving the credentials, redirects back to the application. But the when the returnedWebAuthenticatorResult
object causesInvalid State
error in OidcClient library.If I instead, use the
WinUIEx.WebAuthenticatorResult
class too, I getMalformed Callback Url
error.The code works perfectly when used on Android with Maui's WebAuthenticator. On closer inspection, the value for the "state" key in the returned WebAuthenticatorResult.Properties dictionary (from AuthenticateAsync() method) seems quite different from what is received on a similar android project.
The relevant piece of code which calls the method of this class is here:-