com.atlassian.crowd.plugin.rest.service.resource
Class TokenResource

java.lang.Object
  extended by com.atlassian.crowd.plugin.rest.service.resource.AbstractResource
      extended by com.atlassian.crowd.plugin.rest.service.resource.TokenResource

public class TokenResource
extends AbstractResource

Crowd SSO Token Resource.


Field Summary
 
Fields inherited from class com.atlassian.crowd.plugin.rest.service.resource.AbstractResource
DEFAULT_SEARCH_RESULT_SIZE, MAX_RESULTS_PARAM, request, START_INDEX_PARAM, uriInfo
 
Constructor Summary
TokenResource(TokenController tokenController)
           
 
Method Summary
 javax.ws.rs.core.Response authenticateUser(AuthenticationContextEntity authenticationContext, boolean validatePassword, long durationInSeconds)
          Authenticates a user against the application and returns a Crowd SSO token.
 javax.ws.rs.core.Response deleteTokensForUser(String username, String exclusionToken)
           
 javax.ws.rs.core.Response getSession(String token)
          Retrieves the token.
 javax.ws.rs.core.Response invalidateToken(String token)
          Invalidates the Crowd SSO token.
 javax.ws.rs.core.Response validateToken(String token, ValidationFactorEntityList validationFactors)
          Validates a Crowd SSO token.
 
Methods inherited from class com.atlassian.crowd.plugin.rest.service.resource.AbstractResource
getApplicationName, getBaseUri
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenResource

public TokenResource(TokenController tokenController)
Method Detail

authenticateUser

public javax.ws.rs.core.Response authenticateUser(AuthenticationContextEntity authenticationContext,
                                                  boolean validatePassword,
                                                  long durationInSeconds)
                                           throws InvalidAuthenticationException,
                                                  InactiveAccountException,
                                                  ExpiredCredentialException,
                                                  ApplicationAccessDeniedException,
                                                  OperationFailedException
Authenticates a user against the application and returns a Crowd SSO token.

Parameters:
authenticationContext - authentication information
validatePassword - true if the password should be validated (optional, defaults to true)
durationInSeconds - requested duration of the token, in seconds (optional, defaults to server session duration)
Returns:
status 200 with Crowd SSO token if successful
Throws:
InvalidAuthenticationException
InactiveAccountException
ExpiredCredentialException
ApplicationAccessDeniedException
OperationFailedException

invalidateToken

public javax.ws.rs.core.Response invalidateToken(String token)
Invalidates the Crowd SSO token.

Parameters:
token -
Returns:

validateToken

public javax.ws.rs.core.Response validateToken(String token,
                                               ValidationFactorEntityList validationFactors)
                                        throws InvalidTokenException,
                                               ApplicationAccessDeniedException,
                                               OperationFailedException
Validates a Crowd SSO token.

Parameters:
token - Crowd SSO token
validationFactors - list of validation factors
Throws:
InvalidTokenException
ApplicationAccessDeniedException
OperationFailedException

getSession

public javax.ws.rs.core.Response getSession(String token)
                                     throws InvalidTokenException,
                                            OperationFailedException,
                                            ApplicationAccessDeniedException
Retrieves the token.

Throws:
ApplicationAccessDeniedException
InvalidTokenException
OperationFailedException

deleteTokensForUser

public javax.ws.rs.core.Response deleteTokensForUser(String username,
                                                     String exclusionToken)


Copyright © 2013 Atlassian. All Rights Reserved.