Class GoogleIdToken (2.5.1)

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
Name Description
jsonFactory com.google.api.client.json.JsonFactory

JSON factory

idTokenString String

ID token string

Returns
Type Description
GoogleIdToken

parsed Google ID token

Exceptions
Type Description
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
Name Description
header com.google.api.client.json.webtoken.JsonWebSignature.Header

header

payload GoogleIdToken.Payload

payload

signatureBytes byte[]

bytes of the signature

signedContentBytes byte[]

bytes of the signature content

Methods

getPayload()

public GoogleIdToken.Payload getPayload()
Returns
Type Description
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
Name Description
verifier GoogleIdTokenVerifier
Returns
Type Description
boolean
Exceptions
Type Description
GeneralSecurityException
IOException