googleauth - Class Google::Auth::OAuth2::STSClient (v1.12.2) Stay organized with collections Save and categorize content based on your preferences.
Reference documentation and code samples for the googleauth class Google::Auth::OAuth2::STSClient.
OAuth 2.0 Token Exchange Spec.This module defines a token exchange utility based on theOAuth 2.0 Token Exchange spec. This will be mainlyused to exchange external credentials for GCP access tokens in workload identity pools toaccess Google APIs.The implementation will support various types of client authentication as allowed in the spec.
A deviation on the spec will be for additional Google specific options that cannot be easilymapped to parameters defined in the RFC.The returned dictionary response will be based on therfc8693 section 2.2.1 spec JSON response.
Inherits
- Object
Methods
#exchange_token
defexchange_token(options={})->HashExchanges the provided token for another type of token based on therfc8693 spec
A callable faraday instance used to make HTTP requests.
- connection (Faraday instance)
- grant_type (String) — The OAuth 2.0 token exchange grant type.
- subject_token (String) — The OAuth 2.0 token exchange subject token.
- subject_token_type (String) — The OAuth 2.0 token exchange subject token type.
- resource (String) — The optional OAuth 2.0 token exchange resource field.
- audience (String) — The optional OAuth 2.0 token exchange audience field.
- scopes (Array<String>) — The optional list of scopes to use.
- requested_token_type (String) — The optional OAuth 2.0 token exchange requested token type.
- additional_headers (Hash<String,String>) — :The optional additional headers to pass to the token exchange endpoint.
- (Hash) — A hash containing the token exchange response.
#initialize
definitialize(options={})->STSClientCreate a new instance of the STSClient.
- token_exchange_endpoint (String) — The token exchange endpoint.
- (STSClient) — a new instance of STSClient
Constants
URLENCODED_HEADERS
value:{ "Content-Type": "application/x-www-form-urlencoded" }.freeze
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.