|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.rpc.auth.TokenAuthenticationManager
public class TokenAuthenticationManager
Manages tokens used to authenticate users for Confluence's remote API. This implementation is also responsible for checking permission to access the application and the remote API before returning tokens.
Uses a cache with an appropriate expiry delay to store the tokens. The default timeout is 30 minutes.
Field Summary | |
---|---|
static java.lang.String |
TOKEN_CACHE
|
Constructor Summary | |
---|---|
TokenAuthenticationManager()
|
Method Summary | |
---|---|
boolean |
hasUseConfluencePermission(com.atlassian.user.User user)
Determines whether user has access to Confluence |
java.lang.String |
login(java.lang.String username,
java.lang.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(java.lang.String token)
Logs the user out of the RPC system |
ConfluenceUser |
makeAnonymousConfluenceUser()
Returns the anonymous user |
com.atlassian.user.User |
makeAnonymousUser()
Deprecated. since 5.2. Use makeAnonymousConfluenceUser() instead. |
ConfluenceUser |
makeNonAnonymousConfluenceUserFromToken(java.lang.String token)
Retrieves the user for a particular token |
com.atlassian.user.User |
makeNonAnonymousUserFromToken(java.lang.String token)
Deprecated. since 5.2. Use makeNonAnonymousConfluenceUserFromToken(String) instead. |
void |
setCacheManager(com.atlassian.cache.CacheManager cacheManager)
|
void |
setEventManager(com.atlassian.event.EventManager eventManager)
|
void |
setLoginManager(LoginManager loginManager)
|
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 |
---|
public static final java.lang.String TOKEN_CACHE
Constructor Detail |
---|
public TokenAuthenticationManager()
Method Detail |
---|
public java.lang.String login(java.lang.String username, java.lang.String password) throws RemoteException
username
- The user's login namepassword
- The password
AuthenticationFailedException
- if a user called username could not be found or the password was incorrect
RemoteException
public boolean logout(java.lang.String token) throws RemoteException
token
- The authenticated user token
RemoteException
- if the user could not be logged outpublic void setUserAccessor(UserAccessor userAccessor)
public void setSettingsManager(SettingsManager settingsManager)
public void setPermissionManager(PermissionManager permissionManager)
public void setCacheManager(com.atlassian.cache.CacheManager cacheManager)
public void setEventManager(com.atlassian.event.EventManager eventManager)
public void setLoginManager(LoginManager loginManager)
public ConfluenceUser makeNonAnonymousConfluenceUserFromToken(java.lang.String token) throws InvalidSessionException
token
- The authenticated user token
InvalidSessionException
- if a user could not be retrieved for token@Deprecated public com.atlassian.user.User makeNonAnonymousUserFromToken(java.lang.String token) throws InvalidSessionException
makeNonAnonymousConfluenceUserFromToken(String)
instead.
InvalidSessionException
public ConfluenceUser makeAnonymousConfluenceUser() throws NotPermittedException
NotPermittedException
- if anonymous access to the Remote API is disabled@Deprecated public com.atlassian.user.User makeAnonymousUser() throws NotPermittedException
makeAnonymousConfluenceUser()
instead.
NotPermittedException
public boolean hasUseConfluencePermission(com.atlassian.user.User user)
user
- The User to be checked
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |