com.google.api.client.googleapis.auth.oauth2
Class GoogleIdToken.Payload

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.json.GenericJson
              extended by com.google.api.client.auth.jsontoken.JsonWebToken.Payload
                  extended by com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.Payload
All Implemented Interfaces:
Cloneable, Map<String,Object>
Enclosing class:
GoogleIdToken

public static class GoogleIdToken.Payload
extends JsonWebToken.Payload

Google ID token payload.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
GenericData.Flags
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
GoogleIdToken.Payload()
          Constructs a new Payload using default settings.
GoogleIdToken.Payload(Clock clock)
          Constructs a new Payload and uses the specified Clock.
 
Method Summary
 String getAccessTokenHash()
          Returns the hash of access token or null for none.
 String getEmail()
          Returns the e-mail address of the user or null if it was not requested.
 boolean getEmailVerified()
          Returns true if the users e-mail address has been verified by Google.
 String getHostedDomain()
          Returns the hosted domain name if asserted user is a domain managed user or null for none.
 String getIssuee()
          Returns the client ID of issuee or null for none.
 String getUserId()
          Returns the obfuscated Google user id or null for none.
 GoogleIdToken.Payload setAccessTokenHash(String accessTokenHash)
          Sets the hash of access token or null for none.
 GoogleIdToken.Payload setEmail(String email)
          Sets the e-mail address of the user or null if it was not requested.
 GoogleIdToken.Payload setEmailVerified(boolean emailVerified)
          Sets whether the users e-mail address has been verified by Google or not.
 GoogleIdToken.Payload setHostedDomain(String hostedDomain)
          Sets the hosted domain name if asserted user is a domain managed user or null for none.
 GoogleIdToken.Payload setIssuee(String issuee)
          Sets the client ID of issuee or null for none.
 GoogleIdToken.Payload setUserId(String userId)
          Sets the obfuscated Google user id or null for none.
 
Methods inherited from class com.google.api.client.auth.jsontoken.JsonWebToken.Payload
getAudience, getExpirationTimeSeconds, getIssuedAtTimeSeconds, getIssuer, getJwtId, getNotBeforeTimeSeconds, getPrincipal, getType, isValidTime, setAudience, setExpirationTimeSeconds, setIssuedAtTimeSeconds, setIssuer, setJwtId, setNotBeforeTimeSeconds, setPrincipal, setType
 
Methods inherited from class com.google.api.client.json.GenericJson
clone, getFactory, setFactory, toPrettyString, toString
 
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, set, setUnknownKeys
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GoogleIdToken.Payload

public GoogleIdToken.Payload()
Constructs a new Payload using default settings.


GoogleIdToken.Payload

public GoogleIdToken.Payload(Clock clock)
Constructs a new Payload and uses the specified Clock.

Parameters:
clock - Clock to use for expiration checks.
Since:
1.9
Method Detail

getUserId

public String getUserId()
Returns the obfuscated Google user id or null for none.


setUserId

public GoogleIdToken.Payload setUserId(String userId)
Sets the obfuscated Google user id or null for none.


getIssuee

public String getIssuee()
Returns the client ID of issuee or null for none.


setIssuee

public GoogleIdToken.Payload setIssuee(String issuee)
Sets the client ID of issuee or null for none.


getAccessTokenHash

public String getAccessTokenHash()
Returns the hash of access token or null for none.


setAccessTokenHash

public GoogleIdToken.Payload setAccessTokenHash(String accessTokenHash)
Sets the hash of access token or null for none.


getHostedDomain

public String getHostedDomain()
Returns the hosted domain name if asserted user is a domain managed user or null for none.


setHostedDomain

public GoogleIdToken.Payload setHostedDomain(String hostedDomain)
Sets the hosted domain name if asserted user is a domain managed user or null for none.


getEmail

public String getEmail()
Returns the e-mail address of the user or null if it was not requested.

Requires the "https://www.googleapis.com/auth/userinfo.email" scope.

Since:
1.10

setEmail

public GoogleIdToken.Payload setEmail(String email)
Sets the e-mail address of the user or null if it was not requested.

Used in conjunction with the "https://www.googleapis.com/auth/userinfo.email" scope.

Since:
1.10

getEmailVerified

public boolean getEmailVerified()
Returns true if the users e-mail address has been verified by Google.

Requires the "https://www.googleapis.com/auth/userinfo.email" scope.

Since:
1.10

setEmailVerified

public GoogleIdToken.Payload setEmailVerified(boolean emailVerified)
Sets whether the users e-mail address has been verified by Google or not.

Used in conjunction with the "https://www.googleapis.com/auth/userinfo.email" scope.

Since:
1.10


Copyright © 2010-2012 Google. All Rights Reserved.