iOS google登录无法获取个人资料范围 [英] ios google sign in not getting profile scope

查看:70
本文介绍了iOS google登录无法获取个人资料范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不久前在我的应用程序上实现了google登录.一切正常.我在请求 https://www.googleapis.com时要求Google个人资料和电子邮件范围/oauth2/v3/tokeninfo?id_token = ,其中包含我在应用程序中收到的令牌并获得了用户个人资料.

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.

今天,我运行代码,我得到的令牌没有配置文件,只有电子邮件和已验证的电子邮件.通过android和带有配置文件的网络返回登录.唯一的问题是与ios.我还可以看到ios中的idtoken比通过android/web收到的idtoken小

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()

推荐答案

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.

这篇关于iOS google登录无法获取个人资料范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆