Package com.google.auth.oauth2
Class TokenVerifier
java.lang.Object
com.google.auth.oauth2.TokenVerifier
Handle verification of Google-signed JWT tokens.
- Since:
- 0.21.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
(package private) static class
Custom CacheLoader for mapping certificate urls to the contained public keys.static class
Custom exception for wrapping all verification errors. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
getCertificateLocation
(com.google.api.client.json.webtoken.JsonWebSignature jsonWebSignature) static TokenVerifier.Builder
com.google.api.client.json.webtoken.JsonWebSignature
Verify an encoded JWT token.
-
Field Details
-
IAP_CERT_URL
- See Also:
-
FEDERATED_SIGNON_CERT_URL
- See Also:
-
SUPPORTED_ALGORITHMS
-
audience
-
certificatesLocation
-
issuer
-
publicKey
-
clock
private final com.google.api.client.util.Clock clock -
publicKeyCache
-
-
Constructor Details
-
TokenVerifier
-
-
Method Details
-
newBuilder
-
verify
public com.google.api.client.json.webtoken.JsonWebSignature verify(String token) throws TokenVerifier.VerificationException Verify an encoded JWT token.- Parameters:
token
- encoded JWT token- Returns:
- the parsed JsonWebSignature instance for additional validation if necessary
- Throws:
TokenVerifier.VerificationException
- thrown if any verification fails
-
getCertificateLocation
private String getCertificateLocation(com.google.api.client.json.webtoken.JsonWebSignature jsonWebSignature) throws TokenVerifier.VerificationException
-