Package org.mockserver.saml
Class SamlResponseBuilder
java.lang.Object
org.mockserver.saml.SamlResponseBuilder
Builds and enveloped-signs a SAML 2.0
<Response> document using only the JDK XML APIs
(javax.xml DOM) and the JDK XML Digital Signature API (javax.xml.crypto.dsig.*) —
no OpenSAML/Shibboleth dependency.
The <Assertion> is enveloped-signed (the signature element is inserted into the
Assertion immediately after its <Issuer>, as required by the SAML schema), with an
exclusive-canonicalised Reference to the Assertion's ID and the signing
certificate embedded in <ds:KeyInfo>/<ds:X509Data>. Signing the Assertion (rather than the
Response envelope) is the most widely interoperable choice for the Web-Browser-SSO POST profile.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildSignedResponse(SamlAssertionStore.Provider provider, String inResponseTo) Builds a signed SAML Response and returns its serialized XML string.
-
Constructor Details
-
SamlResponseBuilder
public SamlResponseBuilder()
-
-
Method Details
-
buildSignedResponse
Builds a signed SAML Response and returns its serialized XML string.- Parameters:
provider- the mock IdP provider staterelayState- the SP RelayState (echoed by the caller, not embedded in the assertion)- Returns:
- the serialized, signed
<Response>XML
-