Class TokenVerifier.Builder (1.18.0)
Stay organized with collections
Save and categorize content based on your preferences.
publicstaticclass TokenVerifier.BuilderInherited Members
Constructors
Builder()
publicBuilder()Methods
build()
publicTokenVerifierbuild()Build the custom TokenVerifier for verifying tokens.
| Returns | |
|---|---|
| Type | Description |
TokenVerifier |
the customized TokenVerifier |
setAudience(String audience)
publicTokenVerifier.BuildersetAudience(Stringaudience)Set a target audience to verify.
| Parameter | |
|---|---|
| Name | Description |
audience |
String the audience claim to verify |
| Returns | |
|---|---|
| Type | Description |
TokenVerifier.Builder |
the builder |
setCertificatesLocation(String certificatesLocation)
publicTokenVerifier.BuildersetCertificatesLocation(StringcertificatesLocation)Override the location URL that contains published public keys. Defaults to well-known Google locations.
| Parameter | |
|---|---|
| Name | Description |
certificatesLocation |
String URL to published public keys |
| Returns | |
|---|---|
| Type | Description |
TokenVerifier.Builder |
the builder |
setClock(Clock clock)
publicTokenVerifier.BuildersetClock(Clockclock)Set the clock for checking token expiry. Used for testing.
| Parameter | |
|---|---|
| Name | Description |
clock |
com.google.api.client.util.Clockthe clock to use. Defaults to the system clock |
| Returns | |
|---|---|
| Type | Description |
TokenVerifier.Builder |
the builder |
setHttpTransportFactory(HttpTransportFactory httpTransportFactory)
publicTokenVerifier.BuildersetHttpTransportFactory(HttpTransportFactoryhttpTransportFactory)Set the HttpTransportFactory used for requesting public keys from the certificate URL. Used mostly for testing.
| Parameter | |
|---|---|
| Name | Description |
httpTransportFactory |
HttpTransportFactory the HttpTransportFactory used to build certificate URL requests |
| Returns | |
|---|---|
| Type | Description |
TokenVerifier.Builder |
the builder |
setIssuer(String issuer)
publicTokenVerifier.BuildersetIssuer(Stringissuer)Set the issuer to verify.
| Parameter | |
|---|---|
| Name | Description |
issuer |
String the issuer claim to verify |
| Returns | |
|---|---|
| Type | Description |
TokenVerifier.Builder |
the builder |
setPublicKey(PublicKey publicKey)
publicTokenVerifier.BuildersetPublicKey(PublicKeypublicKey)Set the PublicKey for verifying the signature. This will ignore the key id from the JWT token header.
| Parameter | |
|---|---|
| Name | Description |
publicKey |
PublicKey the public key to validate the signature |
| Returns | |
|---|---|
| Type | Description |
TokenVerifier.Builder |
the builder |