public class SamlUtils extends Object implements ISamlConstants
Modifier and Type | Field and Description |
---|---|
protected static int |
requestID |
IS_ASSERTED, SAML_ARTIFACT, SAML_ASSERTION, SESSION_USER
Constructor and Description |
---|
SamlUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
displayAssertion(PrintWriter outWriter,
org.opensaml.saml1.core.Assertion samlAssertion)
Debug method to output a Assertion object to an output stream
|
static String |
getLoginName(org.opensaml.saml1.core.Assertion samlAssertion) |
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.Assertion |
getSamlAssertion(String securityProviderEndpoint,
String samlArtifact) |
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
|
public static String verifyAssertion(org.opensaml.saml1.core.Assertion samlAssertion)
samlAssertion
- the Assertion
objectpublic static org.opensaml.saml1.core.Assertion getSamlAssertion(String securityProviderEndpoint, String samlArtifact)
public static org.opensaml.saml1.core.Assertion getSamlAssertion(org.opensaml.saml1.core.Response samlResponse)
samlResponse
- Response
object received from the
SAML Server.Assertion
object present within the
Response
object. Only one assertion object per
response is currently supported.public static org.opensaml.saml1.core.Response getSamlResponse(String securityProviderEndpoint, String samlArtifactString)
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
an IArtifactFactory
.Response
object returned by the SAML server.public static String getLoginName(org.opensaml.saml1.core.Assertion samlAssertion) throws Exception
Exception
public static void displayAssertion(PrintWriter outWriter, org.opensaml.saml1.core.Assertion samlAssertion) throws Exception
outWriter
- - the output stream to write tosamlAssertion
- - The Assertion object to outputException
public static org.opensaml.xml.XMLObject unmarshallElement(Element samlElement)
public static Element marshallSamlObject(org.opensaml.xml.XMLObject samlObject)