问题
GET is working for me but I get google services authorization page when I send it. I read guides from google but still don't understand how to use Credentials right.
This thing is for managing script files itself and have nothing to do with my problem :/
Would be decent if it is possible in Java
回答1:
After sign in google you will be redirected on redirect page with google code. Redirect page could be set in google private user console. When you will get google code you could use code for obtaining jwt with GoogleAuthorizationCodeFlow
for example
GoogleAuthorizationCodeTokenRequest googleAuthorizationCodeTokenRequest = codeFlow.newTokenRequest(code)
.setRedirectUri(redirectUrl);
try {
GoogleTokenResponse googleTokenResponse = googleAuthorizationCodeTokenRequest.execute();
} catch (IOException e) {
throw new ExternalAuthenticationException("Invalid google 'code' parameter (disposable)");
}
来源:https://stackoverflow.com/questions/62477491/how-to-send-get-request-with-google-oauth2-and-java-to-script-google-com-web-pag