Class SAML2Request
- java.lang.Object
-
- org.keycloak.saml.processing.api.saml.v2.request.SAML2Request
-
public class SAML2Request extends Object
API for SAML2 Request- Since:
- Jan 5, 2009
- Author:
- Anil.Saldhana@redhat.com
-
-
Constructor Summary
Constructors Constructor Description SAML2Request()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Document
convert(RequestAbstractType rat)
Return the DOM objectstatic Document
convert(ResponseType responseType)
Convert a SAML2 Response into a DocumentAuthnRequestType
createAuthnRequestType(String id, String assertionConsumerURL, String destination, String issuerValue)
Create authentication request with protocolBinding defaulting to POSTAuthnRequestType
createAuthnRequestType(String id, String assertionConsumerURL, String destination, String issuerValue, URI protocolBinding)
Create an authentication requeststatic LogoutRequestType
createLogoutRequest(NameIDType issuer)
Create a Logout RequestAuthnRequestType
getAuthnRequestType(InputStream is)
Get the AuthnRequestType from an input streamAuthnRequestType
getAuthnRequestType(String fileName)
Get AuthnRequestType from a fileRequestAbstractType
getRequestType(InputStream is)
Get a Request Type from Input Streamstatic SAMLDocumentHolder
getSAML2ObjectFromDocument(Document samlDocument)
Get the Underlying SAML2Object from a documentstatic SAMLDocumentHolder
getSAML2ObjectFromStream(InputStream is)
Get the Underlying SAML2Object from the input streamSAMLDocumentHolder
getSamlDocumentHolder()
Get 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
-
-
-
Method Detail
-
setNameIDFormat
public void setNameIDFormat(String nameIDFormat)
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
public SAMLDocumentHolder getSamlDocumentHolder()
Get the parsedSAMLDocumentHolder
- Returns:
-
createLogoutRequest
public static LogoutRequestType createLogoutRequest(NameIDType issuer) throws ConfigurationException
Create a Logout 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
-
-