|
Spring Security SAML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.security.saml.util.SAMLUtil
public class SAMLUtil
Utility class for SAML entities
Constructor Summary | |
---|---|
SAMLUtil()
|
Method Summary | ||
---|---|---|
static boolean |
compare(byte[] hashID,
String entityId)
Helper method compares whether SHA-1 hash of the entityId equals the hashID. |
|
static org.opensaml.saml2.metadata.ArtifactResolutionService |
getArtifactResolutionService(org.opensaml.saml2.metadata.IDPSSODescriptor idpssoDescriptor,
int endpointIndex)
|
|
static List<String> |
getBase64EncodeCertificates(org.opensaml.xml.signature.KeyInfo keyInfo)
Parses list of all Base64 encoded certificates found inside the KeyInfo element. |
|
static List<String> |
getBase64EncodedCertificates(org.opensaml.xml.signature.X509Data x509Data)
Parses list of Base64 encoded certificates present in the X509Data element. |
|
static String |
getBindingForEndpoint(org.opensaml.saml2.metadata.Endpoint endpoint)
Method determines binding supported by the given endpoint. |
|
static org.opensaml.saml2.metadata.AssertionConsumerService |
getConsumerService(org.opensaml.saml2.metadata.SPSSODescriptor ssoDescriptor,
Integer index)
Loads the assertionConsumerIndex designated by the index. |
|
static String |
getDefaultBinding(org.opensaml.saml2.metadata.IDPSSODescriptor descriptor)
Returns default binding supported by IDP. |
|
static
|
getEndpoint(List<T> endpoints,
String messageBinding,
String filterURL)
Method helps to identify which endpoint is used to process the current message. |
|
static org.opensaml.saml2.metadata.IDPSSODescriptor |
getIDPDescriptor(MetadataManager metadata,
String idpId)
Loads IDP descriptor for entity with the given entityID. |
|
static org.opensaml.saml2.metadata.IDPSSODescriptor |
getIDPSSODescriptor(org.opensaml.saml2.metadata.EntityDescriptor idpEntityDescriptor)
|
|
static String |
getLogoutBinding(org.opensaml.saml2.metadata.IDPSSODescriptor idp,
org.opensaml.saml2.metadata.SPSSODescriptor sp)
|
|
static org.opensaml.saml2.metadata.SingleLogoutService |
getLogoutServiceForBinding(org.opensaml.saml2.metadata.SSODescriptor descriptor,
String binding)
Returns Single logout service for given binding of the IDP. |
|
static boolean |
isDateTimeSkewValid(int skewInSec,
org.joda.time.DateTime time)
Verifies that the current time is within skewInSec interval from the time value. |
|
static boolean |
isDateTimeSkewValid(int skewInSec,
int forwardInterval,
org.joda.time.DateTime time)
Verifies that the current time fits into interval defined by time minus backwardInterval minus skew and time plus forward interval plus skew. |
|
static boolean |
isECPRequest(HttpServletRequest request)
Analyzes the request headers in order to determine if it comes from an ECP-enabled client and based on this decides whether ECP profile will be used. |
|
static Element |
marshallMessage(org.opensaml.xml.XMLObject message)
Helper method that marshals the given message. |
|
static boolean |
processFilter(String filterName,
HttpServletRequest request)
Determines whether filter with the given name should be invoked for the current request. |
|
static void |
verifyAlias(String alias,
String entityId)
Verifies that the alias is valid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SAMLUtil()
Method Detail |
---|
public static String getBindingForEndpoint(org.opensaml.saml2.metadata.Endpoint endpoint)
endpoint
- endpoint
org.opensaml.saml2.metadata.provider.MetadataProviderException
- in case binding can't be determinedpublic static org.opensaml.saml2.metadata.SingleLogoutService getLogoutServiceForBinding(org.opensaml.saml2.metadata.SSODescriptor descriptor, String binding) throws org.opensaml.saml2.metadata.provider.MetadataProviderException
descriptor
- IDP to search for service inbinding
- binding supported by the service
org.opensaml.saml2.metadata.provider.MetadataProviderException
- if the service can't be determinedpublic static String getLogoutBinding(org.opensaml.saml2.metadata.IDPSSODescriptor idp, org.opensaml.saml2.metadata.SPSSODescriptor sp) throws org.opensaml.saml2.metadata.provider.MetadataProviderException
org.opensaml.saml2.metadata.provider.MetadataProviderException
public static String getDefaultBinding(org.opensaml.saml2.metadata.IDPSSODescriptor descriptor) throws org.opensaml.saml2.metadata.provider.MetadataProviderException
descriptor
- descriptor to return binding for
org.opensaml.saml2.metadata.provider.MetadataProviderException
- no binding foundpublic static org.opensaml.saml2.metadata.IDPSSODescriptor getIDPSSODescriptor(org.opensaml.saml2.metadata.EntityDescriptor idpEntityDescriptor) throws org.opensaml.ws.message.decoder.MessageDecodingException
org.opensaml.ws.message.decoder.MessageDecodingException
public static org.opensaml.saml2.metadata.AssertionConsumerService getConsumerService(org.opensaml.saml2.metadata.SPSSODescriptor ssoDescriptor, Integer index)
ssoDescriptor
- descriptorindex
- to load, can be null
org.opensaml.common.SAMLRuntimeException
- in case assertionConsumerService with given index isn't foundpublic static org.opensaml.saml2.metadata.ArtifactResolutionService getArtifactResolutionService(org.opensaml.saml2.metadata.IDPSSODescriptor idpssoDescriptor, int endpointIndex) throws org.opensaml.ws.message.decoder.MessageDecodingException
org.opensaml.ws.message.decoder.MessageDecodingException
public static boolean processFilter(String filterName, HttpServletRequest request)
filterName
- name of the filter to search URI forrequest
- request
public static boolean compare(byte[] hashID, String entityId) throws org.opensaml.saml2.metadata.provider.MetadataProviderException
hashID
- hash id to compareentityId
- entity id to hash and verify
org.opensaml.saml2.metadata.provider.MetadataProviderException
- in case SHA-1 hash can't be initializedpublic static void verifyAlias(String alias, String entityId) throws org.opensaml.saml2.metadata.provider.MetadataProviderException
alias
- alias to verify
org.opensaml.saml2.metadata.provider.MetadataProviderException
- in case any validation problem is foundpublic static List<String> getBase64EncodeCertificates(org.opensaml.xml.signature.KeyInfo keyInfo)
keyInfo
- key info to parse
public static List<String> getBase64EncodedCertificates(org.opensaml.xml.signature.X509Data x509Data)
x509Data
- data to parse
public static boolean isECPRequest(HttpServletRequest request)
request
- request to analyze
public static <T extends org.opensaml.saml2.metadata.Endpoint> T getEndpoint(List<T> endpoints, String messageBinding, String filterURL) throws org.opensaml.common.SAMLException
T
- type of the endpointendpoints
- endpoints to checkmessageBinding
- bindingfilterURL
- url of the filter processing the request
org.opensaml.common.SAMLException
- in case endpoint can't be foundpublic static org.opensaml.saml2.metadata.IDPSSODescriptor getIDPDescriptor(MetadataManager metadata, String idpId) throws org.opensaml.saml2.metadata.provider.MetadataProviderException
metadata
- metadata manageridpId
- entity ID
org.opensaml.saml2.metadata.provider.MetadataProviderException
- in case descriptor can't be foundpublic static Element marshallMessage(org.opensaml.xml.XMLObject message) throws org.opensaml.ws.message.encoder.MessageEncodingException
message
- message the marshall and serialize
org.opensaml.ws.message.encoder.MessageEncodingException
- thrown if the give message can not be marshaled into its DOM representationpublic static boolean isDateTimeSkewValid(int skewInSec, org.joda.time.DateTime time)
skewInSec
- skew interval in secondstime
- time the current time must fit into with the given skew
public static boolean isDateTimeSkewValid(int skewInSec, int forwardInterval, org.joda.time.DateTime time)
skewInSec
- skew interval in secondsforwardInterval
- forward interval in sectime
- time the current time must fit into with the given skew
|
Spring Security SAML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |