-
Notifications
You must be signed in to change notification settings - Fork 352
Android 12 issue - Xamarin.Auth.AuthenticatorCompletedEventArgs return null account object and IsAuthenticated flag false #462
Comments
Any workaround for above mentioned issue? |
I am interested in this as well. @jhaprasun Have you found a workaround? |
Not yet... waiting for fix |
I'm waiting for fix too. |
Not really. Here callback account object is null and IsAuthenticated flag is false |
I found a workaround that is good enough. You may have an activity that has an In your main activity, update the In your activity that had the At this point, comment out or delete the other activity that originally had the Open the
That should do it for you. Basically, what is happening on Android 12 is that you are leaving your application, then starting up everything fresh again and it is losing the context that it needs. This should continue to work on older versions, but I haven't thoroughly tested it. |
@michaelstonis thanks man, just tested it in own app and working very well |
I followed all the steps mentioned for resolution but its not working for me and getting an error- "Error Authenticating - Invalid grant" |
This is almost certainly to do with the OAuth endpoint. It could be that you are requesting access for an invalid user or permissions that are not available or one of a lot of other things. If you are getting that response though, you are at least further along as you would not have any values before. |
Xamarin.Auth Issue
In Android 12 OS devices, after successful login and allowed google drive consent our callback account object is null and IsAuthenticated flag is false. Though it is working fine for Android version below 12. For us this issue is a release blocker. Let us know if there is any workaround. Many thanks in advance.
Version
Steps to reproduce
void IGoogleOAuthSignIn.ShowGoogleAuthSignInPage()
{
CloudSettings.Authenticator = new OAuth2Authenticator(
clientId: Constants.ClientId,
clientSecret: string.Empty,
scope: this.DriveService.Scope.Drive + " " + DriveService.Scope.DriveAppdata + " " + "https://www.googleapis.com/auth/userinfo.email",
authorizeUrl: new Uri("https://accounts.google.com/o/oauth2/auth"),
redirectUrl: new Uri("com.xx.xxxxxx:/oauth2redirect"),
accessTokenUrl: new Uri("https://www.googleapis.com/oauth2/v4/token"),
isUsingNativeUI: true);
}
2.
private void OnOAuthCompleted(object sender, AuthenticatorCompletedEventArgs eventArgs)
{
if (CloudSettings.Authenticator != null)
{
CloudSettings.Authenticator.Completed -= this.OnOAuthCompleted;
CloudSettings.Authenticator.Error -= this.OnOAuthError;
}
Platform:
Expected behaviour
Account object shouldn't be null and IsAuthenticated should be true
Tell us what should happen
Actual behaviour
Account object is null and IsAuthenticated flag is false
Tell us what happens instead
Can you also include a screen shot?
IF IT IS A NEW FEATURE REQUEST, INCLUDE THIS PART:
Feature description
Write a description of the feature. How should it work? How should it look?
Include some graphics if this could help!
The text was updated successfully, but these errors were encountered: