authSubToken exception in Android

守給你的承諾、 提交于 2019-12-13 06:26:12

问题


I am using the following code to get Authsubtoken from my android application; following is the code:

 GoogleAuthUtil.getToken(myCtx,  "mymail@gmail.com","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.


回答1:


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



来源:https://stackoverflow.com/questions/16015125/authsubtoken-exception-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!