Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.database
Class DbAuthFactory

java.lang.Object
  extended by com.jivesoftware.base.AuthFactory
      extended by 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.


Field Summary
 
Fields inherited from class com.jivesoftware.base.AuthFactory
cipher, COOKIE_AUTOLOGIN, COOKIE_JIVE_SERVER_INFO, COOKIE_LOGGED_IN, SESSION_AUTHORIZATION
 
Constructor Summary
DbAuthFactory()
           
 
Method Summary
 AuthToken createAnonymousAuthToken()
          Creates anonymous AuthToken tokens.
 AuthToken createAuthToken(java.lang.String username, java.lang.String password)
          Creates AuthToken tokens for users.
 
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
 

Constructor Detail

DbAuthFactory

public DbAuthFactory()
Method Detail

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.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.