public interface TokenAuthenticationService extends Serializable
Typically, the service is called by the TokenAuthenticationServlet
to get a token from the user information
passed as request parameters, and it allows the TokenAuthenticator
to check for a valid identity given a
token passed as a request header.
Modifier and Type | Method and Description |
---|---|
String |
acquireToken(javax.servlet.http.HttpServletRequest request)
Acquires a unique token for the specified request.
|
String |
acquireToken(String userName,
String applicationName,
String deviceId,
String deviceDescription,
String permission)
Acquires a unique token for the specified user, application, and device.
|
String |
getToken(String userName,
String applicationName,
String deviceId)
Gets the token for the specified user, application, and device.
|
DocumentModelList |
getTokenBindings(String userName)
Gets the token bindings for the specified user.
|
DocumentModelList |
getTokenBindings(String userName,
String applicationName)
Gets the token bindings for the specified user and application.
|
String |
getUserName(String token)
Gets the user name bound to the specified token.
|
void |
revokeToken(String token)
Removes the token from the back-end.
|
String acquireToken(String userName, String applicationName, String deviceId, String deviceDescription, String permission) throws TokenAuthenticationException
If such a token exist in the back-end for the specified (userName, applicationName, deviceId) triplet, just returns it, else generates it and stores it in the back-end with the triplet attributes, the specified device description and permission.
TokenAuthenticationException
- if one of the required parameters is null or empty (all parameters are
required except for the device description)NuxeoException
- if multiple tokens are found for the same tripletString acquireToken(javax.servlet.http.HttpServletRequest request) throws TokenAuthenticationException
Parameters needed (applicationName, deviceId, deviceDescription, permission) to acquire the token are extracted from the request itself.
If such a token exist in the back-end for the specified (userName, applicationName, deviceId) triplet, just returns it, else generates it and stores it in the back-end with the triplet attributes, the specified device description and permission.
TokenAuthenticationException
- if one of the required parameters is null or empty (all parameters are
required except for the device description)NuxeoException
- if multiple tokens are found for the same tripletString getToken(String userName, String applicationName, String deviceId) throws TokenAuthenticationException
TokenAuthenticationException
- if one of the required parameters is null or empty (all parameters are
required except for the device description)NuxeoException
- if multiple tokens are found for the same (userName, applicationName, deviceId) tripletString getUserName(String token)
void revokeToken(String token)
DocumentModelList getTokenBindings(String userName)
DocumentModelList getTokenBindings(String userName, String applicationName)
Copyright © 2018 Nuxeo. All rights reserved.