public abstract class AbstractSAMLProfileHandler extends AbstractShibbolethProfileHandler<SAMLMDRelyingPartyConfigurationManager,Session>
修飾子 | コンストラクタと説明 |
---|---|
protected |
AbstractSAMLProfileHandler()
Constructor.
|
修飾子とタイプ | メソッドと説明 |
---|---|
protected void |
encodeResponse(BaseSAMLProfileRequestContext requestContext)
Encodes the request's SAML response and writes it to the servlet response.
|
protected void |
filterNameIDAttributesByFormats(Collection<BaseAttribute<?>> attributes,
Collection<String> acceptableFormats)
Filters a collection of attributes removing those attributes that can not be encoded in to a name identifier of
an acceptable format.
|
protected <T extends SAMLNameIdentifierEncoder> |
filterNameIDAttributesByProtocol(Collection<BaseAttribute<?>> attributes,
Class<T> nameIdEncoderType)
Filters a collection of attributes removing those attributes which do not have an associated encoder of a given
type.
|
protected org.slf4j.Logger |
getAduitLog()
推奨されていません。
Gets the audit log for this handler.
|
protected org.slf4j.Logger |
getAuditLog()
Gets the audit log for this handler.
|
protected List<String> |
getEntitySupportedFormats(RoleDescriptor role)
Gets the list of name identifier formats supported for a given role.
|
IdentifierGenerator |
getIdGenerator()
Gets an ID generator which may be used for SAML assertions, requests, etc.
|
String |
getInboundBinding()
Gets the SAML message binding used by inbound messages.
|
protected SAMLMessageDecoder |
getInboundMessageDecoder(BaseSAMLProfileRequestContext requestContext)
Get the inbound message decoder to use.
|
Map<String,SAMLMessageDecoder> |
getMessageDecoders()
Gets all the SAML message decoders configured for the IdP indexed by SAML binding URI.
|
Map<String,SAMLMessageEncoder> |
getMessageEncoders()
Gets all the SAML message encoders configured for the IdP indexed by SAML binding URI.
|
MetadataCredentialResolver |
getMetadataCredentialResolver()
A convenience method for obtaining a metadata credential resolver for the current metadata provider.
|
MetadataProvider |
getMetadataProvider()
A convenience method for retrieving the SAML metadata provider from the relying party manager.
|
protected SAMLMessageEncoder |
getOutboundMessageEncoder(BaseSAMLProfileRequestContext requestContext)
Get the outbound message encoder to use.
|
RelyingPartyConfiguration |
getRelyingPartyConfiguration(String relyingPartyId)
Gets the relying party configuration for the given entity.
|
protected String |
getRequiredNameIDFormat(BaseSAMLProfileRequestContext requestContext)
Gets the name identifier format required to be sent back to the relying party.
|
SecurityPolicyResolver |
getSecurityPolicyResolver()
Gets the resolver used to determine active security policy for an incoming request.
|
protected List<String> |
getSupportedNameFormats(BaseSAMLProfileRequestContext requestContext)
Gets the name identifier formats to use when creating identifiers for the relying party.
|
List<String> |
getSupportedOutboundBindings()
Gets the SAML message bindings that may be used by outbound messages.
|
protected Session |
getUserSession(InTransport inTransport)
Gets the user's session, if there is one.
|
protected Session |
getUserSession(String principalName)
Gets the user's session based on their principal name.
|
protected boolean |
isSignResponse(BaseSAMLProfileRequestContext requestContext)
Determine whether responses should be signed.
|
protected void |
populateAssertingPartyInformation(BaseSAMLProfileRequestContext requestContext)
Populates the request context with information about the asserting party.
|
protected void |
populateProfileInformation(BaseSAMLProfileRequestContext requestContext)
Populates the request context with the information about the profile.
|
protected void |
populateRelyingPartyInformation(BaseSAMLProfileRequestContext requestContext)
Populates the request context with information about the relying party.
|
protected void |
populateRequestContext(BaseSAMLProfileRequestContext requestContext)
Populates the request context with information.
|
protected abstract void |
populateSAMLMessageInformation(BaseSAMLProfileRequestContext requestContext)
Populates the request context with information from the inbound SAML message.
|
protected abstract void |
populateUserInformation(BaseSAMLProfileRequestContext requestContext)
Populates the request context with the information about the user if they have an existing session.
|
protected abstract Endpoint |
selectEndpoint(BaseSAMLProfileRequestContext requestContext)
Selects the appropriate endpoint for the relying party and stores it in the request context.
|
protected <T extends SAMLNameIdentifierEncoder> |
selectNameIDAttributeAndEncoder(Class<T> nameIdEncoderType,
BaseSAMLProfileRequestContext requestContext)
Attempts to select the most fitting name identifier attribute, and associated encoder, for a request.
|
protected <T extends SAMLNameIdentifierEncoder> |
selectNameIDAttributeAndEncoder(Collection<BaseAttribute<?>> attributes,
Class<T> nameIdEncoderType,
String[] formatPrecedence)
Selects a name identifier attribute from a collection of attributes.
|
void |
setIdGenerator(IdentifierGenerator generator)
Gets an ID generator which may be used for SAML assertions, requests, etc.
|
void |
setInboundBinding(String binding)
Sets the SAML message binding used by inbound messages.
|
void |
setMessageDecoders(Map<String,SAMLMessageDecoder> decoders)
Sets all the SAML message decoders configured for the IdP indexed by SAML binding URI.
|
void |
setMessageEncoders(Map<String,SAMLMessageEncoder> encoders)
Sets all the SAML message encoders configured for the IdP indexed by SAML binding URI.
|
void |
setSecurityPolicyResolver(SecurityPolicyResolver resolver)
Sets the resolver used to determine active security policy for an incoming request.
|
void |
setSupportedOutboundBindings(List<String> bindings)
Sets the SAML message bindings that may be used by outbound messages.
|
protected void |
writeAuditLogEntry(BaseSAMLProfileRequestContext context)
Writes an audit log entry indicating the successful response to the attribute request.
|
getBuilderFactory, getParserPool, getProfileConfiguration, getProfileId, getRelyingPartyConfigurationManager, getSessionManager, getStorageService, setParserPool, setRelyingPartyConfigurationManager, setSessionManager, setStorageService
getRequestPaths, setRequestPaths
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processRequest
public SecurityPolicyResolver getSecurityPolicyResolver()
public void setSecurityPolicyResolver(SecurityPolicyResolver resolver)
resolver
- resolver used to determine active security policy for an incoming requestprotected org.slf4j.Logger getAduitLog()
protected org.slf4j.Logger getAuditLog()
public IdentifierGenerator getIdGenerator()
public String getInboundBinding()
public Map<String,SAMLMessageDecoder> getMessageDecoders()
public Map<String,SAMLMessageEncoder> getMessageEncoders()
public MetadataProvider getMetadataProvider()
public MetadataCredentialResolver getMetadataCredentialResolver()
public List<String> getSupportedOutboundBindings()
protected Session getUserSession(InTransport inTransport)
inTransport
- current inbound transportprotected Session getUserSession(String principalName)
principalName
- user's principal namepublic void setIdGenerator(IdentifierGenerator generator)
generator
- an ID generator which may be used for SAML assertions, requests, etcpublic void setInboundBinding(String binding)
binding
- SAML message binding used by inbound messagespublic void setMessageDecoders(Map<String,SAMLMessageDecoder> decoders)
decoders
- SAML message decoders configured for the IdP indexed by SAML binding URIpublic void setMessageEncoders(Map<String,SAMLMessageEncoder> encoders)
encoders
- SAML message encoders configured for the IdP indexed by SAML binding URIpublic void setSupportedOutboundBindings(List<String> bindings)
bindings
- SAML message bindings that may be used by outbound messagespublic RelyingPartyConfiguration getRelyingPartyConfiguration(String relyingPartyId)
AbstractShibbolethProfileHandler.getRelyingPartyConfigurationManager()
and then
invoking RelyingPartyConfigurationManager.getRelyingPartyConfiguration(String)
.getRelyingPartyConfiguration
クラス内 AbstractShibbolethProfileHandler<SAMLMDRelyingPartyConfigurationManager,Session>
relyingPartyId
- ID of the relying partyprotected void populateRequestContext(BaseSAMLProfileRequestContext requestContext) throws ProfileException
requestContext
- current request contextProfileException
- thrown if there is a problem looking up the relying party's metadataprotected void populateRelyingPartyInformation(BaseSAMLProfileRequestContext requestContext) throws ProfileException
requestContext
- current request contextProfileException
- thrown if there is a problem looking up the relying party's metadataprotected void populateAssertingPartyInformation(BaseSAMLProfileRequestContext requestContext) throws ProfileException
populateRequestContext(BaseSAMLProfileRequestContext)
has already invoked
populateRelyingPartyInformation(BaseSAMLProfileRequestContext)
has already been invoked and the
properties it provides are available in the request context.
This method requires the the following request context properties to be populated: metadata provider, relying
party configuration
This methods populates the following request context properties: local entity ID, outbound message issuer, local
entity metadatarequestContext
- current request contextProfileException
- thrown if there is a problem looking up the asserting party's metadataprotected abstract void populateSAMLMessageInformation(BaseSAMLProfileRequestContext requestContext) throws ProfileException
populateRequestContext(BaseSAMLProfileRequestContext)
has already invoked
populateRelyingPartyInformation(BaseSAMLProfileRequestContext)
,and
populateAssertingPartyInformation(BaseSAMLProfileRequestContext)
have already been invoked and the
properties they provide are available in the request context.requestContext
- current request contextProfileException
- thrown if there is a problem populating the request context with informationprotected void populateProfileInformation(BaseSAMLProfileRequestContext requestContext) throws ProfileException
populateRequestContext(BaseSAMLProfileRequestContext)
has already invoked
populateRelyingPartyInformation(BaseSAMLProfileRequestContext)
,
populateAssertingPartyInformation(BaseSAMLProfileRequestContext)
, and
populateSAMLMessageInformation(BaseSAMLProfileRequestContext)
have already been invoked and the
properties they provide are available in the request context.
This method requires the the following request context properties to be populated: relying party configuration
This methods populates the following request context properties: communication profile ID, profile configuration,
outbound message artifact type, peer entity endpointrequestContext
- current request contextProfileException
- thrown if there is a problem populating the profile informationprotected <T extends SAMLNameIdentifierEncoder> Pair<BaseAttribute,T> selectNameIDAttributeAndEncoder(Class<T> nameIdEncoderType, BaseSAMLProfileRequestContext requestContext) throws ProfileException
getRequiredNameIDFormat(BaseSAMLProfileRequestContext)
, then either an
attribute with an encoder supporting that format is selected or an exception is thrown. If no specific format is
required then an attribute supporting a format listed as supported by the relying party is used. If the relying
party does not list any supported formats then any attribute supporting the correct name identifier type is used.T
- type of name identifier encoder the attribute must supportnameIdEncoderType
- type of name identifier encoder the attribute must supportrequestContext
- the current request contextProfileException
- thrown if a specific name identifier format was required but not supportedprotected <T extends SAMLNameIdentifierEncoder> void filterNameIDAttributesByProtocol(Collection<BaseAttribute<?>> attributes, Class<T> nameIdEncoderType)
T
- the type of the encoderattributes
- the attributes to be filtered, may not contain null valuesnameIdEncoderType
- the type of the encoder, may not be nullProfileException
protected void filterNameIDAttributesByFormats(Collection<BaseAttribute<?>> attributes, Collection<String> acceptableFormats)
attributes
- the attributes to be filtered, may not contain null valuesacceptableFormats
- name identifier formats which are acceptable, a null or empty collection means any
format is acceptableprotected String getRequiredNameIDFormat(BaseSAMLProfileRequestContext requestContext)
requestContext
- current request contextprotected List<String> getSupportedNameFormats(BaseSAMLProfileRequestContext requestContext) throws ProfileException
requestContext
- current request contextProfileException
- thrown if there is a problem determining the name identifier format to useprotected List<String> getEntitySupportedFormats(RoleDescriptor role)
role
- the role to get the list of supported name identifier formatsprotected <T extends SAMLNameIdentifierEncoder> Pair<BaseAttribute,T> selectNameIDAttributeAndEncoder(Collection<BaseAttribute<?>> attributes, Class<T> nameIdEncoderType, String[] formatPrecedence)
T
- type name identifierattributes
- attributes from which the identifier is selected, may not contain null valuesnameIdEncoderType
- encoder to be used to encode the selected attributeformatPrecedence
- precedence of name identifier formats, may not contain null valuesprotected abstract void populateUserInformation(BaseSAMLProfileRequestContext requestContext) throws ProfileException
populateRequestContext(BaseSAMLProfileRequestContext)
has already invoked
populateRelyingPartyInformation(BaseSAMLProfileRequestContext)
,
populateAssertingPartyInformation(BaseSAMLProfileRequestContext)
,
populateProfileInformation(BaseSAMLProfileRequestContext)
, and
populateSAMLMessageInformation(BaseSAMLProfileRequestContext)
have already been invoked and the
properties they provide are available in the request context.
This method should populate: user's session, user's principal name, and service authentication methodrequestContext
- current request contextProfileException
- thrown if there is a problem populating the user's informationprotected abstract Endpoint selectEndpoint(BaseSAMLProfileRequestContext requestContext) throws ProfileException
requestContext
- current request contextProfileException
- thrown if there is a problem selecting a response endpointprotected void encodeResponse(BaseSAMLProfileRequestContext requestContext) throws ProfileException
requestContext
- current request contextProfileException
- thrown if no message encoder is registered for this profiles bindingprotected boolean isSignResponse(BaseSAMLProfileRequestContext requestContext) throws ProfileException
requestContext
- the current request contextProfileException
- if there is a problem determining whether responses should be signedprotected SAMLMessageEncoder getOutboundMessageEncoder(BaseSAMLProfileRequestContext requestContext) throws ProfileException
The default implementation uses the binding URI from the
SAMLMessageContext.getPeerEntityEndpoint()
to lookup the encoder from the
supported message encoders defined in getMessageEncoders()
.
Subclasses may override to implement a different mechanism to determine the encoder to use, such as for example cases where an active intermediary actor sits between this provider and the peer entity endpoint (e.g. the SAML 2 ECP case).
requestContext
- current request contextProfileException
- if the encoder to use can not be resolved based on the request contextprotected SAMLMessageDecoder getInboundMessageDecoder(BaseSAMLProfileRequestContext requestContext) throws ProfileException
The default implementation uses the binding URI from getInboundBinding()
to lookup the decoder from the
supported message decoders defined in getMessageDecoders()
.
Subclasses may override to implement a different mechanism to determine the decoder to use.
requestContext
- current request contextProfileException
- if the decoder to use can not be resolved based on the request contextprotected void writeAuditLogEntry(BaseSAMLProfileRequestContext context)
context
- current request contextCopyright © 2012. All Rights Reserved.