Obtain and store google's access token in tyk and pass it to API endpoint when it's accessed


I am configured Tyk for google authentication and able to authenticate successfully and get tyk access token in the JSON response.

My Aim is to obtain and store google’s access token in tyk and pass it to API endpoint when it’s accessed using tyk access token.

But what i observed is I am obtaining only authorization code from google but how can I make tyk to get access_token using this code achieve my above goal.

callback URL to which google redirected

JSON response from tyk
{ "access_token": "5a16cf191d41c80a85ff4492949e2f80ec824571a65248e33a00ca99", "expires_in": 3600, "redirect_to": "http:///www.google.co.in#access_token=5a16cf191d41c80a85ff4492949e2f80ec824571a65248e33a00ca99&expires_in=3600&token_type=bearer", "token_type": "bearer" }


I think that in this case, instead of using TIB, you should use direct OpenID tyk integration as described here //tyk.io/docs/basic-config-and-security/security/authentication-authorization/openid-connect/

In this case, you will have access to JWT token issued by google, containing all needed information.