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

Hi,

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
http://tyk-broker.dev.com:3010/auth/2/gplus/callback?state=state&code=4/44luELiOL4-9rieZZXPASUoGm7B2M9CS2dzk4KhUsfc&authuser=0&hd=securelyshare.com&session_state=223ace6d61f994cd2b7eabd6c024fc3578b000c3..ffb3&prompt=none#

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" }

Thanks
Shiva

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.