Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting birthday,gender and photo from google UserInfo
    primarykey
    data
    text
    <p>I got this code on below link.</p> <p><a href="https://stackoverflow.com/questions/16714632/how-to-get-userinfo-with-google-api-after-succesfully-been-authenticated?answertab=active#tab-top">How to get userinfo with google-api after succesfully been authenticated?</a></p> <pre><code> GoogleCredential credential2 = new GoogleCredential.Builder() .setTransport(TRANSPORT).setJsonFactory(JSON_FACTORY) .setClientSecrets(CLIENT_ID, CLIENT_SECRET) .setRequestInitializer((new HttpRequestInitializer() { @Override public void initialize(HttpRequest request) throws IOException { request.getHeaders().setAuthorization("Bearer ".concat(tok)); } })) .build(); Oauth2 userInfoService = new Oauth2.Builder(TRANSPORT, JSON_FACTORY, credential2.getRequestInitializer()) .setApplicationName(APPLICATION_NAME).build(); Userinfo userInfo = userInfoService.userinfo().get().execute(); logger.warn("User email: {}", userInfo.getEmail()); logger.warn("User gender: {}", userInfo.getGender()); logger.warn("User complet name: {} - {}", userInfo.getFamilyName(), userInfo.getName()); </code></pre> <p>I have some below question.!</p> <p>1) can you give me steps..? what is the first step before getting the GoogleCredential..? How to get the token..?</p> <p>2)I am using the "Google API Client Library for Java, version 1.16.0-rc" library. In that jar files , I am not getting "Oauth2" class..? Which version client library i need to take..?</p> <p>3)If anyone has sample example with jar ...Please replay me.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload