在我的应用程序中,我想使用谷歌登录,因此我使用Azure服务。从Google,我可以成功登录并获取所有详细信息,但Azure端出现以下错误:
Domain=com.Microsoft.WindowsAzureMobileServices.ErrorDomain错误代码=-1302“错误: id_token颁发者无效。”UserInfo={NSLocalizedDescription=Error: id_token颁发者无效。}
代码:
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
}
我不知道这是代币发行还是别的什么。
https://stackoverflow.com/questions/39410491
复制相似问题