How to send GET request with google OAuth2 and Java to script.google.com web page?

 ̄綄美尐妖づ 提交于 2020-06-29 04:07:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!