2015-10-13 84 views
1

我正在使用GoogleAuthorizationCodeRequestUrl來獲取代碼。GoogleAuthorizationCodeRequestUrl不返回代碼

String authorizationUrl = new GoogleAuthorizationCodeRequestUrl(clientId,redirectUrl,scope).build(); 這應該返回一個代碼,我可以用它來獲取accessToken。但這個調用只是建立網址: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

有沒有其他方法可以用來獲取訪問碼? 謝謝!

回答

0

爲時已晚,但它可能會有所幫助別人,你需要做的sendRedirect已向其作爲

response.sendRedirect(authorizationUrl); 
創建的URL