gpt4 book ai didi

ios - 通过 Azure 的 Google 登录错误

转载 作者:IT王子 更新时间:2023-10-29 05:14:42 24 4
gpt4 key购买 nike

在我的应用中,我想使用 Google 登录,因此我使用 Azure 服务。从 Google,我能够成功登录并获取所有详细信息,但 Azure 端出现以下错误:

Error Domain=com.Microsoft.WindowsAzureMobileServices.ErrorDomain Code=-1302 "Error: The id_token issuer is invalid." UserInfo={NSLocalizedDescription=Error: The id_token issuer is invalid.}

代码:

if (user.authentication != nil)
{

let delegate = UIApplication.sharedApplication().delegate as? AppDelegate

let client = delegate!.client!;

// let nextViewController = self.storyboard?.instantiateViewControllerWithIdentifier("SWRevealViewController") as! SWRevealViewController

// self.presentViewController(nextViewController, animated: true, completion: nil)

let payload: [String: String] = ["id_token": idToken]

client.loginWithProvider("google", token: payload, completion: { (user, error) in

if error != nil{

//here i am getting the above mentioned error
print(error)

}

if user != nil{

print(user)



print("Google Login Sucess")

self.call(false, email: email, firstName: firstName, lastName: lastName, id: googleId, token: idToken,imageUrl: imageUrl.absoluteString)

}

})

}



override func viewDidLoad()
{

super.viewDidLoad();



GIDSignIn.sharedInstance().signOut()

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

GIDSignIn.sharedInstance().clientID = "XXXXXXXX";

GIDSignIn.sharedInstance().serverClientID = "XXXXXXXXX"

GIDSignIn.sharedInstance().uiDelegate = self




}

我不知道这是 token 问题还是其他问题。

最佳答案

我们得到的响应如下所示。我认为移动服务后端不喜欢发行者 ID:“https://accounts.google.com”。它接受accounts.google.com

{
"iss": "https://accounts.google.com",
"at_hash": "bGW4JYlbzO64NGLInOpKgg",
"aud": "XXXXXX-XXXXXXX",
"sub": "XXXXXXXXXX",
"email_verified": "true",
"azp": "XXXXXX-XXXXXXXXXXX",
"hd": "techmorphosis.com",
"email": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="11707f647b51657472797c7e6361797e6278623f727e7c" rel="noreferrer noopener nofollow">[email protected]</a>",
"iat": "1477398958",
"exp": "1477402558",
"name": "Anuj Mody",
"given_name": "Anuj",
"family_name": "Mody",
"locale": "en",
"alg": "RS256",
"kid": "XXXXXXXXXXXX"
}

关于ios - 通过 Azure 的 Google 登录错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39410491/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com