Package org.opencms.jlan
Class CmsJlanUsers
java.lang.Object
org.opencms.jlan.CmsJlanUsers
- All Implemented Interfaces:
org.alfresco.jlan.server.auth.UsersInterface
This class is used for authenticating OpenCms users to JLAN.
Since JLAN requires MD4 password hashes for authentication, which are not by default stored in the database, users who want to use the JLAN functionality should log in at least once into OpenCms normally so that the MD4 hash of their password can be computed and stored.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.alfresco.jlan.server.auth.UserAccount
getUserAccount
(String userName) static byte[]
hashPassword
(String password) Computes an MD4 hash for the password.void
initializeUsers
(org.alfresco.jlan.server.config.ServerConfiguration config, org.springframework.extensions.config.ConfigElement params) static void
setAdminCms
(CmsObject cms) Sets the CMS context.static final String
translateUser
(String name) Translates user names by replacing a custom OU separator with the standard OU separator '/'.
-
Field Details
-
DEFAULT_OU_SEPARATOR
The default OU separator to use if none is configured.- See Also:
-
JLAN_HASH
The additional info key for the MD4 password hash.- See Also:
-
PARAM_JLAN_OU_SEPARATOR
Name of the runtime property used to configure the OU separator for CIFS login.- See Also:
-
-
Constructor Details
-
CmsJlanUsers
public CmsJlanUsers()
-
-
Method Details
-
hashPassword
public static byte[] hashPassword(String password) throws InvalidKeyException, NoSuchAlgorithmException Computes an MD4 hash for the password.- Parameters:
password
- the password for which to compute the hash- Returns:
- the password hash
- Throws:
NoSuchAlgorithmException
InvalidKeyException
-
setAdminCms
Sets the CMS context.- Parameters:
cms
- the context to set
-
translateUser
Translates user names by replacing a custom OU separator with the standard OU separator '/'. This is needed because either JLAN or the client cuts off the part before the slash during authentication, so OpenCms never gets to see it. So if we want CIFS authentication for users from non-root OUs, we need to use a different separator.- Parameters:
name
- the user name to translate- Returns:
- the translated user name
-
getUserAccount
- Specified by:
getUserAccount
in interfaceorg.alfresco.jlan.server.auth.UsersInterface
- See Also:
-
UsersInterface.getUserAccount(java.lang.String)
-
initializeUsers
public void initializeUsers(org.alfresco.jlan.server.config.ServerConfiguration config, org.springframework.extensions.config.ConfigElement params) - Specified by:
initializeUsers
in interfaceorg.alfresco.jlan.server.auth.UsersInterface
- See Also:
-
UsersInterface.initializeUsers(org.alfresco.jlan.server.config.ServerConfiguration, org.springframework.extensions.config.ConfigElement)
-