org.objectweb.jonas.security
Interface JonasSecurityServiceImplMBean

All Known Implementing Classes:
JonasSecurityServiceImpl

public interface JonasSecurityServiceImplMBean

MBean interface for Security Service Management MBean type: Standard MBean model: Inheritance (JonasSecurityServiceImpl)

Author:
Bruno Michel, Guillaume Riviere, Florent Benoit : add MBean methods

Method Summary
 void addJResourceDS(java.lang.String name, java.lang.String dsName, java.lang.String userTable, java.lang.String userTableUsernameCol, java.lang.String userTablePasswordCol, java.lang.String roleTable, java.lang.String roleTableUsernameCol, java.lang.String roleTableRolenameCol, java.lang.String algorithm)
          Add a DS resource
 void addJResourceLDAP(java.lang.String name, java.lang.String initialContextFactory, java.lang.String providerUrl, java.lang.String securityAuthentication, java.lang.String securityPrincipal, java.lang.String securityCredentials, java.lang.String securityProtocol, java.lang.String language, java.lang.String referral, java.lang.String stateFactories, java.lang.String authenticationMode, java.lang.String userPasswordAttribute, java.lang.String userRolesAttribute, java.lang.String roleNameAttribute, java.lang.String baseDN, java.lang.String userDN, java.lang.String userSearchFilter, java.lang.String roleDN, java.lang.String roleSearchFilter, java.lang.String algorithm)
          Add a LDAP resource
 void addJResourceMemory(java.lang.String name)
          Add a Memory resource
 void addResources(java.lang.String xml)
          Add JResources with a given xml configuration
 java.lang.String encryptPassword(java.lang.String string, java.lang.String algo)
          Encrypt a string with an algorithm
 boolean isValidAlgorithm(java.lang.String algo)
          Check if the given algorithm is a valid algorithm
 void removeJResource(java.lang.String resourceName)
          Remove the Resource (memory, ldap, datasource,...)
 

Method Detail

encryptPassword

java.lang.String encryptPassword(java.lang.String string,
                                 java.lang.String algo)
                                 throws java.security.NoSuchAlgorithmException
Encrypt a string with an algorithm

Parameters:
string - the string to encode
algo - algorithm to apply on the given string
Returns:
the encoded string
Throws:
java.security.NoSuchAlgorithmException - One reason could be a bad algorithm

addResources

void addResources(java.lang.String xml)
                  throws java.lang.Exception
Add JResources with a given xml configuration

Parameters:
xml - xml representation of the resources to add
Throws:
java.lang.Exception - if the resources can't be added

removeJResource

void removeJResource(java.lang.String resourceName)
                     throws java.lang.Exception
Remove the Resource (memory, ldap, datasource,...)

Parameters:
resourceName - name of the resource
Throws:
java.lang.Exception - if the resource name does not exist

isValidAlgorithm

boolean isValidAlgorithm(java.lang.String algo)
Check if the given algorithm is a valid algorithm

Parameters:
algo - algorithm to apply on the given string
Returns:
true if it is a valid algorithm

addJResourceMemory

void addJResourceMemory(java.lang.String name)
                        throws java.lang.Exception
Add a Memory resource

Parameters:
name - the name of the JResourceMemory to create
Throws:
java.lang.Exception - if the resource can't be added

addJResourceDS

void addJResourceDS(java.lang.String name,
                    java.lang.String dsName,
                    java.lang.String userTable,
                    java.lang.String userTableUsernameCol,
                    java.lang.String userTablePasswordCol,
                    java.lang.String roleTable,
                    java.lang.String roleTableUsernameCol,
                    java.lang.String roleTableRolenameCol,
                    java.lang.String algorithm)
                    throws java.lang.Exception
Add a DS resource

Parameters:
name - the name of the JResourceDS to create
dsName - Name of the datasource resource to use.
userTable - Name of table which have the username/password
userTableUsernameCol - Column of the username of the user table
userTablePasswordCol - Column of the password of the user table
roleTable - Name of table which have the username/role
roleTableUsernameCol - Column of the username of the role table
roleTableRolenameCol - Column of the role of the role table
algorithm - Default algorithm. If specified, the default is not 'clear' password
Throws:
java.lang.Exception - if the resource can't be added

addJResourceLDAP

void addJResourceLDAP(java.lang.String name,
                      java.lang.String initialContextFactory,
                      java.lang.String providerUrl,
                      java.lang.String securityAuthentication,
                      java.lang.String securityPrincipal,
                      java.lang.String securityCredentials,
                      java.lang.String securityProtocol,
                      java.lang.String language,
                      java.lang.String referral,
                      java.lang.String stateFactories,
                      java.lang.String authenticationMode,
                      java.lang.String userPasswordAttribute,
                      java.lang.String userRolesAttribute,
                      java.lang.String roleNameAttribute,
                      java.lang.String baseDN,
                      java.lang.String userDN,
                      java.lang.String userSearchFilter,
                      java.lang.String roleDN,
                      java.lang.String roleSearchFilter,
                      java.lang.String algorithm)
                      throws java.lang.Exception
Add a LDAP resource

Parameters:
name - the name of the JResourceLDAP to create
initialContextFactory - Initial context factory for the LDAp server
providerUrl - Url of the ldap server
securityAuthentication - Type of the authentication used during the authentication to the LDAP server
securityPrincipal - DN of the Principal(username). He can retrieve the information from the user
securityCredentials - Credential(password) of the principal
securityProtocol - Constant that holds the name of the environment property for specifying the security protocol to use.
language - Constant that holds the name of the environment property for specifying the preferred language to use with the service.
referral - Constant that holds the name of the environment property for specifying how referrals encountered by the service provider are to be processed.
stateFactories - Constant that holds the name of the environment property for specifying the list of state factories to use.
authenticationMode - Mode for validate the authentication (BIND_AUTHENTICATION_MODE or COMPARE_AUTHENTICATION_MODE)
userPasswordAttribute - Attribute in order to get the password from the ldap server
userRolesAttribute - Attribute in order to get the user role from the ldap server
roleNameAttribute - Attribute for the role name when performing a lookup on a role
baseDN - DN used for the lookup
userDN - DN used when searching the user DN. Override the baseDN if it is defined
userSearchFilter - Filter used when searching the user
roleDN - DN used when searching the role DN. Override the baseDN if it is defined
roleSearchFilter - Filter used when searching the role
algorithm - Default algorithm. If specified, the default is not 'clear' password
Throws:
java.lang.Exception - if the resource can't be added