ios google sign in not getting profile scope

天涯浪子 提交于 2021-02-07 08:20:08

问题


I implemented a while ago google sign in on my app. everything was working. Im requesting a google profile and email scopes and when calling https://www.googleapis.com/oauth2/v3/tokeninfo?id_token= with the token i received in the app and i got the user profile.

today i run the code and i get the token without the profile only email and email verified. log in via android and via web return with profile. the only problem is with the ios. i can see also that the idtoken in ios is smaller then the one i received via android/web

 GIDSignIn.sharedInstance().delegate = self
    GIDSignIn.sharedInstance().uiDelegate = self
    GIDSignIn.sharedInstance().clientID = kClientId

    GIDSignIn.sharedInstance().scopes.append("https://www.googleapis.com/auth/plus.login")
    GIDSignIn.sharedInstance().scopes.append("https://www.googleapis.com/auth/plus.me")

    GIDSignIn.sharedInstance().signInSilently()

回答1:


GIDSignIn.sharedInstance().delegate=self
GIDSignIn.sharedInstance().uiDelegate=self
GIDSignIn.sharedInstance().scopes.append("https://www.googleapis.com/auth/plus.me")
GIDSignIn.sharedInstance().signIn()

This is my button on click and it is perfectly working for me.



来源:https://stackoverflow.com/questions/38245484/ios-google-sign-in-not-getting-profile-scope

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