Package org.opencms.jlan
Class CmsJlanUsers
- java.lang.Object
-
- org.opencms.jlan.CmsJlanUsers
-
- All Implemented Interfaces:
org.alfresco.jlan.server.auth.UsersInterface
public class CmsJlanUsers extends java.lang.Object implements 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
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_OU_SEPARATOR
The default OU separator to use if none is configured.static java.lang.String
JLAN_HASH
The additional info key for the MD4 password hash.static java.lang.String
PARAM_JLAN_OU_SEPARATOR
Name of the runtime property used to configure the OU separator for CIFS login.
-
Constructor Summary
Constructors Constructor Description CmsJlanUsers()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.alfresco.jlan.server.auth.UserAccount
getUserAccount(java.lang.String userName)
static byte[]
hashPassword(java.lang.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 java.lang.String
translateUser(java.lang.String name)
Translates user names by replacing a custom OU separator with the standard OU separator '/'.
-
-
-
Field Detail
-
DEFAULT_OU_SEPARATOR
public static final java.lang.String DEFAULT_OU_SEPARATOR
The default OU separator to use if none is configured.- See Also:
- Constant Field Values
-
JLAN_HASH
public static final java.lang.String JLAN_HASH
The additional info key for the MD4 password hash.- See Also:
- Constant Field Values
-
PARAM_JLAN_OU_SEPARATOR
public static final java.lang.String PARAM_JLAN_OU_SEPARATOR
Name of the runtime property used to configure the OU separator for CIFS login.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsJlanUsers
public CmsJlanUsers()
-
-
Method Detail
-
hashPassword
public static byte[] hashPassword(java.lang.String password) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException
Computes an MD4 hash for the password.- Parameters:
password
- the password for which to compute the hash- Returns:
- the password hash
- Throws:
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
-
setAdminCms
public static void setAdminCms(CmsObject cms)
Sets the CMS context.- Parameters:
cms
- the context to set
-
translateUser
public static final java.lang.String translateUser(java.lang.String name)
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
public org.alfresco.jlan.server.auth.UserAccount getUserAccount(java.lang.String userName)
- 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)
-
-