Reputation: 865
I am using the following code to get Authsubtoken from my android application; following is the code:
GoogleAuthUtil.getToken(myCtx, "[email protected]","oauth2:https://www.googleapis.com/auth/userinfo.profile")
With this code, I get the following exception:
com.google.android.gms.auth.UserRecoverableAuthException: NeedPermission
How to overcome this exception?
Any help is appreciated.
Upvotes: 0
Views: 501
Reputation: 30855
Using this exception
...
} catch (UserRecoverableAuthIOException e) {
startActivityForResult(e.getIntent(), REQUEST_AUTHORIZATION);
}
...
check out more here
https://stackoverflow.com/a/14386248/760489
https://stackoverflow.com/a/15142977/760489
Upvotes: 1