Method: Firebase::Admin::Auth::Client#verify_id_token

Defined in:
lib/firebase/admin/auth/client.rb

#verify_id_token(token, check_revoked = false) ⇒ Hash

Verifies the signature and data for the provided JWT.

Accepts a signed token string, verifies that it is current, was issued to this project, and that it was correctly signed by Google.

Parameters:

  • token (String)

    A string of the encoded JWT.

  • check_revoked (Boolean) (defaults to: false)

    (false) If true, checks whether the token has been revoked.

Returns:

  • (Hash)

    A hash of key-value pairs parsed from the decoded JWT.



98
99
100
101
102
# File 'lib/firebase/admin/auth/client.rb', line 98

def verify_id_token(token, check_revoked = false)
  verified_claims = @id_token_verifier.verify(token, is_emulator: emulated?)
  revoked = check_revoked && !id_token_revoked?(verified_claims)
  verified_claims unless revoked
end