com.atlassian.confluence.rpc.auth
Class TokenAuthenticationManager

java.lang.Object
  extended bycom.atlassian.confluence.rpc.auth.TokenAuthenticationManager

public class TokenAuthenticationManager
extends Object


Field Summary
static org.apache.log4j.Category log
           
static String TOKEN_CACHE
           
 
Constructor Summary
TokenAuthenticationManager()
           
 
Method Summary
 boolean hasUseConfluencePermission(User user)
          Determines whether user has access to Confluence
 String login(String username, String password)
          Logs the user with username and password into the Remote API system

The token is stored for a period of time, and invalidated after an idle period.

 boolean logout(String token)
          Logs the user out of the RPC system
 User makeAnonymousUser()
          Returns the anonymous user
 User makeNonAnonymousUserFromToken(String token)
          Retrieves the user for a particular token
 void setCacheManager(CacheManager cacheManager)
           
 void setPermissionManager(PermissionManager permissionManager)
           
 void setSettingsManager(SettingsManager settingsManager)
           
 void setUserAccessor(UserAccessor userAccessor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Category log

TOKEN_CACHE

public static final String TOKEN_CACHE
Constructor Detail

TokenAuthenticationManager

public TokenAuthenticationManager()
Method Detail

login

public String login(String username,
                    String password)
             throws RemoteException
Logs the user with username and password into the Remote API system

The token is stored for a period of time, and invalidated after an idle period.

Parameters:
username - The user's login name
password - The password
Returns:
The authentication token for use with other RPC calls
Throws:
AuthenticationFailedException - if a user called username could not be found
AuthenticationFailedException - if password was incorrect
RemoteException

logout

public boolean logout(String token)
               throws Exception
Logs the user out of the RPC system

Parameters:
token - The authenticated user token
Returns:
True if the logout was successful
Throws:
Exception - if there were problems logging the user out

setUserAccessor

public void setUserAccessor(UserAccessor userAccessor)

setSettingsManager

public void setSettingsManager(SettingsManager settingsManager)

setPermissionManager

public void setPermissionManager(PermissionManager permissionManager)

setCacheManager

public void setCacheManager(CacheManager cacheManager)

makeNonAnonymousUserFromToken

public User makeNonAnonymousUserFromToken(String token)
                                   throws InvalidSessionException
Retrieves the user for a particular token

Parameters:
token - The authenticated user token
Returns:
The User for the token
Throws:
InvalidSessionException - if a user could not be retrieved for token

makeAnonymousUser

public User makeAnonymousUser()
                       throws NotPermittedException
Returns the anonymous user

Returns:
The anonymous user (null)
Throws:
NotPermittedException - if anonymous access to the Remote API is disabled

hasUseConfluencePermission

public boolean hasUseConfluencePermission(User user)
Determines whether user has access to Confluence

Parameters:
user - The User to be checked
Returns:
true if the user has access, false otherwise


Confluence is developed by Atlassian.