|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.blojsom.authorization.database.DatabaseAuthorizationProvider
org.blojsom.authorization.ldap.LDAPAuthorizationProvider
LDAPAuthorizationProvider
This implementation authenticates a user against an LDAP server. The user name must be the same as that of their LDAP user (uid). There are two ways to configure this in terms of the accepted users. The first is where only the blog owner can edit the blog. To use this technique, delete the authorization.properties file from the user's blog directory. The lack of this file tells the authorization logic to use the blog owner as the UID for LDAP authentication. The second way provides multiple user editing of a blog. This second way utilizes the authorization.properties file's user names (it ignores passwords and other data). Incoming authorization requests have the user name checked to see if it is listed in the authorization.properties file (indicating a user who is allowed to edit this blog). If it is in the list, this username is used as the LDAP UID. This class/implementation requires LDAP protocol version 3. You must set the configuration values defined by the BlojsomConstants: BLOG_LDAP_AUTHORIZATION_SERVER_IP, BLOG_LDAP_AUTHORIZATION_DN_IP, and BLOG_LDAP_AUTHORIZATION_PORT_IP (optional). Note, this implementation currently requires the Mozilla LDAP Java SDK. See http://www.mozilla.org/directory/.
Field Summary |
Fields inherited from class org.blojsom.authorization.database.DatabaseAuthorizationProvider |
_sessionFactory |
Constructor Summary | |
LDAPAuthorizationProvider()
Default constructor |
Method Summary | |
void |
authorize(Blog blog,
java.util.Map authorizationContext,
java.lang.String username,
java.lang.String password)
Authorize a username and password for the given Blog |
protected java.lang.String |
getAttribute(java.lang.String username,
java.lang.String attribute)
Get a specific attribute value for a given username |
protected java.lang.String |
getBaseDN()
Return the LDAP base DN |
protected java.lang.String |
getDN(java.lang.String username)
Get the DN for a given username |
protected int |
getPort()
Return the LDAP server port |
protected java.lang.String |
getServer()
Return the LDAP server name |
void |
init()
Initialization method for the authorization provider |
void |
setServletConfig(javax.servlet.ServletConfig servletConfig)
Set the ServletConfig for the fetcher to grab initialization parameters |
Methods inherited from class org.blojsom.authorization.database.DatabaseAuthorizationProvider |
checkPermission, setSessionFactory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LDAPAuthorizationProvider()
Method Detail |
public void setServletConfig(javax.servlet.ServletConfig servletConfig)
ServletConfig
for the fetcher to grab initialization parameters
servletConfig
- ServletConfig
public void init() throws ConfigurationException
init
in interface AuthorizationProvider
init
in class DatabaseAuthorizationProvider
ConfigurationException
- If there is an error initializing the providerpublic void authorize(Blog blog, java.util.Map authorizationContext, java.lang.String username, java.lang.String password) throws AuthorizationException
Blog
authorize
in interface AuthorizationProvider
authorize
in class DatabaseAuthorizationProvider
blog
- Blog
authorizationContext
- Map
to be used to provide other information for authorization. This will
change depending on the authorization provider. This parameter is not used in this implementation.username
- Username. In this implementation, this value must match that of the blog user's ID.password
- Password
AuthorizationException
- If there is an error authorizing the username and passwordprotected java.lang.String getDN(java.lang.String username)
username
- Username
null
if there is an exception in lookupprotected java.lang.String getAttribute(java.lang.String username, java.lang.String attribute)
username
- Usernameattribute
- Attribute
null
if there is an exception in lookupprotected java.lang.String getServer()
protected int getPort()
protected java.lang.String getBaseDN()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |