HttpTransport netTransport = new NetHttpTransport();
JsonFactory jsonFactory = new JacksonFactory();
GoogleTokenResponse token;
try {
token = new GoogleAuthorizationCodeTokenRequest(
netTransport,
jsonFactory,
CLIENT_ID,
CLIENT_SECRET,
CODE,
REDIRECT).execute();
GoogleCredential cd = new GoogleCredential().setAccessToken(token
.getAccessToken());
Plus plus = Plus
.builder(new NetHttpTransport(), new JacksonFactory())
.setApplicationName(APP_NAME)
.setHttpRequestInitializer(cd).build();
Person profile = plus.people().get("me").execute();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
大家好,我正在尝试在我的 Google App Engine 应用程序中从 Google + 获取一些用户信息,但我不知道要放置什么/如何获取 GoogleAuthorizationCodeTokenRequest 的 CODE 参数。任何帮助是极大的赞赏。谢谢你。