2
votes

Hi im having Invalid issuer error when I validate the token id in server using google php API. Token is retrieved from iOS google sign in passed in http post request to the server.

PHP Code on verifying token

$client->verifyIdToken($token)

Error Return but with user credentials

Invalid issuer, https:\/\/accounts.google.com != accounts.google.com: {\"iss\":\"https:\/\/accounts.google.com\",\"at_hash\":\"ZYZ\",\"aud\":\"apps.googleusercontent.com\",\"sub\":\"XYZ\",\"email_verified\":true,\"azp\":\"XYZ\",\"email\":\"ZYP\",\"iat\":1449542280,\"exp\":1449545880}

I follow this instructions from google dev

https://developers.google.com/identity/sign-in/ios/backend-auth

https://developers.google.com/api-client-library/php/guide/aaa_idtoken

1

1 Answers

6
votes

Ok found out the problem. For people who might have problems like this in the future don't use the version stated in the google php api document which is 1.0.*@beta. Use 1.1.* or Higher

"require": {
  "google/apiclient": "1.1.*"
}

Found out in git repo that this issue was fix after version 1.0