Package com.atlassian.crowd.plugin.saml
Class SAMLMessageManagerImpl
java.lang.Object
com.atlassian.crowd.plugin.saml.SAMLMessageManagerImpl
- All Implemented Interfaces:
SAMLMessageManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Performs initialisation of the manager by loading the template SAML XML response and DSA keys from disk.void
Deletes any generated DSA keys This also makes the SAMLMessageManager unable to sign requests.generateAuthResponse
(SAMLAuthRequest authRequest, String authenticatedUser) Generates a successful authentication response for an authentication request given the username of the authenticated user.void
Generates and stores the private and public keysgetKeys()
boolean
The SAMLMessageManager is ready to perform generate signatures if a valid key-pair has been loaded/generated.parseAuthRequest
(String samlRequestXML, String relayStateURL, String samlEncoding) Parses the non null request parameters for a SAML request into a SAML request object.void
setAssertionNotBeforeMinutes
(int assertionNotBeforeMinutes) void
setAssertionNotOnOrAfterMinutes
(int assertionNotOnOrAfterMinutes) void
setDatabaseKeyStore
(DatabaseKeyStore databaseKeyStore)
-
Constructor Details
-
SAMLMessageManagerImpl
public SAMLMessageManagerImpl()
-
-
Method Details
-
afterPropertiesSet
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 interfaceSAMLMessageManager
- Parameters:
samlRequestXML
- request XML string, already URL-decoded, but still Base64 encoded and zippedrelayStateURL
- 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 interfaceSAMLMessageManager
- Parameters:
authRequest
- authentication request object.authenticatedUser
- username of authenticated user.- Returns:
- signed authentication response object.
- Throws:
SAMLException
- error generating or signing XML response.
-
generateKeys
Description copied from interface:SAMLMessageManager
Generates and stores the private and public keysThis will overwrite any existing keys.
- Specified by:
generateKeys
in interfaceSAMLMessageManager
- 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 interfaceSAMLMessageManager
-
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 interfaceSAMLMessageManager
- Returns:
true
if and only if a valid key-pair exists.
-
getKeys
- Specified by:
getKeys
in interfaceSAMLMessageManager
- Returns:
- dsa keypair used in encryption
-
setAssertionNotBeforeMinutes
public void setAssertionNotBeforeMinutes(int assertionNotBeforeMinutes) -
setAssertionNotOnOrAfterMinutes
public void setAssertionNotOnOrAfterMinutes(int assertionNotOnOrAfterMinutes) -
setDatabaseKeyStore
-