public class DefaultOAuthProvider.Token extends Object implements OAuthToken
OAuthToken.| Modifier | Constructor and Description |
|---|---|
|
Token(String token,
String secret,
DefaultOAuthProvider.Token requestToken) |
|
Token(String token,
String secret,
String consumerKey,
String callbackUrl,
Map<String,List<String>> attributes) |
protected |
Token(String token,
String secret,
String consumerKey,
String callbackUrl,
Principal principal,
Set<String> roles,
javax.ws.rs.core.MultivaluedMap<String,String> attributes) |
| Modifier and Type | Method and Description |
|---|---|
protected DefaultOAuthProvider.Token |
authorize(Principal principal,
Set<String> roles)
Authorizes this token - i.e.
|
javax.ws.rs.core.MultivaluedMap<String,String> |
getAttributes()
Returns additional custom attributes associated with the token.
|
String |
getCallbackUrl()
Returns callback URL for this token (applicable just to request tokens)
|
OAuthConsumer |
getConsumer()
Returns consumer this token was issued for.
|
Principal |
getPrincipal()
Returns a
Principal object containing the name of the
user the request containing this token is authorized to act on behalf of. |
String |
getSecret()
Returns the token secret.
|
String |
getToken()
Returns string representing the token.
|
boolean |
isInRole(String role)
Returns a boolean indicating whether this token is authorized for the
specified logical "role".
|
protected Token(String token, String secret, String consumerKey, String callbackUrl, Principal principal, Set<String> roles, javax.ws.rs.core.MultivaluedMap<String,String> attributes)
public Token(String token, String secret, String consumerKey, String callbackUrl, Map<String,List<String>> attributes)
public Token(String token, String secret, DefaultOAuthProvider.Token requestToken)
public String getToken()
OAuthTokengetToken in interface OAuthTokenpublic String getSecret()
OAuthTokengetSecret in interface OAuthTokenpublic OAuthConsumer getConsumer()
OAuthTokengetConsumer in interface OAuthTokenpublic javax.ws.rs.core.MultivaluedMap<String,String> getAttributes()
OAuthTokenOAuthProvider#newRequestToken(java.lang.String, java.lang.String, javax.ws.rs.core.MultivaluedMap)
method that created this request token. If this is an access token,
this is any application defined set that will included as form parameters
in a response to accessToken request.getAttributes in interface OAuthTokenpublic Principal getPrincipal()
OAuthTokenPrincipal object containing the name of the
user the request containing this token is authorized to act on behalf of.
When the oauth filter verifies the request
with this token is properly authenticated, it injects this token into a security context
which then delegates SecurityContext.getUserPrincipal() to this
method.getPrincipal in interface OAuthTokenpublic boolean isInRole(String role)
OAuthTokenSecurityContext.isUserInRole(java.lang.String) to this
method.isInRole in interface OAuthTokenrole - a String specifying the name of the roleboolean indicating whether this token is authorized for
a given rolepublic String getCallbackUrl()
protected DefaultOAuthProvider.Token authorize(Principal principal, Set<String> roles)
principal - Principal to add to the token.roles - Roles to add to the token.Copyright © 2014 Oracle Corporation. All rights reserved.