googleauth - Class Google::Auth::IDTokens::Verifier (v1.15.1) Stay organized with collections Save and categorize content based on your preferences.
Reference documentation and code samples for the googleauth class Google::Auth::IDTokens::Verifier.
An object that can verify ID tokens.
A verifier maintains a set of default settings, including the keysource and fields to verify. However, individual verification calls canoverride any of these settings.
Inherits
- Object
Methods
#initialize
definitialize(key_source:nil,aud:nil,azp:nil,iss:nil)->VerifierCreate a verifier.
Parameters
- key_source (key source)(defaults to: nil) — The default key source to use. Allverification calls must have a key source, so if no default keysource is provided here, then calls to#verifymust providea key source.
- aud (String, nil)(defaults to: nil) — The default audience (
aud) check, ornilfor no check. - azp (String, nil)(defaults to: nil) — The default authorized party (
azp) check,ornilfor no check. - iss (String, nil)(defaults to: nil) — The default issuer (
iss) check, ornilfor no check.
Returns
- (Verifier) — a new instance of Verifier
#verify
defverify(token,key_source::default,aud::default,azp::default,iss::default)->HashVerify the given token.
Parameters
- token (String) — the ID token to verify.
- key_source (key source)(defaults to: :default) — If given, override the key source.
- aud (String, nil)(defaults to: :default) — If given, override the
audcheck. - azp (String, nil)(defaults to: :default) — If given, override the
azpcheck. - iss (String, nil)(defaults to: :default) — If given, override the
isscheck.
Returns
- (Hash) — the decoded payload, if verification succeeded.
Raises
- (Google::Auth::IDTokens::KeySourceError) — if the key source failed to obtain public keys
- (Google::Auth::IDTokens::VerificationError) — if the token verification failed.Additional data may be available in the error subclass and message.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.