Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Access Management Mobile and Social


oracle.security.idaas.rest.provider.token
Interface TokenService

All Known Implementing Classes:
oracle.security.idaas.rest.provider.token.impl.CompositeTokenServiceProvider, MobileCompositeTokenServiceProvider

public interface TokenService

TokenService in an interface for an Authenticat Service to implement. It carries out the logic to authenticate a Client Identity, User Identity and create various of tokens as a result of authentication. It also has the function to verify or invalidate an existing token.


Method Summary
 Token createAccessToken(SecurityContext securityCtx, SubjectID token, java.util.Map<java.lang.String,java.lang.Object> reqParams)
          The createAccessToken will create Access Token with User token and/or Client Identity together with provider specific parameters (such as resource context).
 Token createToken(SecurityContext securityCtx, SubjectID subject, java.lang.String tokenType, java.util.Map<java.lang.String,java.lang.Object> reqParams)
          The createToken will authenticate credential.
 java.util.List<Token> createTokens(SecurityContext securityCtx, SubjectID subject, java.util.List<java.lang.String> tokenTypes, java.util.Map<java.lang.String,java.lang.Object> reqParams)
          The createTokens will authenticate credential.
 java.util.List<Token> getAllTokens(SecurityContext securityCtx, SubjectID subjectid)
          The getAllTokens return all the tokens belong to the system.
 Token getToken(SecurityContext securityCtx, SubjectID subjectid)
          The getToken validates the specified Token and returns up-to-dated token.
 java.util.List<Token> getTokens(SecurityContext securityCtx, SubjectID subjectid)
          The getTokens return all the tokens belong to the owner of SubjectID.
 boolean terminateToken(SecurityContext securityCtx, SubjectID subject)
          Invalidates a Token.
 boolean terminateTokens(SecurityContext securityCtx, SubjectID subjectid)
          The terminateTokens invalidates all the tokens belong to the owner of SubjectID.
 void updateSessionAttributes(SecurityContext securityCtx, SubjectID subject, java.util.Map<java.lang.String,java.lang.Object> tokenAttributes)
          Updates Token attributes.

 

Method Detail

createToken

Token createToken(SecurityContext securityCtx,
                  SubjectID subject,
                  java.lang.String tokenType,
                  java.util.Map<java.lang.String,java.lang.Object> reqParams)
                  throws RESTNotFoundException,
                         RESTForbiddenException,
                         RESTUnauthorizedException,
                         RESTMethodNotAllowedException,
                         RESTBadRequestException
The createToken will authenticate credential. Upon successful credential authentication, it will create a single token of a particular token type (client registration handle, client token, or user token) accordingly.

For access token creation, please see createAccessToken method.

Parameters:
securityCtx - defines the calling user identity (i.e. caller) who submit this request together with cient application identity that can authorize and validate this request.
subject - defines the user and credential to be authenticated.
tokenType - defines the TokenType the user is expecting.
reqParams - defines the provider specific parameters for token creation.
Returns:
token if authentication is done successfully.
Throws:
RESTMethodNotAllowedException -
- if rest operation is not allowed.
RESTUnauthorizedException -
- if credential is mismatched for user.
- if password is mismatched for user.
- if credential is not enough.
- if user is not exist for authentication.
RESTServerRuntimeException -
- if there is any error for processing authentication.
RESTNotFoundException
RESTForbiddenException
RESTUnauthorizedException
RESTMethodNotAllowedException
RESTBadRequestException

createTokens

java.util.List<Token> createTokens(SecurityContext securityCtx,
                                   SubjectID subject,
                                   java.util.List<java.lang.String> tokenTypes,
                                   java.util.Map<java.lang.String,java.lang.Object> reqParams)
                                   throws RESTNotFoundException,
                                          RESTForbiddenException,
                                          RESTUnauthorizedException,
                                          RESTMethodNotAllowedException,
                                          RESTBadRequestException
The createTokens will authenticate credential. Upon successful credential authentication, it will create muliple token of requested token types accordingly.

An example of multiple token type creation is:
["USERTOKEN", "USERTOKEN:OAMMT"]
That request two user tokens to be created. One is of "vanilla" user token, the other is of special "OAM Master Token" variant of user token.

Parameters:
securityCtx - defines the calling user identity (i.e. caller) who submit this request together with cient application identity that can authorize and validate this request.
subject - defines the user and credential to be authenticated.
tokenType - defines the TokenType the user is expecting.
reqParams - defines the provider specific parameters for token creation.
Returns:
list of tokens if authentication is done successfully.
Throws:
RESTMethodNotAllowedException -
- if rest operation is not allowed.
RESTUnauthorizedException -
- if credential is mismatched for user.
- if password is mismatched for user.
- if credential is not enough.
- if user is not exist for authentication.
RESTServerRuntimeException -
- if there is any error for processing authentication.
RESTNotFoundException
RESTForbiddenException
RESTUnauthorizedException
RESTMethodNotAllowedException
RESTBadRequestException

createAccessToken

Token createAccessToken(SecurityContext securityCtx,
                        SubjectID token,
                        java.util.Map<java.lang.String,java.lang.Object> reqParams)
                        throws RESTNotFoundException,
                               RESTForbiddenException,
                               RESTUnauthorizedException,
                               RESTMethodNotAllowedException,
                               RESTBadRequestException
The createAccessToken will create Access Token with User token and/or Client Identity together with provider specific parameters (such as resource context).
Parameters:
securityCtx - defines the calling user identity (i.e. caller) who submit this request together with cient application identity that can authorize and validate this request.
token - Subject ID that defines the (lightweight) user token.
reqParams - defines the provider specific parameters for token creation.
Returns:
accessToken if authentication is done successfully.
Throws:
RESTMethodNotAllowedException -
- if rest operation is not allowed.
RESTUnauthorizedException -
- if credential is mismatched for user.
- if provided token is invalid.
- if user is not exist for authentication.
RESTServerRuntimeException -
- if there is any error for processing authentication.
RESTNotFoundException
RESTForbiddenException
RESTUnauthorizedException
RESTMethodNotAllowedException
RESTBadRequestException

updateSessionAttributes

void updateSessionAttributes(SecurityContext securityCtx,
                             SubjectID subject,
                             java.util.Map<java.lang.String,java.lang.Object> tokenAttributes)
                             throws RESTNotFoundException,
                                    RESTForbiddenException,
                                    RESTBadRequestException,
                                    RESTUnauthorizedException,
                                    RESTMethodNotAllowedException
Updates Token attributes.
Parameters:
securityCtx - defines the calling user identity (i.e. caller) who submit this request together with client application identity that can authorize and validate this request.
subject - defines the token for which the associated session has to updated.
tokenAttributes - defines attributes to be updated in session associated with the token.
Throws:
RESTMethodNotAllowedException -
- if rest operation is not allowed.
RESTUnauthorizedException -
- if credential is mismatched for user.
- if the token is invalid.
- if the token is expired.
RESTServerRuntimeException -
- if there is any error for processing logout.
RESTNotFoundException
RESTForbiddenException
RESTBadRequestException
RESTUnauthorizedException
RESTMethodNotAllowedException

terminateToken

boolean terminateToken(SecurityContext securityCtx,
                       SubjectID subject)
                       throws RESTNotFoundException,
                              RESTForbiddenException,
                              RESTBadRequestException,
                              RESTUnauthorizedException,
                              RESTMethodNotAllowedException
Invalidates a Token.
Parameters:
securityCtx - defines the calling user identity (i.e. caller) who submit this request together with cient application identity that can authorize and validate this request.
subject - defines the token is being invalidated.
Returns:
resp boolean if operation is done successfully.
Throws:
RESTMethodNotAllowedException -
- if rest operation is not allowed.
RESTUnauthorizedException -
- if credential is mismatched for user.
- if the token is invalid.
- if the token is expired.
RESTServerRuntimeException -
- if there is any error for processing logout.
RESTNotFoundException
RESTForbiddenException
RESTBadRequestException
RESTUnauthorizedException
RESTMethodNotAllowedException

terminateTokens

boolean terminateTokens(SecurityContext securityCtx,
                        SubjectID subjectid)
                        throws RESTNotFoundException,
                               RESTForbiddenException,
                               RESTUnauthorizedException,
                               RESTBadRequestException,
                               RESTMethodNotAllowedException
The terminateTokens invalidates all the tokens belong to the owner of SubjectID.
Parameters:
securityCtx - defines the calling user identity (i.e. caller) who submit this request together with cient application identity that can authorize and validate this request.
subjectid - defines the SubjectID of the user whom the token is being retrieved.
Returns:
boolean if operation is done successfully.
Throws:
RESTMethodNotAllowedException -
- if rest operation is not allowed.
RESTUnauthorizedException -
- if credential is mismatched for user.
- if user is not exist for authentication.
- if the token is invalid.
RESTBadRequestException -
- if the request has mismatched parameters.
RESTServerRuntimeException -
- if there is any error for processing authentication.
RESTNotFoundException
RESTForbiddenException
RESTUnauthorizedException
RESTBadRequestException
RESTMethodNotAllowedException

getToken

Token getToken(SecurityContext securityCtx,
               SubjectID subjectid)
               throws RESTNotFoundException,
                      RESTForbiddenException,
                      RESTUnauthorizedException,
                      RESTMethodNotAllowedException,
                      RESTBadRequestException
The getToken validates the specified Token and returns up-to-dated token.
Parameters:
securityCtx - defines the calling user identity (i.e. caller) who submit this request together with cient application identity that can authorize and validate this request.
subjectid - defines the SubjectID of the user whom the token is being validated.
Returns:
Token if token is valid.
Throws:
RESTMethodNotAllowedException -
- if rest operation is not allowed.
RESTUnauthorizedException - - if credential is mismatched for user.
- if the token is expired.
- if the token is invalid.
RESTServerRuntimeException -
- if there is any error for processing toke validation.
RESTNotFoundException
RESTForbiddenException
RESTUnauthorizedException
RESTMethodNotAllowedException
RESTBadRequestException

getTokens

java.util.List<Token> getTokens(SecurityContext securityCtx,
                                SubjectID subjectid)
                                throws RESTNotFoundException,
                                       RESTForbiddenException,
                                       RESTUnauthorizedException,
                                       RESTBadRequestException,
                                       RESTMethodNotAllowedException
The getTokens return all the tokens belong to the owner of SubjectID.
Parameters:
securityCtx - defines the calling user identity (i.e. caller) who submit this request together with cient application identity that can authorize and validate this request.
subjectid - defines the SubjectID of the user whom the token is being retrieved.
Returns:
list of tokens if operation is done successfully.
Throws:
RESTMethodNotAllowedException -
- if rest operation is not allowed.
RESTUnauthorizedException -
- if credential is mismatched for user.
- if the token is invalid.
- if user is not exist for authentication.
RESTBadRequestException -
- if the request has mismatched parameters.
RESTServerRuntimeException -
- if there is any error for processing authentication.
RESTNotFoundException
RESTForbiddenException
RESTUnauthorizedException
RESTBadRequestException
RESTMethodNotAllowedException

getAllTokens

java.util.List<Token> getAllTokens(SecurityContext securityCtx,
                                   SubjectID subjectid)
                                   throws RESTNotFoundException,
                                          RESTForbiddenException,
                                          RESTUnauthorizedException,
                                          RESTMethodNotAllowedException
The getAllTokens return all the tokens belong to the system.
Parameters:
securityCtx - defines the calling user identity (i.e. caller) who submit this request together with cient application identity that can authorize and validate this request.
subjectid - defines the SubjectID of the user whom the token is being retrieved.
Returns:
list of tokens if operation is done successfully.
Throws:
RESTMethodNotAllowedException -
- if rest operation is not allowed.
RESTUnauthorizedException -
- if credential is mismatched for user.
RESTServerRuntimeException -
- if there is any error for processing authentication.
RESTNotFoundException
RESTForbiddenException
RESTUnauthorizedException
RESTMethodNotAllowedException

Skip navigation links

Copyright (c) 2012,
Oracle All Rights Reserved.
Built 06/05/2012 17:18:07 PDT