Class AccessTokenResponseDecoder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.oidc.profile.decoding.impl.AbstractJSONResponseDecoderFunction<com.nimbusds.oauth2.sdk.TokenResponse>
net.shibboleth.oidc.profile.decoding.impl.AccessTokenResponseDecoder
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,org.apache.hc.core5.http.io.HttpClientResponseHandler<com.nimbusds.oauth2.sdk.TokenResponse>
public class AccessTokenResponseDecoder
extends AbstractJSONResponseDecoderFunction<com.nimbusds.oauth2.sdk.TokenResponse>
Default access token response decoder which converts a successful HTTP response into an
OIDCTokenResponse and a unsuccessful response into an TokenErrorResponse.
Any decoding error is logged and null is returned.-
Field Summary
FieldsFields inherited from class net.shibboleth.oidc.profile.decoding.impl.AbstractJSONResponseDecoderFunction
BASE_PROTOCOL_MESSAGE_LOGGER_CATEGORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.nimbusds.oauth2.sdk.TokenResponsedoHandleResponse(org.apache.hc.core5.http.ClassicHttpResponse httpResponse) Do the actual response processing and return a result.protected StringserializeMessageForLogging(com.nimbusds.oauth2.sdk.TokenResponse response) Serialize the message for logging purposes.Methods inherited from class net.shibboleth.oidc.profile.decoding.impl.AbstractJSONResponseDecoderFunction
doInitialize, getObjectMapper, getProtocolMessageForErrorObject, getProtocolMessageLoggerSubCategory, handleResponse, logDecodedMessage, setObjectMapper, setProtocolMessageLoggerSubCategoryMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger.
-
-
Constructor Details
-
AccessTokenResponseDecoder
public AccessTokenResponseDecoder()Constructor.
-
-
Method Details
-
doHandleResponse
public com.nimbusds.oauth2.sdk.TokenResponse doHandleResponse(org.apache.hc.core5.http.ClassicHttpResponse httpResponse) throws org.apache.hc.core5.http.HttpException, IOException Do the actual response processing and return a result. Overridden by implementation classes.- Specified by:
doHandleResponsein classAbstractJSONResponseDecoderFunction<com.nimbusds.oauth2.sdk.TokenResponse>- Parameters:
httpResponse- the http response- Throws:
org.apache.hc.core5.http.HttpExceptionIOException
-
serializeMessageForLogging
@Nullable protected String serializeMessageForLogging(@Nullable com.nimbusds.oauth2.sdk.TokenResponse response) Description copied from class:AbstractJSONResponseDecoderFunctionSerialize the message for logging purposes.Default implementation is to return the message object's
Object.toString(), but subclasses should override if a better message-specific serialization mechanism exists.- Overrides:
serializeMessageForLoggingin classAbstractJSONResponseDecoderFunction<com.nimbusds.oauth2.sdk.TokenResponse>- Parameters:
response- the response message to serialize- Returns:
- the serialized message, or null if message can not be serialized
-