Class SAML2Request
java.lang.Object
org.keycloak.saml.processing.api.saml.v2.request.SAML2Request
API for SAML2 Request
- Since:
- Jan 5, 2009
- Author:
- Anil.Saldhana@redhat.com
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Document
Return the DOM objectstatic Document
convert
(ResponseType responseType) Convert a SAML2 Response into a Documentstatic ArtifactResolveType
Create a Artifact Resolve RequestcreateAuthnRequestType
(String id, String assertionConsumerURL, String destination, String issuerValue) Create authentication request with protocolBinding defaulting to POSTcreateAuthnRequestType
(String id, String assertionConsumerURL, String destination, String issuerValue, URI protocolBinding) Create an authentication requeststatic LogoutRequestType
createLogoutRequest
(NameIDType issuer) Create a Logout RequestGet the AuthnRequestType from an input streamgetAuthnRequestType
(String fileName) Get AuthnRequestType from a fileGet a Request Type from Input Streamstatic SAMLDocumentHolder
getSAML2ObjectFromDocument
(Document samlDocument) Get the Underlying SAML2Object from a documentstatic SAMLDocumentHolder
Get the Underlying SAML2Object from the input streamGet the parsedSAMLDocumentHolder
static void
marshall
(RequestAbstractType requestType, OutputStream os) Marshall the AuthnRequestType to an output streamstatic void
marshall
(RequestAbstractType requestType, Writer writer) Marshall the AuthnRequestType to a writervoid
setNameIDFormat
(String nameIDFormat) Set the NameIDFormat
-
Constructor Details
-
SAML2Request
public SAML2Request()
-
-
Method Details
-
setNameIDFormat
Set the NameIDFormat- Parameters:
nameIDFormat
-
-
createAuthnRequestType
public AuthnRequestType createAuthnRequestType(String id, String assertionConsumerURL, String destination, String issuerValue) throws ConfigurationException Create authentication request with protocolBinding defaulting to POST- Parameters:
id
-assertionConsumerURL
-destination
-issuerValue
-- Returns:
- Throws:
ConfigurationException
-
createAuthnRequestType
public AuthnRequestType createAuthnRequestType(String id, String assertionConsumerURL, String destination, String issuerValue, URI protocolBinding) throws ConfigurationException Create an authentication request- Parameters:
id
-assertionConsumerURL
-destination
-issuerValue
-protocolBindingUri
-- Returns:
- Throws:
ConfigurationException
-
getAuthnRequestType
public AuthnRequestType getAuthnRequestType(String fileName) throws ConfigurationException, ProcessingException, ParsingException Get AuthnRequestType from a file- Parameters:
fileName
- file with the serialized AuthnRequestType- Returns:
- AuthnRequestType
- Throws:
ParsingException
ProcessingException
ConfigurationException
IllegalArgumentException
- if the input fileName is null IllegalStateException if the InputStream from the fileName is null
-
getSAML2ObjectFromStream
public static SAMLDocumentHolder getSAML2ObjectFromStream(InputStream is) throws ConfigurationException, ParsingException, ProcessingException Get the Underlying SAML2Object from the input stream- Parameters:
is
-- Returns:
- Throws:
IOException
ParsingException
ConfigurationException
ProcessingException
-
getSAML2ObjectFromDocument
public static SAMLDocumentHolder getSAML2ObjectFromDocument(Document samlDocument) throws ProcessingException, ParsingException Get the Underlying SAML2Object from a document- Parameters:
samlDocument
- a Document containing a SAML2Object- Returns:
- a SAMLDocumentHolder
- Throws:
ProcessingException
ParsingException
-
getRequestType
public RequestAbstractType getRequestType(InputStream is) throws ParsingException, ConfigurationException, ProcessingException Get a Request Type from Input Stream- Parameters:
is
-- Returns:
- Throws:
ProcessingException
ConfigurationException
IllegalArgumentException
- inputstream is nullParsingException
-
getAuthnRequestType
public AuthnRequestType getAuthnRequestType(InputStream is) throws ConfigurationException, ProcessingException, ParsingException Get the AuthnRequestType from an input stream- Parameters:
is
- Inputstream containing the AuthnRequest- Returns:
- Throws:
ParsingException
ProcessingException
ConfigurationException
IllegalArgumentException
- inputstream is null
-
getSamlDocumentHolder
Get the parsedSAMLDocumentHolder
- Returns:
-
createLogoutRequest
public static LogoutRequestType createLogoutRequest(NameIDType issuer) throws ConfigurationException Create a Logout Request- Parameters:
issuer
-- Returns:
- Throws:
ConfigurationException
-
createArtifactResolveRequest
Create a Artifact Resolve Request- Parameters:
issuer
-- Returns:
- Throws:
ConfigurationException
-
convert
public static Document convert(RequestAbstractType rat) throws ProcessingException, ConfigurationException, ParsingException Return the DOM object- Parameters:
rat
-- Returns:
- Throws:
ProcessingException
ParsingException
ConfigurationException
-
convert
public static Document convert(ResponseType responseType) throws ProcessingException, ParsingException, ConfigurationException Convert a SAML2 Response into a Document- Parameters:
responseType
-- Returns:
- Throws:
ProcessingException
ParsingException
ConfigurationException
-
marshall
public static void marshall(RequestAbstractType requestType, OutputStream os) throws ProcessingException Marshall the AuthnRequestType to an output stream- Parameters:
requestType
-os
-- Throws:
ProcessingException
-
marshall
public static void marshall(RequestAbstractType requestType, Writer writer) throws ProcessingException Marshall the AuthnRequestType to a writer- Parameters:
requestType
-writer
-- Throws:
ProcessingException
-