IdentityModel.OidcClient
IdentityModel.OidcClient copied to clipboard
Issues logging in with Android
We're encountering an issue within a Xamarin application using IdentityModel.OidcClient for one user/device on Android. If the user tries to login on Android device A, they are redirected from the IdentityServer back into the Xamarin application through the callback without issue. If they do the same steps on iOS device B, they also have no issue. If they repeat the steps on Android device C, then they receive an error. This is on a physical device with our application deployed to the Play store. At this time, we are not capturing the Error message or description from OidcClient.LoginAsync(LoginRequest, CancellationToken)
. We think the LoginResult.AccessToken
is null or empty string, or LoginResult.IsError
is true and we believe this may be an issue with only the one device (Android C).
Are there privacy settings on that device's browser that you are aware of that could cause an issue when IdentityModel.OidcClient returns to the Xamarin application that could be different from the other Android device (Android A)?
This library is really only the orchestrator of the required front/back channel interactions.
Your IBrowser
implementation is what communicates with the device. And I personally don't know anything about Android.
Thanks @leastprivilege - you were correct, this was something in our IBrowser
implementation. We are using ChromeCustomTabsBrowser
. In there, we were setting the Intent's flags with ActivityFlags.NoHistory
. What was happening was, if we initiated the OidcClient.LoginAsync(LoginRequest, CancellationToken)
call, it opened the browser (as expected). If we left the app to go to a different app while that browser was opened, and then returned to the app where the browser was open, then it hid the browser. We commented out the code that added the ActivityFlags.NoHistory
, and when we repeated the above steps the browser was still shown (success!).
I know you said you don't have experience with Android, but are you aware if setting the ActivityFlag for IBrowser's Intent to not set "NoHistory" will cause any issues with the OidcClient?
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue.