Search code examples
jwtgoogle-cloud-endpointsgoogle-oauth

Is it possible to configure Google Cloud Endpoints API served using ESP to accept Google access tokens (not JWT)?


Backend for our API is running on App Engine Flexible and we tried to deploy API to Google Cloud Endpoints (ESP variant) and it seems that ESP only supports access tokens in JWT format. Is it really so? Can't we use "normal" Google OAuth2 access tokens (starting with ya29.) to access Google Cloud Endpoints API served with ESP? Below is the response we get:

{
 "code": 16,
 "message": "JWT validation failed: BAD_FORMAT",
 "details": [
  {
   "@type": "type.googleapis.com/google.rpc.DebugInfo",
   "stackEntries": [],
   "detail": "auth"
  }
 ]
}

On the client side we are using oauth2client Python library (with default service account from App Engine Standard), which doesn't make use of JWT simple. Switching to google-auth library is an option, but I just want to confirm that "normal" Google access tokens are not supported.


Solution

  • It's currently not possible to use OAuth2 bearer tokens with the Endpoints proxy.