org.keycloak.saml.processing.api.saml.v2.request

## 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 and Description
    `SAML2Request()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Document` | `convert(RequestAbstractType rat)` Return the DOM object
    `Document` | `convert(ResponseType responseType)` Convert a SAML2 Response into a Document
    `AuthnRequestType` | `createAuthnRequestType(String id, String assertionConsumerURL, String destination, String issuerValue)` Create an authentication request
    `LogoutRequestType` | `createLogoutRequest(String issuer)` Create a Logout Request
    `AuthnRequestType` | `getAuthnRequestType(InputStream is)` Get the AuthnRequestType from an input stream
    `AuthnRequestType` | `getAuthnRequestType(String fileName)` Get AuthnRequestType from a file
    `RequestAbstractType` | `getRequestType(InputStream is)` Get a Request Type from Input Stream
    `SAML2Object` | `getSAML2ObjectFromStream(InputStream is)` Get the Underlying SAML2Object from the input stream
    `SAMLDocumentHolder` | `getSamlDocumentHolder()` Get the parsed `SAMLDocumentHolder`
    `void` | `marshall(RequestAbstractType requestType, OutputStream os)` Marshall the AuthnRequestType to an output stream
    `void` | `marshall(RequestAbstractType requestType, Writer writer)` Marshall the AuthnRequestType to a writer
    `void` | `setNameIDFormat(String nameIDFormat)` Set the NameIDFormat

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SAML2Request

          public SAML2Request()

  - ### 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 an authentication request
      Parameters:
        `id` -
        `assertionConsumerURL` -
        `destination` -
        `issuerValue` -
      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 SAML2Object getSAML2ObjectFromStream(InputStream is)
                                               throws ConfigurationException,
                                                      ParsingException,
                                                      ProcessingException

      Get the Underlying SAML2Object from the input stream
      Parameters:
        `is` -
      Returns:
      Throws:
        `IOException`
        `ParsingException`
        `ConfigurationException`
        `ProcessingException`

    - #### 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 null
        `ParsingException`

    - #### 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 parsed `SAMLDocumentHolder`
      Returns:

    - #### createLogoutRequest

          public LogoutRequestType createLogoutRequest(String issuer)
                                                throws ConfigurationException

      Create a Logout Request
      Parameters:
        `issuer` -
      Returns:
      Throws:
        `ConfigurationException`

    - #### convert

          public Document convert(RequestAbstractType rat)
                           throws ProcessingException,
                                  ConfigurationException,
                                  ParsingException

      Return the DOM object
      Parameters:
        `rat` -
      Returns:
      Throws:
        `ProcessingException`
        `ParsingException`
        `ConfigurationException`

    - #### convert

          public Document convert(ResponseType responseType)
                           throws ProcessingException,
                                  ParsingException,
                                  ConfigurationException

      Convert a SAML2 Response into a Document
      Parameters:
        `responseType` -
      Returns:
      Throws:
        `ProcessingException`
        `ParsingException`
        `ConfigurationException`

    - #### marshall

          public void marshall(RequestAbstractType requestType,
                               OutputStream os)
                        throws ProcessingException

      Marshall the AuthnRequestType to an output stream
      Parameters:
        `requestType` -
        `os` -
      Throws:
        `ProcessingException`

    - #### marshall

          public void marshall(RequestAbstractType requestType,
                               Writer writer)
                        throws ProcessingException

      Marshall the AuthnRequestType to a writer
      Parameters:
        `requestType` -
        `writer` -
      Throws:
        `ProcessingException`

Copyright © 2016 JBoss by Red Hat. All rights reserved.