com.jivesoftware.base.database
Class DbAuthFactory
java.lang.Object
com.jivesoftware.base.AuthFactory
com.jivesoftware.base.database.DbAuthFactory
public class DbAuthFactory
- extends AuthFactory
A subclass of AuthFactory for the default Jive implementation. It makes an
SQL query to the Jive user table to see if the supplied username and password
match a user record. If they do, the appropaite AuthToken token is
returned. If no matching User record is found an UnauthorizedException is
thrown.
Because each call to createAuthorization(String, String) makes a database
connection, AuthToken tokens should be cached whenever possible. When
using a servlet or JSP skins, a good method is to cache the token in the
session named AuthFactory.SESSION_AUTHORIZATION. The default
AuthFactory.createAuthorization(HttpServletRequest request,
HttpServletResponse response) method automatically handles this logic..
If you wish to integrate Jive Forums with your own authentication or
single sign-on system, you'll need your own implementation of the
AuthFactory interface. See that interface for further details.
Methods inherited from class com.jivesoftware.base.AuthFactory |
addServerInfoCookie, checkAuthorization, checkIfBanned, clearSessionUserInfo, createAuthToken, createSessionUserInfo, decryptAuthInfo, encryptAuthInfo, forceReload, getAnonymousAuthToken, getAuthToken, getAuthToken, getServerInfoCookieProperty, loginUser, logoutUser |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DbAuthFactory
public DbAuthFactory()
createAuthToken
public AuthToken createAuthToken(java.lang.String username,
java.lang.String password)
throws UnauthorizedException
- Creates AuthToken tokens for users. This method is implemented by
concrete subclasses of AuthFactory.
- Specified by:
createAuthToken
in class AuthFactory
- Parameters:
username
- the username to create an AuthToken with.password
- the password to create an AuthToken with.
- Returns:
- an AuthToken token if the username and password are correct.
- Throws:
UnauthorizedException
- if the username and password do not match any existing user.
createAnonymousAuthToken
public AuthToken createAnonymousAuthToken()
- Creates anonymous AuthToken tokens.
- Specified by:
createAnonymousAuthToken
in class AuthFactory
- Returns:
- an anonymous AuthToken token.
Copyright © 1999-2006 Jive Software.