Class BaseOAuth2RequestDecoder<T extends com.nimbusds.oauth2.sdk.Request>
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.decoder.AbstractMessageDecoder
-
- org.opensaml.messaging.decoder.servlet.AbstractHttpServletRequestMessageDecoder
-
- net.shibboleth.idp.plugin.oidc.op.oauth2.decoding.impl.BaseOAuth2RequestDecoder<T>
-
- Type Parameters:
T- The exact type of the request message, extendsRequest.
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,UnmodifiableComponent,MessageDecoder,HttpServletRequestMessageDecoder
- Direct Known Subclasses:
OAuth2AuthorizationRequestDecoder,OAuth2IntrospectionRequestDecoder,OAuth2RevocationRequestDecoder,OIDCAuthenticationRequestDecoder,OIDCClientRegistrationRequestDecoder,OIDCTokenRequestDecoder,OIDCUserInfoRequestDecoder
public abstract class BaseOAuth2RequestDecoder<T extends com.nimbusds.oauth2.sdk.Request> extends AbstractHttpServletRequestMessageDecoder
Base decoder for Nimbus OAuth2 request messages.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private org.slf4j.LoggerprotocolMessageLogUsed to log protocol messages.private booleanremoveIpAddressFromEndpointUriA flag to remove the IP address from the endpoint URI.
-
Constructor Summary
Constructors Constructor Description BaseOAuth2RequestDecoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoDecode()protected StringgetEndpointURI(T message)Returns the endpoint URI either from servlet request or from the given message, depending on the flag for removing IP address from the endpoint URI.protected abstract StringgetMessageToLog(T message)Get the string representation of what will be logged as the protocol message.protected org.slf4j.LoggergetProtocolMessageLog()Get the protocol message logger.protected abstract TparseMessage()Parses the message into the exact type of the request message.voidsetRemoveIpAddressFromEndpointUri(boolean flag)Set the flag to remove the IP address from the endpoint URI.-
Methods inherited from class org.opensaml.messaging.decoder.servlet.AbstractHttpServletRequestMessageDecoder
decode, doInitialize, getHttpServletRequest, getHttpServletRequestSupplier, setHttpServletRequest, setHttpServletRequestSupplier
-
Methods inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder
doDestroy, getMessageContext, setMessageContext
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Methods inherited from interface org.opensaml.messaging.decoder.MessageDecoder
getMessageContext
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
protocolMessageLog
@Nonnull private final org.slf4j.Logger protocolMessageLog
Used to log protocol messages.
-
removeIpAddressFromEndpointUri
private boolean removeIpAddressFromEndpointUri
A flag to remove the IP address from the endpoint URI.
-
-
Method Detail
-
setRemoveIpAddressFromEndpointUri
public void setRemoveIpAddressFromEndpointUri(boolean flag)
Set the flag to remove the IP address from the endpoint URI.- Parameters:
flag- What to set.
-
doDecode
protected void doDecode() throws MessageDecodingException- Specified by:
doDecodein classAbstractMessageDecoder- Throws:
MessageDecodingException
-
getProtocolMessageLog
@Nonnull protected org.slf4j.Logger getProtocolMessageLog()
Get the protocol message logger.- Returns:
- The protocol message logger
-
parseMessage
@Nullable protected abstract T parseMessage() throws MessageDecodingException
Parses the message into the exact type of the request message.- Returns:
- The request message
- Throws:
MessageDecodingException- if there is a problem decoding the message context
-
getMessageToLog
@Nullable protected abstract String getMessageToLog(T message)
Get the string representation of what will be logged as the protocol message.- Parameters:
message- the request message- Returns:
- the string representing the protocol message for logging purposes
-
getEndpointURI
@Nullable protected String getEndpointURI(T message)
Returns the endpoint URI either from servlet request or from the given message, depending on the flag for removing IP address from the endpoint URI.- Parameters:
message- the message from which to take the endpoint URI (with IP address), if the flag is false- Returns:
- the endpoint URI
-
-