public interface AdapterSecurityContext
@Context
annotation to inject it.
For example:
@Context
AdapterSecurityContext securityContext;
@OAuthSecurity(scope = "userLogin")
@GET
@Produces(MediaType.TEXT_PLAIN)
public String sayHello() {
AuthenticatedUser user = securityContext.getAuthenticatedUser();
return "Hello " + user.getDisplayName();
}
Modifier and Type | Method and Description |
---|---|
java.util.List |
findClientRegistrationData(ClientSearchCriteria criteria)
Finds the registration data of mobile clients by the given search criteria.
|
TokenIntrospectionData |
getAccessTokenInfo()
Gets introspection data of the current access token provided in the request.
|
AuthenticatedUser |
getAuthenticatedUser()
Gets the latest authenticated user.
|
ClientData |
getClientRegistrationData()
Gets registration data for the caller mobile client.
|
ClientData |
getClientRegistrationData(java.lang.String clientId)
Gets registration data for the given client ID.
|
void |
storeClientRegistrationData(ClientData clientData)
Updates the registration data of a client.
|
boolean |
validateCredentials(java.lang.String securityCheckName,
java.util.Map credentials,
HttpServletRequest request)
Validates the given credentials with the given security check.
|
AuthenticatedUser getAuthenticatedUser()
TokenIntrospectionData getAccessTokenInfo()
ClientData getClientRegistrationData()
ClientData getClientRegistrationData(java.lang.String clientId)
clientId
- the client IDjava.util.List findClientRegistrationData(ClientSearchCriteria criteria)
criteria
- the search criteriavoid storeClientRegistrationData(ClientData clientData)
ClientData
isnstance must be obtained via AdapterSecurityContext.getClientRegistrationData()
, AdapterSecurityContext.getClientRegistrationData(String)
,
or AdapterSecurityContext.findClientRegistrationData(ClientSearchCriteria)
. clientData
- the modified data to be stored.boolean validateCredentials(java.lang.String securityCheckName, java.util.Map credentials, HttpServletRequest request)
securityCheckName
- check namecredentials
- credentials (name-value pairs) to be validated by the security checkrequest
- the client requestjava.lang.RuntimeException
- if the check does not exist or cannot be instantiated
© Copyright IBM Corp. 2006, 2015. All Rights Reserved.