Package com.google.auth.oauth2
Class StsRequestHandler
java.lang.Object
com.google.auth.oauth2.StsRequestHandler
Implements the OAuth 2.0 token exchange based on https://tools.ietf.org/html/rfc8693.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.api.client.http.HttpHeaders
private final com.google.api.client.http.HttpRequestFactory
private final String
private static final String
private final StsTokenExchangeRequest
private static final String
private final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
StsRequestHandler
(String tokenExchangeEndpoint, StsTokenExchangeRequest request, com.google.api.client.http.HttpRequestFactory httpRequestFactory, com.google.api.client.http.HttpHeaders headers, String internalOptions) Internal constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate StsTokenExchangeResponse
buildResponse
(com.google.api.client.util.GenericData responseData) private com.google.api.client.util.GenericData
Exchanges the provided token for another type of token based on the RFC 8693 spec.static StsRequestHandler.Builder
newBuilder
(String tokenExchangeEndpoint, StsTokenExchangeRequest stsTokenExchangeRequest, com.google.api.client.http.HttpRequestFactory httpRequestFactory) private com.google.api.client.json.GenericJson
-
Field Details
-
TOKEN_EXCHANGE_GRANT_TYPE
- See Also:
-
PARSE_ERROR_PREFIX
- See Also:
-
tokenExchangeEndpoint
-
request
-
httpRequestFactory
private final com.google.api.client.http.HttpRequestFactory httpRequestFactory -
headers
-
internalOptions
-
-
Constructor Details
-
StsRequestHandler
private StsRequestHandler(String tokenExchangeEndpoint, StsTokenExchangeRequest request, com.google.api.client.http.HttpRequestFactory httpRequestFactory, @Nullable com.google.api.client.http.HttpHeaders headers, @Nullable String internalOptions) Internal constructor.- Parameters:
tokenExchangeEndpoint
- the token exchange endpointrequest
- the token exchange requestheaders
- optional additional headers to pass along the requestinternalOptions
- optional GCP specific STS options
-
-
Method Details
-
newBuilder
public static StsRequestHandler.Builder newBuilder(String tokenExchangeEndpoint, StsTokenExchangeRequest stsTokenExchangeRequest, com.google.api.client.http.HttpRequestFactory httpRequestFactory) -
exchangeToken
Exchanges the provided token for another type of token based on the RFC 8693 spec.- Throws:
IOException
-
buildTokenRequest
private com.google.api.client.util.GenericData buildTokenRequest() -
buildResponse
private StsTokenExchangeResponse buildResponse(com.google.api.client.util.GenericData responseData) throws IOException - Throws:
IOException
-
parseJson
- Throws:
IOException
-