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(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.
|
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)ClientRuntimeException
- 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)ClientRuntimeException
- if multiple tokens are found for the same
(userName, applicationName, deviceId) tripletString getUserName(String token)
void revokeToken(String token)
DocumentModelList getTokenBindings(String userName)
Copyright © 2013 Nuxeo SA. All Rights Reserved.