2

I am using GoogleAuthorizationCodeRequestUrl to get the code.

String authorizationUrl = new GoogleAuthorizationCodeRequestUrl(clientId, redirectUrl, scope).build(); This should return me a code which I can use to get the accessToken. But this call just builds the url: https://accounts.google.com/o/oauth2/auth?client_id=MyClientId&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/content

Is there any other method I should use to get the access code? Thanks!!

GeekMaster
  • 61
  • 7

1 Answers1

1

Too late but it could be helpful to someone else, you need to make a sendRedirect to the url which you have created as

response.sendRedirect(authorizationUrl);
ABC
  • 4,263
  • 10
  • 45
  • 72