title: spring google oauth2 return no access_token
body: <p>I'm trying to implement OAuth2 with Google in my Spring Boot application and when I retrieve the Principle object, what I get is given at the last.</p>
  
  <p>Here is the method,that I use to retrieve the user:</p>
  
  <pre><code>@GetMapping("/user")
      public Principal user(Principal user) {
          return user;
      }
  </code></pre>
  
  <p>In the response I can find no <em>access_token</em> or something, although I find <em>hash of it</em> and <em>id_token</em>.</p>
  
  <p>So how can I retrieve it ?</p>
  
  <pre><code>{
    "authorities": [
      {
        "authority": "ROLE_USER",
        "attributes": {
          "at_hash": "jVwoBv3AueI07-VJqKN0-A",
          "sub": "108161422188958518395",
          "email_verified": true,
          "iss": "https://accounts.google.com",
          "given_name": "test",
          "locale": "en",
          "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
          "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
          "aud": [
            "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
          ],
          "azp": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
          "name": "test testing",
          "exp": 1590535843,
          "family_name": "testing",
          "iat": 1590532243,
          "email": "test@gamil.com"
        },
        "idToken": {
          "tokenValue": "123",
          "issuedAt": 1590532243,
          "expiresAt": 1590535843,
          "claims": {
            "at_hash": "jVwoBv3AueI07-VJqKN0-A",
            "sub": "108161422188958518395",
            "email_verified": true,
            "iss": "https://accounts.google.com",
            "given_name": "test",
            "locale": "en",
            "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
            "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
            "aud": [
              "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
            ],
            "azp": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
            "name": "test testing",
            "exp": 1590535843,
            "family_name": "testing",
            "iat": 1590532243,
            "email": "test@gamil.com"
          },
          "subject": "108161422188958518395",
          "authorizedParty": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
          "accessTokenHash": "jVwoBv3AueI07-VJqKN0-A",
          "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
          "audience": [
            "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
          ],
          "issuer": "https://accounts.google.com",
          "authenticatedAt": null,
          "authorizationCodeHash": null,
          "authenticationContextClass": null,
          "authenticationMethods": null,
          "address": {
            "formatted": null,
            "streetAddress": null,
            "locality": null,
            "region": null,
            "postalCode": null,
            "country": null
          },
          "locale": "en",
          "zoneInfo": null,
          "fullName": "test testing",
          "familyName": "testing",
          "nickName": null,
          "updatedAt": null,
          "website": null,
          "middleName": null,
          "birthdate": null,
          "gender": null,
          "givenName": "test",
          "email": "test@gamil.com",
          "phoneNumber": null,
          "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
          "profile": null,
          "emailVerified": true,
          "phoneNumberVerified": null,
          "preferredUsername": null
        },
        "userInfo": null
      },
      {
        "authority": "SCOPE_https://www.googleapis.com/auth/userinfo.email"
      },
      {
        "authority": "SCOPE_https://www.googleapis.com/auth/userinfo.profile"
      },
      {
        "authority": "SCOPE_openid"
      }
    ],
    "details": {
      "remoteAddress": "0:0:0:0:0:0:0:1",
      "sessionId": "D3DCD92FB24A25CFC8B64160DD5C155B"
    },
    "authenticated": true,
    "principal": {
      "authorities": [
        {
          "authority": "ROLE_USER",
          "attributes": {
            "at_hash": "jVwoBv3AueI07-VJqKN0-A",
            "sub": "108161422188958518395",
            "email_verified": true,
            "iss": "https://accounts.google.com",
            "given_name": "test",
            "locale": "en",
            "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
            "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
            "aud": [
              "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
            ],
            "azp": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
            "name": "test testing",
            "exp": 1590535843,
            "family_name": "testing",
            "iat": 1590532243,
            "email": "test@gamil.com"
          },
          "idToken": {
            "tokenValue": "123",
            "issuedAt": 1590532243,
            "expiresAt": 1590535843,
            "claims": {
              "at_hash": "jVwoBv3AueI07-VJqKN0-A",
              "sub": "108161422188958518395",
              "email_verified": true,
              "iss": "https://accounts.google.com",
              "given_name": "test",
              "locale": "en",
              "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
              "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
              "aud": [
                "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
              ],
              "azp": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
              "name": "test testing",
              "exp": 1590535843,
              "family_name": "testing",
              "iat": 1590532243,
              "email": "test@gamil.com"
            },
            "subject": "108161422188958518395",
            "authorizedParty": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
            "accessTokenHash": "jVwoBv3AueI07-VJqKN0-A",
            "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
            "audience": [
              "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
            ],
            "issuer": "https://accounts.google.com",
            "authenticatedAt": null,
            "authorizationCodeHash": null,
            "authenticationContextClass": null,
            "authenticationMethods": null,
            "address": {
              "formatted": null,
              "streetAddress": null,
              "locality": null,
              "region": null,
              "postalCode": null,
              "country": null
            },
            "locale": "en",
            "zoneInfo": null,
            "fullName": "test testing",
            "familyName": "testing",
            "nickName": null,
            "updatedAt": null,
            "website": null,
            "middleName": null,
            "birthdate": null,
            "gender": null,
            "givenName": "test",
            "email": "test@gamil.com",
            "phoneNumber": null,
            "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
            "profile": null,
            "emailVerified": true,
            "phoneNumberVerified": null,
            "preferredUsername": null
          },
          "userInfo": null
        },
        {
          "authority": "SCOPE_https://www.googleapis.com/auth/userinfo.email"
        },
        {
          "authority": "SCOPE_https://www.googleapis.com/auth/userinfo.profile"
        },
        {
          "authority": "SCOPE_openid"
        }
      ],
      "attributes": {
        "at_hash": "jVwoBv3AueI07-VJqKN0-A",
        "sub": "108161422188958518395",
        "email_verified": true,
        "iss": "https://accounts.google.com",
        "given_name": "test",
        "locale": "en",
        "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
        "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
        "aud": [
          "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
        ],
        "azp": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
        "name": "test testing",
        "exp": 1590535843,
        "family_name": "testing",
        "iat": 1590532243,
        "email": "test@gamil.com"
      },
      "idToken": {
        "tokenValue": "123",
        "issuedAt": 1590532243,
        "expiresAt": 1590535843,
        "claims": {
          "at_hash": "jVwoBv3AueI07-VJqKN0-A",
          "sub": "108161422188958518395",
          "email_verified": true,
          "iss": "https://accounts.google.com",
          "given_name": "test",
          "locale": "en",
          "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
          "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
          "aud": [
            "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
          ],
          "azp": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
          "name": "test testing",
          "exp": 1590535843,
          "family_name": "testing",
          "iat": 1590532243,
          "email": "test@gamil.com"
        },
        "subject": "108161422188958518395",
        "authorizedParty": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
        "accessTokenHash": "jVwoBv3AueI07-VJqKN0-A",
        "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
        "audience": [
          "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
        ],
        "issuer": "https://accounts.google.com",
        "authenticatedAt": null,
        "authorizationCodeHash": null,
        "authenticationContextClass": null,
        "authenticationMethods": null,
        "address": {
          "formatted": null,
          "streetAddress": null,
          "locality": null,
          "region": null,
          "postalCode": null,
          "country": null
        },
        "locale": "en",
        "zoneInfo": null,
        "fullName": "test testing",
        "familyName": "testing",
        "nickName": null,
        "updatedAt": null,
        "website": null,
        "middleName": null,
        "birthdate": null,
        "gender": null,
        "givenName": "test",
        "email": "test@gamil.com",
        "phoneNumber": null,
        "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
        "profile": null,
        "emailVerified": true,
        "phoneNumberVerified": null,
        "preferredUsername": null
      },
      "userInfo": null,
      "claims": {
        "at_hash": "jVwoBv3AueI07-VJqKN0-A",
        "sub": "108161422188958518395",
        "email_verified": true,
        "iss": "https://accounts.google.com",
        "given_name": "test",
        "locale": "en",
        "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
        "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
        "aud": [
          "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
        ],
        "azp": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
        "name": "test testing",
        "exp": 1590535843,
        "family_name": "testing",
        "iat": 1590532243,
        "email": "test@gamil.com"
      },
      "name": "108161422188958518395",
      "subject": "108161422188958518395",
      "expiresAt": 1590535843,
      "authorizedParty": "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com",
      "accessTokenHash": "jVwoBv3AueI07-VJqKN0-A",
      "nonce": "4ByS7UbIYimkIOJvHUznNQGZ42GxgYh9tCM1K4vKfYc",
      "audience": [
        "693417856482-slejtj57gb2nrcehe82ih45o2vdhkj5t.apps.googleusercontent.com"
      ],
      "issuer": "https://accounts.google.com",
      "issuedAt": 1590532243,
      "authenticatedAt": null,
      "authorizationCodeHash": null,
      "authenticationContextClass": null,
      "authenticationMethods": null,
      "address": {
        "formatted": null,
        "streetAddress": null,
        "locality": null,
        "region": null,
        "postalCode": null,
        "country": null
      },
      "locale": "en",
      "zoneInfo": null,
      "fullName": "test testing",
      "familyName": "testing",
      "nickName": null,
      "updatedAt": null,
      "website": null,
      "middleName": null,
      "birthdate": null,
      "gender": null,
      "givenName": "test",
      "email": "test@gamil.com",
      "phoneNumber": null,
      "picture": "https://lh3.googleusercontent.com/a-/AOh14Gh6AHe4iGXQ9XKVgfVV35w31UbSzKs84xUYuNNS=s96-c",
      "profile": null,
      "emailVerified": true,
      "phoneNumberVerified": null,
      "preferredUsername": null
    },
    "authorizedClientRegistrationId": "google",
    "credentials": "",
    "name": "108161422188958518395"
  }
  </code></pre>