Class GoogleIdToken (2.1.2)

public class GoogleIdToken extends IdToken

Beta
Google ID tokens as specified in OpenID Connect.

Google ID tokens contain useful information about the authorized end user. Google ID tokens are signed and the signature must be verified using #verify(GoogleIdTokenVerifier).

Implementation is not thread-safe.

Inheritance

java.lang.Object > JsonWebToken > JsonWebSignature > com.google.api.client.auth.openidconnect.IdToken > GoogleIdToken

Static Methods

parse(JsonFactory jsonFactory, String idTokenString)

public static GoogleIdToken parse(JsonFactory jsonFactory, String idTokenString)

Parses the given ID token string and returns the parsed GoogleIdToken.

Parameters
NameDescription
jsonFactorycom.google.api.client.json.JsonFactory

JSON factory

idTokenStringString

ID token string

Returns
TypeDescription
GoogleIdToken

parsed Google ID token

Exceptions
TypeDescription
IOException

Constructors

GoogleIdToken(JsonWebSignature.Header header, GoogleIdToken.Payload payload, byte[] signatureBytes, byte[] signedContentBytes)

public GoogleIdToken(JsonWebSignature.Header header, GoogleIdToken.Payload payload, byte[] signatureBytes, byte[] signedContentBytes)
Parameters
NameDescription
headercom.google.api.client.json.webtoken.JsonWebSignature.Header

header

payloadGoogleIdToken.Payload

payload

signatureBytesbyte[]

bytes of the signature

signedContentBytesbyte[]

bytes of the signature content

Methods

getPayload()

public GoogleIdToken.Payload getPayload()
Returns
TypeDescription
GoogleIdToken.Payload
Overrides
com.google.api.client.auth.openidconnect.IdToken.getPayload()

verify(GoogleIdTokenVerifier verifier)

public boolean verify(GoogleIdTokenVerifier verifier)

Verifies that this ID token is valid using GoogleIdTokenVerifier#verify(GoogleIdToken).

Parameter
NameDescription
verifierGoogleIdTokenVerifier
Returns
TypeDescription
boolean
Exceptions
TypeDescription
GeneralSecurityException
IOException