|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jersey.oauth.server.api.providers.DefaultOAuthProvider.Token
public class DefaultOAuthProvider.Token
Simple immutable implementation of OAuthToken
.
Constructor Summary | |
---|---|
|
DefaultOAuthProvider.Token(String token,
String secret,
DefaultOAuthProvider.Token requestToken)
|
|
DefaultOAuthProvider.Token(String token,
String secret,
String consumerKey,
String callbackUrl,
Map<String,List<String>> attributes)
|
protected |
DefaultOAuthProvider.Token(String token,
String secret,
String consumerKey,
String callbackUrl,
Principal principal,
Set<String> roles,
MultivaluedMap<String,String> attributes)
|
Method Summary | |
---|---|
protected DefaultOAuthProvider.Token |
authorize(Principal principal,
Set<String> roles)
Authorizes this token - i.e. |
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". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DefaultOAuthProvider.Token(String token, String secret, String consumerKey, String callbackUrl, Principal principal, Set<String> roles, MultivaluedMap<String,String> attributes)
public DefaultOAuthProvider.Token(String token, String secret, String consumerKey, String callbackUrl, Map<String,List<String>> attributes)
public DefaultOAuthProvider.Token(String token, String secret, DefaultOAuthProvider.Token requestToken)
Method Detail |
---|
public String getToken()
OAuthToken
getToken
in interface OAuthToken
public String getSecret()
OAuthToken
getSecret
in interface OAuthToken
public OAuthConsumer getConsumer()
OAuthToken
getConsumer
in interface OAuthToken
public MultivaluedMap<String,String> getAttributes()
OAuthToken
OAuthProvider#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 OAuthToken
public Principal getPrincipal()
OAuthToken
Principal
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 OAuthToken
public boolean isInRole(String role)
OAuthToken
SecurityContext.isUserInRole(java.lang.String)
to this
method.
isInRole
in interface OAuthToken
role
- a String
specifying the name of the role
boolean
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |