|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.security.provider.ChainingSecurityContext
org.jasig.portal.security.provider.SimpleLdapSecurityContext
public class SimpleLdapSecurityContext
This is an implementation of a SecurityContext that checks a user's credentials against an LDAP directory. It expects to be able to bind to the LDAP directory as the user so that it can authenticate the user.
By implementing the IConfigurableSecurityContext
interface this context may have properties set on it. The one property
the SimpleLdapSecurityContext
looks for is defined by
the String LDAP_PROPERTIES_CONNECTION_NAME
"connection".
This property allows a specific, named, LDAP connection to be used by
the context. If no "connection" property is specified the default
LDAP connection returned by LdapServices
is
used.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jasig.portal.security.provider.ChainingSecurityContext |
---|
ChainingSecurityContext.ChainingAdditionalDescriptor, ChainingSecurityContext.ChainingOpaqueCredentials, ChainingSecurityContext.ChainingPrincipal |
Field Summary | |
---|---|
static int |
ATTR_FIRSTNAME
|
static int |
ATTR_LASTNAME
|
static int |
ATTR_UID
|
private static java.lang.String[] |
attributes
|
private java.util.Properties |
ctxProperties
|
static java.lang.String |
LDAP_PROPERTIES_CONNECTION_NAME
|
private static org.apache.commons.logging.Log |
log
|
private int |
SIMPLE_LDAP_SECURITYAUTHTYPE
|
Fields inherited from class org.jasig.portal.security.provider.ChainingSecurityContext |
---|
isauth, myAdditionalDescriptor, myOpaqueCredentials, myOrder, myPrincipal, mySubContexts, stopWhenAuthenticated |
Constructor Summary | |
---|---|
SimpleLdapSecurityContext()
|
Method Summary | |
---|---|
void |
authenticate()
Authenticates the user. |
private java.lang.String |
getAttributeValue(javax.naming.directory.Attributes attrs,
int attribute)
Return a single value of an attribute from possibly multiple values, grossly ignoring anything else. |
int |
getAuthType()
Returns the type of authentication this class provides. |
private boolean |
isAttribute(int attribute)
Is this a value attribute that's been requested? |
void |
setProperties(java.util.Properties props)
Sets the properties to use for this security context. |
Methods inherited from class org.jasig.portal.security.provider.ChainingSecurityContext |
---|
addSubContext, doesSubContextExist, getAdditionalDescriptor, getOpaqueCredentials, getOpaqueCredentialsInstance, getPrincipal, getPrincipalInstance, getSubContext, getSubContextNames, getSubContexts, isAuthenticated |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jasig.portal.security.ISecurityContext |
---|
addSubContext, getAdditionalDescriptor, getOpaqueCredentials, getOpaqueCredentialsInstance, getPrincipal, getPrincipalInstance, getSubContext, getSubContextNames, getSubContexts, isAuthenticated |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
public static final int ATTR_UID
public static final int ATTR_FIRSTNAME
public static final int ATTR_LASTNAME
private final int SIMPLE_LDAP_SECURITYAUTHTYPE
private static final java.lang.String[] attributes
public static final java.lang.String LDAP_PROPERTIES_CONNECTION_NAME
private java.util.Properties ctxProperties
Constructor Detail |
---|
SimpleLdapSecurityContext()
Method Detail |
---|
public void setProperties(java.util.Properties props)
setProperties
in interface IConfigurableSecurityContext
props
- The properties to set on the SecurityContext.IConfigurableSecurityContext.setProperties(java.util.Properties)
public int getAuthType()
getAuthType
in interface ISecurityContext
public void authenticate() throws PortalSecurityException
authenticate
in interface ISecurityContext
authenticate
in class ChainingSecurityContext
PortalSecurityException
ISecurityContext.getPrincipalInstance()
,
ISecurityContext.getOpaqueCredentialsInstance()
private java.lang.String getAttributeValue(javax.naming.directory.Attributes attrs, int attribute) throws javax.naming.NamingException
Return a single value of an attribute from possibly multiple values, grossly ignoring anything else. If there are no values, then return an empty string.
attrs
- LDAP query resultsattribute
- LDAP attribute we are interested in
javax.naming.NamingException
private boolean isAttribute(int attribute)
attribute
- in question
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |