Authentication token encoding in OidcClient. #317
Unanswered
kevinmbetts
asked this question in
Open Source
Replies: 3 comments 1 reply
-
|
During the upgrade, did you also by any chance target a newer Android API version? This issue seems to be similar. The fact that the same code used to work just fine when targeting .NET 8 makes me think that the issue is rather located in MAUI or the Android API. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Wesley,
Thank you for the prompt reply.
Yes we are upgrading our application to API 35 at the same time. Google sent us a message saying that the API version needed to be updated by the end of August 2025. This Google email is what prompted the upgrade to .NET 9.
Thanks again,
Kevin
Kevin M. Betts
Lead Software Engineer
Kimball Midwest
|
Beta Was this translation helpful? Give feedback.
1 reply
-
|
We are pretty much willing to try anything at this point. I will mess around with it some more in the next few days and reply back to let you know what we find out. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have a .NET 8 app written in MAUI that we are trying to upgrade to .NET 9. I am getting errors in the Android emulator trying to authenticate. We have narrowed the issue down to the body of the authenticate request being improperly encoded. Unfortunately I have been unable to figure out how to change the automatic flow to fix the encoding.
Our identity service is trying to authenticate against Azure AD if that makes a difference.
Our request SHOULD look like this:
https://identity.kimballmidwest.com/kmw.identity.ui/connect/authorize?response_type=code&state=TRxbF2X46MY4dKVerIMZkA&code_challenge=XweYja_Sw3wX7AIIdV6DplaQFk3I1qsBNzJQZjfrcio&code_challenge_method=S256&client_id=ManagersApp.Ui&scope=openid%20profile%20email%20kmw_permissions_list%20api_managersappclient%20offline_access%20api_managersappclient.Write.All&redirect_uri=kmwmanagersapp%3A%2F%2Fcallback
Looking at our error in AppInsights says the server is receiving this:
https://identity.kimballmidwest.com/kmw.identity.ui/connect/authorize?response_type=code\u0026state=TRxbF2X46MY4dKVerIMZkA\u0026code_challenge=XweYja_Sw3wX7AIIdV6DplaQFk3I1qsBNzJQZjfrcio\u0026code_challenge_method=S256\u0026client_id=ManagersApp.Ui\u0026scope=openid%20profile%20email%20kmw_permissions_list%20api_managersappclient%20offline_access%20api_managersappclient.Write.All\u0026redirect_uri=kmwmanagersapp%3A%2F%2Fcallback%22
We believe the issue is '&' being encoded as Unicode \u0026 in the StartUrl property.
Is there an easy way to control how this is encoded?
Here is our authentication method:
Global config settings:
Our oidcClient is registered through DI in MAUIProgram.cs as:
Here is the Android WebAuthenticatorBrowser:
And finally the WebAuthenticationCallbackActivity:
This code worked in .NET MAUI 8.
Any assistance would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions