public class TokenRESTService extends Object
Constructor and Description |
---|
TokenRESTService() |
Modifier and Type | Method and Description |
---|---|
APIAuthenticationResult |
createToken(String username,
String password,
String token,
javax.servlet.http.HttpServletRequest consumedRequest,
javax.ws.rs.core.MultivaluedMap<String,String> parameters)
Authenticates a user, generates an auth token, associates that auth token
with the user's UserContext for use by further requests.
|
void |
invalidateToken(String authToken)
Invalidates a specific auth token, effectively logging out the associated
user.
|
public APIAuthenticationResult createToken(String username, String password, String token, @Context javax.servlet.http.HttpServletRequest consumedRequest, javax.ws.rs.core.MultivaluedMap<String,String> parameters) throws GuacamoleException
username
- The username of the user who is to be authenticated.password
- The password of the user who is to be authenticated.token
- An optional existing auth token for the user who is to be
authenticated.consumedRequest
- The HttpServletRequest associated with the login attempt. The
parameters of this request may not be accessible, as the request may
have been fully consumed by JAX-RS.parameters
- A MultivaluedMap containing all parameters from the given HTTP
request. All request parameters must be made available through this
map, even if those parameters are no longer accessible within the
now-fully-consumed HTTP request.GuacamoleException
- If an error prevents successful authentication.public void invalidateToken(String authToken)
authToken
- The token being invalidated.Copyright © 2017. All rights reserved.