Get Userinfo from Oauth2 Google Contacts API
Error which i am getting: com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unauthorized { "code" : 401, "errors" : [ { "domain" : "global", "location" : "Authorization", "locationType" : "header", "message" : "Invalid Credentials", "reason" : "authError" } ], "message" : "Invalid Credentials" } Below code, i am using: GoogleCredential credential = new GoogleCredential.Builder() .setTransport(this.TRANSPORT).setJsonFactory(this.JSON_FACTORY) .setClientSecrets(Constants.CLIENT_ID, Constants.CLIENT_SECRET).build(); credential.setAccessToken(tokenResponse.getAccessToken());