2015-10-13 81 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