|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xpn.xwiki.user.impl.xwiki.AbstractXWikiAuthService
com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl
com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl
public class XWikiLDAPAuthServiceImpl
This class provides an authentication method that validates a user trough LDAP against a directory. It gives LDAP users access if they belong to a particular group, creates XWiki users if they have never logged in before and synchronizes membership to XWiki groups based on membership to LDAP groups.
| Field Summary |
|---|
| Fields inherited from class com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl |
|---|
authenticator |
| Constructor Summary | |
|---|---|
XWikiLDAPAuthServiceImpl()
|
|
| Method Summary | |
|---|---|
protected void |
addUserToXWikiGroup(java.lang.String xwikiUserName,
java.lang.String groupName,
XWikiContext context)
Add user name to provided XWiki group. |
java.security.Principal |
authenticate(java.lang.String login,
java.lang.String password,
XWikiContext context)
|
protected XWikiDocument |
createUserFromLDAP(XWikiDocument userProfile,
java.util.List<XWikiLDAPSearchAttribute> searchAttributes,
java.lang.String ldapDN,
java.lang.String ldapUid,
XWikiContext context)
Create an XWiki user and set all mapped attributes from LDAP to XWiki attributes. |
java.lang.String[] |
getAttributeNameTable(XWikiContext context)
|
protected XWikiDocument |
getAvailableUserProfile(java.lang.String validXWikiUserName,
java.lang.String ldapUid,
XWikiContext context)
|
protected XWikiDocument |
getUserProfileByUid(java.lang.String validXWikiUserName,
java.lang.String ldapUid,
XWikiContext context)
|
protected java.security.Principal |
ldapAuthenticate(java.lang.String login,
java.lang.String password,
XWikiContext context)
Try both local and global ldap login and return Principal. |
protected java.security.Principal |
ldapAuthenticateInContext(java.lang.String ldapUid,
java.lang.String validXWikiUserName,
java.lang.String password,
XWikiContext context)
Try LDAP login for given context and return Principal. |
protected void |
removeUserFromXWikiGroup(java.lang.String xwikiUserName,
java.lang.String groupName,
XWikiContext context)
Remove user name from provided XWiki group. |
protected void |
syncGroupMembership(java.lang.String xwikiUserName,
java.lang.String userDN,
java.lang.String xwikiGroupName,
java.util.Collection<java.lang.String> userGroups,
java.util.Map<java.lang.String,java.lang.String> groupMembers,
XWikiContext context)
Synchronize user XWiki membership with it's LDAP membership for provided group. |
protected void |
syncGroupsMembership(java.lang.String xwikiUserName,
java.lang.String ldapDn,
boolean createuser,
XWikiLDAPUtils ldapUtils,
XWikiContext context)
Synchronize user XWiki membership with it's LDAP membership. |
protected void |
syncGroupsMembership(java.lang.String xwikiUserName,
java.lang.String userDN,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> groupMappings,
XWikiLDAPUtils ldapUtils,
XWikiContext context)
Synchronize user XWiki membership with it's LDAP membership. |
protected void |
syncUser(XWikiDocument userProfile,
java.util.List<XWikiLDAPSearchAttribute> searchAttributeListIn,
java.lang.String ldapDn,
java.lang.String ldapUid,
XWikiLDAPUtils ldapUtils,
XWikiContext context)
Update or create XWiki user base on LDAP. |
protected void |
updateUserFromLDAP(XWikiDocument userProfile,
java.util.List<XWikiLDAPSearchAttribute> searchAttributes,
java.lang.String ldapDN,
java.lang.String ldapUid,
XWikiContext context)
Sets attributes on the user object based on attribute values provided by the LDAP. |
protected java.security.Principal |
xwikiAuthenticate(java.lang.String ldapUid,
java.lang.String ldapPassword,
XWikiContext context)
Try both local and global DB login if trylocal is true Principal. |
| Methods inherited from class com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl |
|---|
checkAuth, checkAuth, checkPassword, createUser, findUser, getAuthenticator, getParam, showLogin, stripContextPathFromURL |
| Methods inherited from class com.xpn.xwiki.user.impl.xwiki.AbstractXWikiAuthService |
|---|
authenticateSuperAdmin, isSuperAdmin |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XWikiLDAPAuthServiceImpl()
| Method Detail |
|---|
public java.security.Principal authenticate(java.lang.String login,
java.lang.String password,
XWikiContext context)
throws XWikiException
authenticate in interface XWikiAuthServiceauthenticate in class XWikiAuthServiceImplXWikiExceptionXWikiAuthServiceImpl.authenticate(java.lang.String, java.lang.String,
com.xpn.xwiki.XWikiContext)
protected java.security.Principal ldapAuthenticate(java.lang.String login,
java.lang.String password,
XWikiContext context)
Principal.
login - the name of the user to log in.password - the password of the user to log in.context - the XWiki context.
Principal.
protected java.security.Principal xwikiAuthenticate(java.lang.String ldapUid,
java.lang.String ldapPassword,
XWikiContext context)
throws XWikiException
Principal.
ldapUid - the name of the user to log in.ldapPassword - the password of the user to log in.context - the XWiki context.
Principal.
XWikiException - error when checking user name and password.
protected java.security.Principal ldapAuthenticateInContext(java.lang.String ldapUid,
java.lang.String validXWikiUserName,
java.lang.String password,
XWikiContext context)
throws XWikiException,
java.io.UnsupportedEncodingException,
com.novell.ldap.LDAPException
Principal.
ldapUid - the name of the ldap user to log in.validXWikiUserName - the name of the XWiki user to log in.password - the password of the user to log in.context - the XWiki context.
Principal.
XWikiException - error when login.
java.io.UnsupportedEncodingException - error when login.
com.novell.ldap.LDAPException - error when login.public java.lang.String[] getAttributeNameTable(XWikiContext context)
context - the XWiki context.
protected void syncUser(XWikiDocument userProfile,
java.util.List<XWikiLDAPSearchAttribute> searchAttributeListIn,
java.lang.String ldapDn,
java.lang.String ldapUid,
XWikiLDAPUtils ldapUtils,
XWikiContext context)
throws XWikiException
userName - the name of the user.userDN - the LDAP user DN.searchAttributeListIn - the attributes.ldapUtils - the LDAP communication tool.context - the XWiki context.
XWikiException - error when updating or creating XWiki user.
protected void syncGroupsMembership(java.lang.String xwikiUserName,
java.lang.String ldapDn,
boolean createuser,
XWikiLDAPUtils ldapUtils,
XWikiContext context)
throws XWikiException
xwikiUserName - the name of the user.ldapDn - the LDAP DN of the user.createuser - indicate if the user is created or updated.ldapUtils - the LDAP communication tool.context - the XWiki context.
XWikiException - error when synchronizing user membership.
protected void syncGroupsMembership(java.lang.String xwikiUserName,
java.lang.String userDN,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> groupMappings,
XWikiLDAPUtils ldapUtils,
XWikiContext context)
throws XWikiException
xwikiUserName - the name of the user.userDN - the LDAP DN of the user.groupMappings - the mapping between XWiki groups names and LDAP groups names.ldapUtils - the LDAP communication tool.context - the XWiki context.
XWikiException - error when synchronizing user membership.
protected void syncGroupMembership(java.lang.String xwikiUserName,
java.lang.String userDN,
java.lang.String xwikiGroupName,
java.util.Collection<java.lang.String> userGroups,
java.util.Map<java.lang.String,java.lang.String> groupMembers,
XWikiContext context)
xwikiUserName - the name of the user.userDN - the LDAP DN of the user.xwikiGroupName - the name of the XWiki group.userGroups - the XWiki groups of user.groupMembers - the members of LDAP group.context - the XWiki context.
protected void addUserToXWikiGroup(java.lang.String xwikiUserName,
java.lang.String groupName,
XWikiContext context)
xwikiUserName - the full name of the user.groupName - the name of the group.context - the XWiki context.
protected void removeUserFromXWikiGroup(java.lang.String xwikiUserName,
java.lang.String groupName,
XWikiContext context)
xwikiUserName - the full name of the user.groupName - the name of the group.context - the XWiki context.
protected void updateUserFromLDAP(XWikiDocument userProfile,
java.util.List<XWikiLDAPSearchAttribute> searchAttributes,
java.lang.String ldapDN,
java.lang.String ldapUid,
XWikiContext context)
throws XWikiException
xwikiUserName - the XWiki user name.searchAttributes - the attributes.context - the XWiki context.
XWikiException - error when updating XWiki user.
protected XWikiDocument createUserFromLDAP(XWikiDocument userProfile,
java.util.List<XWikiLDAPSearchAttribute> searchAttributes,
java.lang.String ldapDN,
java.lang.String ldapUid,
XWikiContext context)
throws XWikiException
userProfile - the XWiki user profile.searchAttributes - the attributes.ldapDN - the LDAP DN of the user.ldapUid - the LDAP unique id of the user.context - the XWiki context.
XWikiException - error when creating XWiki user.
protected XWikiDocument getUserProfileByUid(java.lang.String validXWikiUserName,
java.lang.String ldapUid,
XWikiContext context)
throws XWikiException
XWikiException
protected XWikiDocument getAvailableUserProfile(java.lang.String validXWikiUserName,
java.lang.String ldapUid,
XWikiContext context)
throws XWikiException
XWikiException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||