Class JndiLdapCredentialStore
- java.lang.Object
-
- net.officefloor.web.security.store.JndiLdapCredentialStore
-
- All Implemented Interfaces:
CredentialStore
public class JndiLdapCredentialStore extends java.lang.Object implements CredentialStore
CredentialStore
forDirContext
.- Author:
- Daniel Sagenschneider
-
-
Field Summary
-
Fields inherited from interface net.officefloor.web.security.store.CredentialStore
DEFAULT_ALGORITHM, NO_ALGORITHM
-
-
Constructor Summary
Constructors Constructor Description JndiLdapCredentialStore(java.lang.String algorithm, javax.naming.directory.DirContext context, java.lang.String entrySearchBaseDn, java.lang.String rolesSearchBaseDn)
Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlgorithm()
Obtains the algorithm used to encrypt credentials within thisCredentialStore
.CredentialEntry
retrieveCredentialEntry(java.lang.String userId, java.lang.String realm)
Retrieves theCredentialEntry
.
-
-
-
Constructor Detail
-
JndiLdapCredentialStore
public JndiLdapCredentialStore(java.lang.String algorithm, javax.naming.directory.DirContext context, java.lang.String entrySearchBaseDn, java.lang.String rolesSearchBaseDn)
Initiate.- Parameters:
algorithm
- Algorithm.context
-DirContext
.entrySearchBaseDn
- Base dn for searching for entries.rolesSearchBaseDn
- Base dn for searching for roles.
-
-
Method Detail
-
getAlgorithm
public java.lang.String getAlgorithm()
Description copied from interface:CredentialStore
Obtains the algorithm used to encrypt credentials within this
CredentialStore
.Should the return be
null
, blank orCredentialStore.NO_ALGORITHM
then the password is considered to be stored in plain text. This is however only useful for theBASIC
authentication scheme due to the nature of the other authentication schemes (such asDIGEST
).It is expected that the credentials for
DIGEST
will be stored as the algorithm applied touserId:realm:password
(as per RFC 2617). This is necessary as the password is never supplied and therefore forDIGEST
this MUST return an algorithm.- Specified by:
getAlgorithm
in interfaceCredentialStore
- Returns:
- Algorithm.
-
retrieveCredentialEntry
public CredentialEntry retrieveCredentialEntry(java.lang.String userId, java.lang.String realm) throws HttpException
Description copied from interface:CredentialStore
Retrieves theCredentialEntry
.- Specified by:
retrieveCredentialEntry
in interfaceCredentialStore
- Parameters:
userId
- User identifier.realm
- Realm. May benull
(especially in the case forBasic
authentication).- Returns:
CredentialEntry
ornull
if noCredentialEntry
exists for parameters.- Throws:
HttpException
- If fails to retrieveCredentialEntry
.
-
-