Class SAMLMessageManagerImpl

java.lang.Object
com.atlassian.crowd.plugin.saml.SAMLMessageManagerImpl
All Implemented Interfaces:
SAMLMessageManager

public class SAMLMessageManagerImpl extends Object implements SAMLMessageManager
  • Constructor Details

    • SAMLMessageManagerImpl

      public SAMLMessageManagerImpl()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Performs initialisation of the manager by loading the template SAML XML response and DSA keys from disk.
      Throws:
      Exception
    • parseAuthRequest

      public SAMLAuthRequest parseAuthRequest(String samlRequestXML, String relayStateURL, String samlEncoding) throws SAMLException
      Description copied from interface: SAMLMessageManager
      Parses the non null request parameters for a SAML request into a SAML request object.
      Specified by:
      parseAuthRequest in interface SAMLMessageManager
      Parameters:
      samlRequestXML - request XML string, already URL-decoded, but still Base64 encoded and zipped
      relayStateURL - relay state URL.
      samlEncoding - SAML encoding
      Returns:
      SAML authentication request object.
      Throws:
      SAMLException - error parsing request.
    • generateAuthResponse

      public SAMLAuthResponse generateAuthResponse(SAMLAuthRequest authRequest, String authenticatedUser) throws SAMLException
      Description copied from interface: SAMLMessageManager
      Generates a successful authentication response for an authentication request given the username of the authenticated user.
      Specified by:
      generateAuthResponse in interface SAMLMessageManager
      Parameters:
      authRequest - authentication request object.
      authenticatedUser - username of authenticated user.
      Returns:
      signed authentication response object.
      Throws:
      SAMLException - error generating or signing XML response.
    • generateKeys

      public void generateKeys() throws SAMLException
      Description copied from interface: SAMLMessageManager
      Generates and stores the private and public keys

      This will overwrite any existing keys.

      Specified by:
      generateKeys in interface SAMLMessageManager
      Throws:
      SAMLException - if there was an error generating or storing the new keys.
    • deleteKeys

      public void deleteKeys()
      Description copied from interface: SAMLMessageManager
      Deletes any generated DSA keys This also makes the SAMLMessageManager unable to sign requests.
      Specified by:
      deleteKeys in interface SAMLMessageManager
    • hasValidKeys

      public boolean hasValidKeys()
      Description copied from interface: SAMLMessageManager
      The SAMLMessageManager is ready to perform generate signatures if a valid key-pair has been loaded/generated.
      Specified by:
      hasValidKeys in interface SAMLMessageManager
      Returns:
      true if and only if a valid key-pair exists.
    • getKeys

      public Optional<KeyPair> getKeys()
      Specified by:
      getKeys in interface SAMLMessageManager
      Returns:
      dsa keypair used in encryption
    • setAssertionNotBeforeMinutes

      public void setAssertionNotBeforeMinutes(int assertionNotBeforeMinutes)
    • setAssertionNotOnOrAfterMinutes

      public void setAssertionNotOnOrAfterMinutes(int assertionNotOnOrAfterMinutes)
    • setDatabaseKeyStore

      public void setDatabaseKeyStore(DatabaseKeyStore databaseKeyStore)