googleauth - Class Google::Auth::IDTokens::Verifier (v1.12.2)

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)->Verifier

Create a verifier.

Parameters
Returns
  • (Verifier) — a new instance of Verifier

#verify

defverify(token,key_source::default,aud::default,azp::default,iss::default)->Hash

Verify 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 theaud check.
  • azp (String, nil)(defaults to: :default) — If given, override theazp check.
  • iss (String, nil)(defaults to: :default) — If given, override theiss check.
Returns
  • (Hash) — the decoded payload, if verification succeeded.
Raises
  • (KeySourceError) — if the key source failed to obtain public keys
  • (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.