|
||||||||||
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 |
---|
authenticators |
Constructor Summary | |
---|---|
XWikiLDAPAuthServiceImpl()
|
Method Summary | |
---|---|
Principal |
authenticate(String login,
String password,
XWikiContext context)
|
protected String |
getValidXWikiUserName(String name)
|
protected Principal |
ldapAuthenticate(String login,
String password,
XWikiContext context)
Try both local and global ldap login and return Principal . |
protected Principal |
ldapAuthenticateInContext(String ldapUid,
String validXWikiUserName,
String password,
XWikiContext context)
Try LDAP login for given context and return Principal . |
protected Principal |
ldapAuthenticateInContext(String ldapUid,
String validXWikiUserName,
String password,
XWikiContext context,
boolean local)
Try LDAP login for given context and return Principal . |
protected void |
syncGroupsMembership(String xwikiUserName,
String ldapDn,
boolean createuser,
XWikiLDAPUtils ldapUtils,
XWikiContext context)
Synchronize user XWiki membership with it's LDAP membership. |
protected void |
syncGroupsMembership(String xwikiUserName,
String userDN,
Map<String,Set<String>> groupMappings,
XWikiLDAPUtils ldapUtils,
XWikiContext context)
Synchronize user XWiki membership with it's LDAP membership. |
protected void |
syncUser(XWikiDocument userProfile,
List<XWikiLDAPSearchAttribute> searchAttributeListIn,
String ldapDn,
String ldapUid,
XWikiLDAPUtils ldapUtils,
XWikiContext context)
Update or create XWiki user base on LDAP. |
protected Principal |
xwikiAuthenticate(String ldapUid,
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 Principal authenticate(String login, String password, XWikiContext context) throws XWikiException
authenticate
in interface XWikiAuthService
authenticate
in class XWikiAuthServiceImpl
XWikiException
protected String getValidXWikiUserName(String name)
name
- the name to convert.
protected Principal ldapAuthenticate(String login, 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 Principal xwikiAuthenticate(String ldapUid, 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 Principal ldapAuthenticateInContext(String ldapUid, String validXWikiUserName, String password, XWikiContext context) throws XWikiException, 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.
UnsupportedEncodingException
- error when login.
com.novell.ldap.LDAPException
- error when login.protected Principal ldapAuthenticateInContext(String ldapUid, String validXWikiUserName, String password, XWikiContext context, boolean local) throws XWikiException, 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.local
- indicate if it's a local authentication. Supposed to return a local user Principal
(whithout
the wiki name).
Principal
.
XWikiException
- error when login.
UnsupportedEncodingException
- error when login.
com.novell.ldap.LDAPException
- error when login.protected void syncUser(XWikiDocument userProfile, List<XWikiLDAPSearchAttribute> searchAttributeListIn, String ldapDn, String ldapUid, XWikiLDAPUtils ldapUtils, XWikiContext context) throws XWikiException
userProfile
- the XWiki user profile page.searchAttributeListIn
- the attributes.ldapDn
- the LDAP user DN.ldapUid
- the uid of the user in LDAPldapUtils
- the LDAP communication tool.context
- the XWiki context.
XWikiException
- error when updating or creating XWiki user.protected void syncGroupsMembership(String xwikiUserName, 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(String xwikiUserName, String userDN, Map<String,Set<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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |