kakabali
kakabali

Reputation: 4033

How to get google access token from refresh token using google java api?

How to get new google's access token using refresh token programatically using the google java token.

Upvotes: 1

Views: 1810

Answers (1)

kakabali
kakabali

Reputation: 4033

I have found out the following code, and it's the working solution for getting the new access token, and there might be some other alternative for same :-

TokenResponse response = new GoogleRefreshTokenRequest(httpTransport, jsonFactory, token, clientId, clientSecret).execute();

in the code response could be used to generate various google services again and here token is the response token.

Upvotes: 2

Related Questions