Class StsRequestHandler (1.35.0)

publicfinalclass StsRequestHandler

Implements the OAuth 2.0 token exchange based on RFC 8693.

This class handles the process of exchanging one type of token for another using the Security Token Service (STS). It constructs and sends the token exchange request to the STS endpoint and parses the response to create an StsTokenExchangeResponse object.

Use the #newBuilder(String, StsTokenExchangeRequest, HttpRequestFactory) method to create a new builder for constructing an instance of this class.

Inheritance

java.lang.Object > StsRequestHandler

Static Methods

newBuilder(String tokenExchangeEndpoint, StsTokenExchangeRequest stsTokenExchangeRequest, HttpRequestFactory httpRequestFactory)

publicstaticStsRequestHandler.BuildernewBuilder(StringtokenExchangeEndpoint,StsTokenExchangeRequeststsTokenExchangeRequest,HttpRequestFactoryhttpRequestFactory)

Returns a new builder for creating an instance of StsRequestHandler.

Parameters
Name Description
tokenExchangeEndpoint String

The STS token exchange endpoint.

stsTokenExchangeRequest StsTokenExchangeRequest

The STS token exchange request.

httpRequestFactory com.google.api.client.http.HttpRequestFactory

The HTTP request factory to use for sending the request.

Returns
Type Description
StsRequestHandler.Builder

A new builder instance.

Methods

exchangeToken()

publicStsTokenExchangeResponseexchangeToken()

Exchanges the provided token for another type of token based on the RFC 8693 spec.

Returns
Type Description
StsTokenExchangeResponse
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.