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
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentReturn the DOM objectstatic Documentconvert(ResponseType responseType) Convert a SAML2 Response into a Documentstatic ArtifactResolveTypeCreate 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 LogoutRequestTypecreateLogoutRequest(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 SAMLDocumentHoldergetSAML2ObjectFromDocument(Document samlDocument) Get the Underlying SAML2Object from a documentstatic SAMLDocumentHolderGet the Underlying SAML2Object from the input streamGet the parsedSAMLDocumentHolderstatic voidmarshall(RequestAbstractType requestType, OutputStream os) Marshall the AuthnRequestType to an output streamstatic voidmarshall(RequestAbstractType requestType, Writer writer) Marshall the AuthnRequestType to a writervoidsetNameIDFormat(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:
 ParsingExceptionProcessingExceptionConfigurationExceptionIllegalArgumentException- 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:
 IOExceptionParsingExceptionConfigurationExceptionProcessingException
 - 
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:
 ProcessingExceptionParsingException
 - 
getRequestType
public RequestAbstractType getRequestType(InputStream is) throws ParsingException, ConfigurationException, ProcessingException Get a Request Type from Input Stream- Parameters:
 is-- Returns:
 - Throws:
 ProcessingExceptionConfigurationExceptionIllegalArgumentException- 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:
 ParsingExceptionProcessingExceptionConfigurationExceptionIllegalArgumentException- 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:
 ProcessingExceptionParsingExceptionConfigurationException
 - 
convert
public static Document convert(ResponseType responseType) throws ProcessingException, ParsingException, ConfigurationException Convert a SAML2 Response into a Document- Parameters:
 responseType-- Returns:
 - Throws:
 ProcessingExceptionParsingExceptionConfigurationException
 - 
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
 
 -