Package com.atlassian.crowd.plugin.saml
Class SAMLMessageManagerImpl
java.lang.Object
com.atlassian.crowd.plugin.saml.SAMLMessageManagerImpl
- All Implemented Interfaces:
SAMLMessageManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms initialisation of the manager by loading the template SAML XML response and DSA keys from disk.voidDeletes 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.voidGenerates and stores the private and public keysgetKeys()booleanThe 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.voidsetAssertionNotBeforeMinutes(int assertionNotBeforeMinutes) voidsetAssertionNotOnOrAfterMinutes(int assertionNotOnOrAfterMinutes) voidsetDatabaseKeyStore(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:SAMLMessageManagerParses the non null request parameters for a SAML request into a SAML request object.- Specified by:
parseAuthRequestin 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:SAMLMessageManagerGenerates a successful authentication response for an authentication request given the username of the authenticated user.- Specified by:
generateAuthResponsein 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:SAMLMessageManagerGenerates and stores the private and public keysThis will overwrite any existing keys.
- Specified by:
generateKeysin interfaceSAMLMessageManager- Throws:
SAMLException- if there was an error generating or storing the new keys.
-
deleteKeys
public void deleteKeys()Description copied from interface:SAMLMessageManagerDeletes any generated DSA keys This also makes the SAMLMessageManager unable to sign requests.- Specified by:
deleteKeysin interfaceSAMLMessageManager
-
hasValidKeys
public boolean hasValidKeys()Description copied from interface:SAMLMessageManagerThe SAMLMessageManager is ready to perform generate signatures if a valid key-pair has been loaded/generated.- Specified by:
hasValidKeysin interfaceSAMLMessageManager- Returns:
trueif and only if a valid key-pair exists.
-
getKeys
- Specified by:
getKeysin interfaceSAMLMessageManager- Returns:
- dsa keypair used in encryption
-
setAssertionNotBeforeMinutes
public void setAssertionNotBeforeMinutes(int assertionNotBeforeMinutes) -
setAssertionNotOnOrAfterMinutes
public void setAssertionNotOnOrAfterMinutes(int assertionNotOnOrAfterMinutes) -
setDatabaseKeyStore
-