我正在嘗試使Google OAuth應用程序跟在this example之後。我的應用程序是一個Web應用程序,我想替換下面的代碼:Google OAuth2刪除提示
System.out.println("Paste this url in your browser: " + authorizeUrl);
// Wait for the authorization code
System.out.println("Type the code you received here: ");
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String authorizationCode = in.readLine();
因爲它提示擊中瀏覽器authorizeUrl
網址後輸入密碼,我得到。我想刪除這個提示,應用程序應該沒有提示要求code
本身。
謝謝。獲取訪問令牌後如何處理它。如果我需要調用goggleAPI,那麼如何?你能暗示任何例子嗎?我爲我的Web應用程序使用Spring MVC。 –
訪問令牌在所有授權的請求中作爲「授權」頭的值的一部分發送。該流程在我提供的第一個鏈接中的「調用Google API」中詳細介紹。 – hexedpackets