Package net.shibboleth.idp.saml.profile.impl

# Class BaseIdPInitiatedSSORequestMessageDecoder

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.decoder.AbstractMessageDecoder
org.opensaml.messaging.decoder.servlet.AbstractHttpServletRequestMessageDecoder
net.shibboleth.idp.saml.profile.impl.BaseIdPInitiatedSSORequestMessageDecoder

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `UnmodifiableComponent`, `MessageDecoder`, `HttpServletRequestMessageDecoder`

Direct Known Subclasses:
  `IdPInitiatedSSORequestMessageDecoder`, `IdPInitiatedSSORequestMessageDecoder`

@NotThreadSafe public abstract class BaseIdPInitiatedSSORequestMessageDecoder extends AbstractHttpServletRequestMessageDecoder
Decodes an incoming Shibboleth Authentication Request message.

## Field Summary

Fields
Modifier and Type
Field
Description
`private BindingDescriptor`
`bindingDescriptor`
Optional `BindingDescriptor` to inject into `SAMLBindingContext` created.
`private final IdentifierGenerationStrategy`
`idGenerator`
ID generator.
`private final org.slf4j.Logger`
`log`
Class logger.
`static final String`
`PROVIDER_ID_PARAM`
Name of the query parameter carrying the service provider entity ID: "providerId" .
`static final String`
`SHIRE_PARAM`
Name of the query parameter carrying the service provider's assertion consumer service URL: "shire" .
`static final String`
`TARGET_PARAM`
Name of the query parameter carrying the service provider's target/RelayState information: "target" .
`static final String`
`TIME_PARAM`
Name of the query parameter carrying the current time at the service provider: "time" .

### Fields inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder

`BASE_PROTOCOL_MESSAGE_LOGGER_CATEGORY`

## Constructor Summary

Constructors
Constructor
Description
`BaseIdPInitiatedSSORequestMessageDecoder()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected IdPInitiatedSSORequest`
`buildIdPInitiatedSSORequest()`
Build a new IdP-initiated request structure from the inbound HTTP request.
`void`
`decode()`
`protected String`
`getAcsUrl(HttpServletRequest request)`
Gets the assertion consumer service URL for the service provider.
`BindingDescriptor`
`getBindingDescriptor()`
Get an optional `BindingDescriptor` to inject into `SAMLBindingContext` created.
`protected String`
`getEntityId(HttpServletRequest request)`
Gets the entity ID of the service provider.
`protected String`
`getMessageID()`
Construct a message ID for the request.
`protected String`
`getTarget(HttpServletRequest request)`
Gets the opaque relay state sent by the service provider.
`protected Instant`
`getTime(HttpServletRequest request)`
Gets the current time at the SP, if set.
`void`
`setBindingDescriptor(BindingDescriptor descriptor)`
Set an optional `BindingDescriptor` to inject into `SAMLBindingContext` created.

### Methods inherited from class org.opensaml.messaging.decoder.servlet.AbstractHttpServletRequestMessageDecoder

`doInitialize, getHttpServletRequest, getHttpServletRequestSupplier, isCheckDuringInit, setCheckDuringInit, setHttpServletRequestSupplier`

### Methods inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder

`doDecode, getMessageContext, getMessageToLog, getProtocolMessageLogger, getProtocolMessageLoggerSubCategory, logDecodedMessage, serializeMessageForLogging, setMessageContext, setProtocolMessageLoggerSubCategory`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

### Methods inherited from interface org.opensaml.messaging.decoder.MessageDecoder

`getMessageContext`

## Field Details

### PROVIDER_ID_PARAM

@Nonnull @NotEmpty public static final String PROVIDER_ID_PARAM
Name of the query parameter carrying the service provider entity ID: "providerId" .

See Also:
  - Constant Field Values

### SHIRE_PARAM

@Nonnull @NotEmpty public static final String SHIRE_PARAM
Name of the query parameter carrying the service provider's assertion consumer service URL: "shire" .

See Also:
  - Constant Field Values

### TARGET_PARAM

@Nonnull @NotEmpty public static final String TARGET_PARAM
Name of the query parameter carrying the service provider's target/RelayState information: "target" .

See Also:
  - Constant Field Values

### TIME_PARAM

@Nonnull @NotEmpty public static final String TIME_PARAM
Name of the query parameter carrying the current time at the service provider: "time" .

See Also:
  - Constant Field Values

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### bindingDescriptor

@Nullable private BindingDescriptor bindingDescriptor
Optional `BindingDescriptor` to inject into `SAMLBindingContext` created.

### idGenerator

@Nonnull private final IdentifierGenerationStrategy idGenerator
ID generator.

## Constructor Details

### BaseIdPInitiatedSSORequestMessageDecoder

public BaseIdPInitiatedSSORequestMessageDecoder()
Constructor.

## Method Details

### getBindingDescriptor

@Nullable public BindingDescriptor getBindingDescriptor()
Get an optional `BindingDescriptor` to inject into `SAMLBindingContext` created.

Returns:
  binding descriptor

### setBindingDescriptor

public void setBindingDescriptor(@Nullable BindingDescriptor descriptor)
Set an optional `BindingDescriptor` to inject into `SAMLBindingContext` created.

Parameters:
  `descriptor` - a binding descriptor

### decode

public void decode() throws MessageDecodingException

Specified by:
  `decode` in interface `MessageDecoder`
Overrides:
  `decode` in class `AbstractMessageDecoder`
Throws:
  `MessageDecodingException`

### buildIdPInitiatedSSORequest

@Nonnull protected IdPInitiatedSSORequest buildIdPInitiatedSSORequest() throws MessageDecodingException
Build a new IdP-initiated request structure from the inbound HTTP request.

Returns:
  the new SSO request structure
Throws:
  `MessageDecodingException` - if the request doesn't contain an entityID

### getEntityId

@Nonnull @NotEmpty protected String getEntityId(@Nonnull HttpServletRequest request) throws MessageDecodingException
Gets the entity ID of the service provider.

Parameters:
  `request` - current HTTP request
Returns:
  the entity ID of the service provider
Throws:
  `MessageDecodingException` - thrown if the request does not contain a service provider entity ID

### getAcsUrl

@Nullable protected String getAcsUrl(@Nonnull HttpServletRequest request)
Gets the assertion consumer service URL for the service provider.

Parameters:
  `request` - current HTTP request
Returns:
  the assertion consumer service URL, may be null if none is given in the request

### getTarget

@Nullable protected String getTarget(@Nonnull HttpServletRequest request)
Gets the opaque relay state sent by the service provider.

Parameters:
  `request` - current HTTP request
Returns:
  the relay state, or null if the service provider did not send one

### getTime

@Nullable protected Instant getTime(@Nonnull HttpServletRequest request) throws MessageDecodingException
Gets the current time at the SP, if set.

Parameters:
  `request` - current HTTP request
Returns:
  the time sent by the service provider, or null
Throws:
  `MessageDecodingException` - thrown if the time parameter given by the service provider is non-numeric or a negative time

### getMessageID

@Nonnull protected String getMessageID()
Construct a message ID for the request.

Returns:
  the message ID to use