Shaun Luttin
Shaun Luttin

Reputation: 141622

GetOpenIdConnect returns Invalid Credentials

Context

We are successfully using https://accounts.google.com/o/oauth2/auth to acquire an authentication_code with the following app permissions.

We are also successfully using https://accounts.google.com/o/oauth2/token to exchange that authentication code for an access_token and id_token.

Problem

With that access_token, we are using https://www.googleapis.com/plus/v1/people/me/openIdConnect to acquire profile information. This is a GET request with the following header.

Authorization: Bearer access_token

The response from Google is invariably this error:

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

This Google documentation makes two suggestions:

We have tried both of those approaches and receive the same error.

Upvotes: 1

Views: 592

Answers (1)

Shaun Luttin
Shaun Luttin

Reputation: 141622

We were accidentally using the id_token in the Authorization header. We needed to make sure to use the access_token instead.

Upvotes: 1

Related Questions