Package com.xpn.xwiki.user.impl.xwiki
Class XWikiAuthServiceImpl
- java.lang.Object
-
- com.xpn.xwiki.user.impl.xwiki.AbstractXWikiAuthService
-
- com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl
-
- All Implemented Interfaces:
XWikiAuthService
- Direct Known Subclasses:
AppServerTrustedAuthServiceImpl
,AppServerTrustedKerberosAuthServiceImpl
,GroovyAuthServiceImpl
public class XWikiAuthServiceImpl extends AbstractXWikiAuthService
Default implementation ofXWikiAuthService
.- Version:
- $Id: 521bbec43d5ba398a380aefbe057bdd1475f9b66 $
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,XWikiAuthenticator>
authenticators
Each wiki has its own authenticator.
-
Constructor Summary
Constructors Constructor Description XWikiAuthServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Principal
authenticate(String username, String password, XWikiContext context)
XWikiUser
checkAuth(XWikiContext context)
XWikiUser
checkAuth(String username, String password, String rememberme, XWikiContext context)
Method to authenticate and set the cookie from a username and password passed as parametersprotected boolean
checkPassword(String username, String password, XWikiContext context)
protected String
createUser(String user, XWikiContext context)
protected String
findUser(String username, XWikiContext context)
protected XWikiAuthenticator
getAuthenticator(XWikiContext context)
protected String
getParam(String name, XWikiContext context)
void
showLogin(XWikiContext context)
protected String
stripContextPathFromURL(URL url, XWikiContext context)
The authentication library we are using (SecurityFilter) requires that its URLs do not contain the context path, in order to be usable withRequestDispatcher.forward
.-
Methods inherited from class com.xpn.xwiki.user.impl.xwiki.AbstractXWikiAuthService
authenticateSuperAdmin, isSuperAdmin
-
-
-
-
Field Detail
-
authenticators
protected Map<String,XWikiAuthenticator> authenticators
Each wiki has its own authenticator.
-
-
Method Detail
-
getAuthenticator
protected XWikiAuthenticator getAuthenticator(XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
checkAuth
public XWikiUser checkAuth(XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
checkAuth
public XWikiUser checkAuth(String username, String password, String rememberme, XWikiContext context) throws XWikiException
Method to authenticate and set the cookie from a username and password passed as parameters- Parameters:
username
- the user name for the user to authenticatepassword
- the password of the user to authenticatecontext
- the XWiki context object- Returns:
- null if the user is not authenticated properly
- Throws:
XWikiException
- in case of authentication error
-
showLogin
public void showLogin(XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
authenticate
public Principal authenticate(String username, String password, XWikiContext context) throws XWikiException
- Returns:
- a null Principal Object if the user hasn't been authenticated or a valid Principal Object if the user is correctly authenticated
- Throws:
XWikiException
-
findUser
protected String findUser(String username, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
checkPassword
protected boolean checkPassword(String username, String password, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
getParam
protected String getParam(String name, XWikiContext context)
-
createUser
protected String createUser(String user, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
stripContextPathFromURL
protected String stripContextPathFromURL(URL url, XWikiContext context)
The authentication library we are using (SecurityFilter) requires that its URLs do not contain the context path, in order to be usable withRequestDispatcher.forward
. Since our URL factory include the context path in the generated URLs, we use this method to remove (if needed) the context path.- Parameters:
url
- The URL to process.context
- The ubiquitous XWiki request context.- Returns:
- A
String
representation of the contextpath-free URL.
-
-