Class OpenSamlUtil
java.lang.Object
swiss.trustbroker.common.saml.util.OpenSamlUtil
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic org.opensaml.saml.saml2.core.Assertionstatic org.opensaml.saml.saml2.core.AssertionbuildAssertionObject(String skinnyXmlns) static <T> TbuildSamlObject(Class<T> clazz) static <T> TbuildSamlObject(Class<T> clazz, QName elementName) static StringcalculateArtifactSourceIdFromIssuerId(String issuerId) static voidcheckAssertionsLimitations(List<org.opensaml.saml.saml2.core.Assertion> assertions, List<org.opensaml.saml.saml2.core.EncryptedAssertion> encryptedAssertions, String purpose) static voidcheckResponseLimitations(org.opensaml.saml.saml2.core.Response response, String purpose) static voidcheckResponsePresent(org.opensaml.saml.saml2.core.Response response, String purpose) static <T extends org.opensaml.saml.saml2.binding.encoding.impl.HTTPPostEncoder>
TconfigureSamlPostEncoder(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, org.apache.velocity.app.VelocityEngine velocityEngine, T encoder) static <T extends org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder>
TconfigureSamlRedirectEncoder(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, T encoder) static org.opensaml.saml.saml2.core.ScopingconstructIdpScoping(String idpId) static org.opensaml.saml.common.binding.artifact.SAMLArtifactMapstatic org.opensaml.saml.common.binding.artifact.SAMLArtifactMapcreateArtifactMap(Optional<org.opensaml.storage.StorageService> storageService, Duration artifactLifetime, Duration cleanupInterval) static <T extends org.opensaml.saml.common.SAMLObject>
org.opensaml.messaging.context.MessageContextcreateMessageContext(T samlObject, org.opensaml.security.credential.Credential credential, String endpoint, String relayState) static org.opensaml.saml.saml2.binding.encoding.impl.HTTPArtifactEncodercreateSamlArtifactEncoder(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap) static org.opensaml.saml.saml2.binding.encoding.impl.HTTPSOAP11EncodercreateSamlSoapEncoder(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context) static org.apache.velocity.app.VelocityEnginecreateVelocityEngine(String velocityTemplatePath) static org.opensaml.messaging.context.MessageContextdecodeSamlArtifactMessage(jakarta.servlet.http.HttpServletRequest request, String issuerId, ArtifactPeer peer, Optional<SignatureParameters> signatureParameters, SignatureValidationParameters signatureValidationParameters, Optional<org.apache.hc.client5.http.classic.HttpClient> httpClientOpt) static org.opensaml.messaging.context.MessageContextdecodeSamlPostMessage(jakarta.servlet.http.HttpServletRequest request) static org.opensaml.messaging.context.MessageContextdecodeSamlRedirectMessage(jakarta.servlet.http.HttpServletRequest request) static org.opensaml.messaging.context.MessageContextdecodeSamlSoapMessage(jakarta.servlet.http.HttpServletRequest request) static StringdomObjectToString(Element element) static StringdomObjectToString(Element element, boolean secure, boolean prettyPrint) static voidencodeSamlArtifactMessage(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap) static voidencodeSamlPostMessage(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.saml2.binding.encoding.impl.HTTPPostEncoder encoder) static <T extends org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder>
voidencodeSamlRedirectMessage(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, T encoder) static voidencodeSamlSoapMessage(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context) static org.opensaml.saml.saml2.core.AuthnContextComparisonTypeEnumerationextractAuthnRequestComparison(org.opensaml.saml.saml2.core.AuthnRequest authnRequest) extractAuthnRequestContextClasses(org.opensaml.saml.saml2.core.AuthnRequest authnRequest) extractAuthnRequestContextClasses(org.opensaml.saml.saml2.core.AuthnRequest authnRequest, Boolean replaceInbound, Optional<List<String>> confClasses) static StringextractAuthnStatementContextClass(org.opensaml.saml.saml2.core.AuthnStatement authnStatement) static StringextractIdpScoping(org.opensaml.saml.saml2.core.AuthnRequest authnRequest) static StringextractRelayStateAsSessionId(org.opensaml.messaging.context.MessageContext messageContext) static StringextractSourceIdFromArtifactId(String artifactId) static StringextractSourceIdFromArtifactMessage(jakarta.servlet.http.HttpServletRequest request) static <T extends org.opensaml.core.xml.XMLObject>
TfindChildObjectByQname(List<org.opensaml.core.xml.XMLObject> childObjects, QName qName) static Stringstatic org.opensaml.saml.saml2.metadata.EndpointgetEndpoint(org.opensaml.messaging.context.MessageContext context) static StringgetMessageIssuerId(org.opensaml.saml.common.SAMLObject samlObject) static StringgetNestedStatusCode(org.opensaml.saml.saml2.core.StatusResponseType response) static StringgetStatusCode(org.opensaml.saml.saml2.core.StatusResponseType response) static StringgetStatusMessage(org.opensaml.saml.saml2.core.StatusResponseType response) static voidinitAndEncodeSamlArtifactMessage(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, String issuerId, org.apache.velocity.app.VelocityEngine velocityEngine, ArtifactResolutionParameters artifactResolutionParameters, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap) static voidinitiateArtifactBindingContext(org.opensaml.messaging.context.MessageContext context, String issuerId, ArtifactResolutionParameters artifactResolutionParameters) static booleanisForceAuthnRequest(org.opensaml.saml.saml2.core.AuthnRequest authnRequest) static booleanisSamlArtifactRequest(jakarta.servlet.http.HttpServletRequest httpServletRequest) static booleanisSamlPostRequest(jakarta.servlet.http.HttpServletRequest httpServletRequest) static booleanisSamlRedirectRequest(jakarta.servlet.http.HttpServletRequest httpServletRequest) static StringreplaceSensitiveData(String xmlString) static StringreplaceSensitiveData(String xmlString, List<String> xmlTags) static StringsamlObjectToString(org.opensaml.core.xml.XMLObject object) static StringsamlObjectToString(org.opensaml.core.xml.XMLObject object, boolean secure) static StringsamlObjectToString(org.opensaml.core.xml.XMLObject object, boolean secure, boolean prettyPrint) static <T extends org.opensaml.saml.saml2.core.RequestAbstractType>
voidsendSamlRequest(org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap, SamlBinding binding, ArtifactResolutionParameters artifactResolutionParameters, T samlRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.security.credential.Credential credential, String endpoint, String relayState, String destinationAlias) static <T extends org.opensaml.saml.common.SAMLObject>
voidsendSamlSoapMessage(org.opensaml.messaging.context.MessageContext context, T samlObject, jakarta.servlet.http.HttpServletResponse httpServletResponse, String destinationAlias) static voidsetEndpoint(org.opensaml.messaging.context.MessageContext context, String idpSsoDestination) static voidsetEndpoint(org.opensaml.messaging.context.MessageContext context, org.opensaml.saml.saml2.metadata.Endpoint endpoint) static voidstatic voidsetSignatureParameter(org.opensaml.messaging.context.MessageContext context, org.opensaml.security.credential.Credential credential)
-
Field Details
-
SKINNY_NO_TYPE
- See Also:
-
SKINNY_ALL
- See Also:
-
-
Method Details
-
buildAssertionObject
public static org.opensaml.saml.saml2.core.Assertion buildAssertionObject() -
buildAssertionObject
-
buildSamlObject
-
buildSamlObject
-
getMessageIssuerId
-
generateSecureRandomId
-
samlObjectToString
-
samlObjectToString
-
samlObjectToString
public static String samlObjectToString(org.opensaml.core.xml.XMLObject object, boolean secure, boolean prettyPrint) -
domObjectToString
-
domObjectToString
-
findChildObjectByQname
-
encodeSamlPostMessage
public static void encodeSamlPostMessage(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.saml2.binding.encoding.impl.HTTPPostEncoder encoder) -
encodeSamlRedirectMessage
public static <T extends org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder> void encodeSamlRedirectMessage(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, T encoder) -
encodeSamlSoapMessage
public static void encodeSamlSoapMessage(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context) -
configureSamlRedirectEncoder
public static <T extends org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder> T configureSamlRedirectEncoder(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, T encoder) -
configureSamlPostEncoder
public static <T extends org.opensaml.saml.saml2.binding.encoding.impl.HTTPPostEncoder> T configureSamlPostEncoder(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, org.apache.velocity.app.VelocityEngine velocityEngine, T encoder) -
createSamlArtifactEncoder
public static org.opensaml.saml.saml2.binding.encoding.impl.HTTPArtifactEncoder createSamlArtifactEncoder(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap) -
createSamlSoapEncoder
public static org.opensaml.saml.saml2.binding.encoding.impl.HTTPSOAP11Encoder createSamlSoapEncoder(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context) -
initAndEncodeSamlArtifactMessage
public static void initAndEncodeSamlArtifactMessage(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, String issuerId, org.apache.velocity.app.VelocityEngine velocityEngine, ArtifactResolutionParameters artifactResolutionParameters, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap) -
encodeSamlArtifactMessage
public static void encodeSamlArtifactMessage(jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.messaging.context.MessageContext context, org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap) -
isSamlArtifactRequest
public static boolean isSamlArtifactRequest(jakarta.servlet.http.HttpServletRequest httpServletRequest) -
isSamlRedirectRequest
public static boolean isSamlRedirectRequest(jakarta.servlet.http.HttpServletRequest httpServletRequest) -
isSamlPostRequest
public static boolean isSamlPostRequest(jakarta.servlet.http.HttpServletRequest httpServletRequest) -
decodeSamlPostMessage
public static org.opensaml.messaging.context.MessageContext decodeSamlPostMessage(jakarta.servlet.http.HttpServletRequest request) -
decodeSamlRedirectMessage
public static org.opensaml.messaging.context.MessageContext decodeSamlRedirectMessage(jakarta.servlet.http.HttpServletRequest request) -
decodeSamlSoapMessage
public static org.opensaml.messaging.context.MessageContext decodeSamlSoapMessage(jakarta.servlet.http.HttpServletRequest request) -
decodeSamlArtifactMessage
public static org.opensaml.messaging.context.MessageContext decodeSamlArtifactMessage(jakarta.servlet.http.HttpServletRequest request, String issuerId, ArtifactPeer peer, Optional<SignatureParameters> signatureParameters, SignatureValidationParameters signatureValidationParameters, Optional<org.apache.hc.client5.http.classic.HttpClient> httpClientOpt) -
extractSourceIdFromArtifactMessage
public static String extractSourceIdFromArtifactMessage(jakarta.servlet.http.HttpServletRequest request) -
calculateArtifactSourceIdFromIssuerId
-
extractSourceIdFromArtifactId
-
setIssuer
-
createArtifactMap
public static org.opensaml.saml.common.binding.artifact.SAMLArtifactMap createArtifactMap() -
createArtifactMap
-
setEndpoint
public static void setEndpoint(org.opensaml.messaging.context.MessageContext context, org.opensaml.saml.saml2.metadata.Endpoint endpoint) -
setEndpoint
public static void setEndpoint(org.opensaml.messaging.context.MessageContext context, String idpSsoDestination) -
getEndpoint
public static org.opensaml.saml.saml2.metadata.Endpoint getEndpoint(org.opensaml.messaging.context.MessageContext context) -
replaceSensitiveData
-
replaceSensitiveData
-
defaultXmlTagsToReplace
-
checkAssertionsLimitations
-
checkResponsePresent
public static void checkResponsePresent(org.opensaml.saml.saml2.core.Response response, String purpose) -
checkResponseLimitations
public static void checkResponseLimitations(org.opensaml.saml.saml2.core.Response response, String purpose) -
extractAuthnRequestContextClasses
-
extractAuthnRequestContextClasses
-
extractAuthnRequestComparison
public static org.opensaml.saml.saml2.core.AuthnContextComparisonTypeEnumeration extractAuthnRequestComparison(org.opensaml.saml.saml2.core.AuthnRequest authnRequest) -
extractAuthnStatementContextClass
public static String extractAuthnStatementContextClass(org.opensaml.saml.saml2.core.AuthnStatement authnStatement) -
isForceAuthnRequest
public static boolean isForceAuthnRequest(org.opensaml.saml.saml2.core.AuthnRequest authnRequest) -
sendSamlRequest
public static <T extends org.opensaml.saml.saml2.core.RequestAbstractType> void sendSamlRequest(org.apache.velocity.app.VelocityEngine velocityEngine, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap artifactMap, SamlBinding binding, ArtifactResolutionParameters artifactResolutionParameters, T samlRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse, org.opensaml.security.credential.Credential credential, String endpoint, String relayState, String destinationAlias) -
sendSamlSoapMessage
public static <T extends org.opensaml.saml.common.SAMLObject> void sendSamlSoapMessage(org.opensaml.messaging.context.MessageContext context, T samlObject, jakarta.servlet.http.HttpServletResponse httpServletResponse, String destinationAlias) -
createMessageContext
-
initiateArtifactBindingContext
public static void initiateArtifactBindingContext(org.opensaml.messaging.context.MessageContext context, String issuerId, ArtifactResolutionParameters artifactResolutionParameters) -
setSignatureParameter
public static void setSignatureParameter(org.opensaml.messaging.context.MessageContext context, org.opensaml.security.credential.Credential credential) -
createVelocityEngine
public static org.apache.velocity.app.VelocityEngine createVelocityEngine(String velocityTemplatePath) -
extractRelayStateAsSessionId
public static String extractRelayStateAsSessionId(org.opensaml.messaging.context.MessageContext messageContext) -
getStatusMessage
-
getStatusCode
-
getNestedStatusCode
-
constructIdpScoping
-
extractIdpScoping
-