Cos
Cos

Reputation: 1709

Obtaining an access token from a refresh token without knowing the clientid and client secret

I have a Refresh token (which is generated by an external tool) and the goal to access the data from

GET https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles/~all/goals

via C# . For this, I need to generate the Access Token. Is this even possible without knowing the client id and the client secret?

Upvotes: 2

Views: 465

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117321

To retrieve an access token using a refresh token you must know the client id and secret that created it.

You would do a HTTP Post to the following

https://accounts.google.com/o/oauth2/token client_id={ClientId}.apps.googleusercontent.com&client_secret={ClientSecret}&refresh_token=1/ffYmfI0sjR54Ft9oupubLzrJhD1hZS5tWQcyAvNECCA&grant_type=refresh_token

Upvotes: 1

Related Questions