I’m trying to use oauth 2.0 for the google + api on my site, and I keep getting: { “error”: { “errors”: [{ "domain": "global", "reason": "authError", "message": "Invalid Credentials", "locationType": "header", "location": "Authorization" }], “code”: 401, “message”: “Invalid Credentials” } } The thing is, I don’t know why this is happening. I have a [...]

Autor:

I’m trying to use oauth 2.0 for the google + api on my site, and I keep getting:

{
    "error": {
        "errors": [{
            "domain": "global",
            "reason": "authError",
            "message": "Invalid Credentials",
            "locationType": "header",
            "location": "Authorization"
        }],
        "code": 401,
        "message": "Invalid Credentials"
    }
}

The thing is, I don’t know why this is happening. I have a valid access token from google, but google tells be it is invalid. I know that the token has not expired because the json data is request from google within 10 seconds of getting the access token. Here is the process that I’m using:

  1. Get user to authorize the request.
  2. Gets request code from google.
  3. Uses cUrl to request access token with the request code from google.
  4. Puts the access code into a php session.
  5. redirects back to the main page.
  6. Main page detects session variable is set and doesn’t display login link.
  7. Php on main page uses readFile to get the json response from google.
  8. Google returns invalid credentials.

here is a example uri generated by php that is inserted into readFile:

https://www.googleapis.com/plus/v1/people/me?prettyprint=true&access_token=ya29.AHES6ZQRGovDa5FHsojU3qCM1DEnYmJPywz1muUE4CWGH5n70OcAkw

Help please?

Related posts:

  1. Google API 2 legged Oauth : "Token invalid – Invalid AuthSub token."
  2. Google API 2 legged Oauth : "Token invalid – Invalid AuthSub token."
  3. Google API 2 legged Oauth : "Token invalid – Invalid AuthSub token."
  4. Google API 2 legged Oauth : "Token invalid – Invalid AuthSub token."
  5. Google Access Token Request: Invalid Token/Signature

Comments on this entry (2 comments)

Did you like this post? You can share your opinion with us! Simply click here.

Benedikt

do you already have a solution for this issue, because i have the same issue but just with the blogger api.
thanks in advance

Reply
Benedikt

do you already have a solution for this issue, because i have the same issue but just with the blogger api.
thanks in advance

Reply

Add Your Comment