Class SamlUtils
java.lang.Object
com.webmethods.caf.wsserver.auth.saml.SamlUtils
- All Implemented Interfaces:
ISamlConstants
Utility methods for miscellaneous SAML specific and other functionality.
-
Field Summary
FieldsFields inherited from interface com.webmethods.caf.wsserver.auth.saml.ISamlConstants
IS_ASSERTED, SAML_ARTIFACT, SAML_ASSERTION, SESSION_USER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
displayAssertion
(PrintWriter outWriter, org.opensaml.saml1.core.Assertion samlAssertion) Debug method to output a Assertion object to an output streamstatic String
getLoginName
(org.opensaml.saml1.core.Assertion samlAssertion) static org.opensaml.saml1.core.Assertion
getSamlAssertion
(String securityProviderEndpoint, String samlArtifact) static org.opensaml.saml1.core.Assertion
getSamlAssertion
(org.opensaml.saml1.core.Response samlResponse) Return the SAML assertion object present in the SAML response.static org.opensaml.saml1.core.Response
getSamlResponse
(String securityProviderEndpoint, String samlArtifactString) The specified SAML artifact is passed to the SAML server and the SAML response object obtained from the SAML security provider.static Element
marshallSamlObject
(org.opensaml.xml.XMLObject samlObject) static org.opensaml.xml.XMLObject
unmarshallElement
(Element samlElement) static String
verifyAssertion
(org.opensaml.saml1.core.Assertion samlAssertion) Verify a Assertion object retrieved from the SAML security provider todo check digital signature
-
Field Details
-
requestID
protected static int requestID
-
-
Constructor Details
-
SamlUtils
public SamlUtils()
-
-
Method Details
-
verifyAssertion
Verify a Assertion object retrieved from the SAML security provider todo check digital signature- Parameters:
samlAssertion
- theAssertion
object- Returns:
- the asserted user DN
-
getSamlAssertion
-
getSamlAssertion
public static org.opensaml.saml1.core.Assertion getSamlAssertion(org.opensaml.saml1.core.Response samlResponse) Return the SAML assertion object present in the SAML response.- Parameters:
samlResponse
-Response
object received from the SAML Server.- Returns:
Assertion
object present within theResponse
object. Only one assertion object per response is currently supported.
-
getSamlResponse
public static org.opensaml.saml1.core.Response getSamlResponse(String securityProviderEndpoint, String samlArtifactString) The specified SAML artifact is passed to the SAML server and the SAML response object obtained from the SAML security provider.- Parameters:
securityProviderEndpoint
- URL of the security provider endpoint (e.g. http://myportal/services/SAML)samlArtifact
- Base-64 encoded string representing the SAML. This artifact string is generated anIArtifactFactory
.- Returns:
Response
object returned by the SAML server.
-
getLoginName
- Throws:
Exception
-
displayAssertion
public static void displayAssertion(PrintWriter outWriter, org.opensaml.saml1.core.Assertion samlAssertion) throws Exception Debug method to output a Assertion object to an output stream- Parameters:
outWriter
- - the output stream to write tosamlAssertion
- - The Assertion object to output- Throws:
Exception
-
unmarshallElement
-
marshallSamlObject
-