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 パラメータを何に入れるか、どのように取得するかで行き詰まっています。どんな助けでも大歓迎です。ありがとうございました。