Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jersey.oauth.server.spi
Interface OAuthToken

All Known Implementing Classes:
  DefaultOAuthProvider.Token

    public interface OAuthToken

Interface representing an OAuth token (i.e. access token or request token).

Author:
  Martin Matula

Method Summary
`MultivaluedMap<java.lang.String,java.lang.String>` | `getAttributes()` Returns additional custom attributes associated with the token.
`OAuthConsumer` | `getConsumer()` Returns consumer this token was issued for.
`java.security.Principal` | `getPrincipal()` Returns a `Principal` object containing the name of the user the request containing this token is authorized to act on behalf of.
`java.lang.String` | `getSecret()` Returns the token secret.
`java.lang.String` | `getToken()` Returns string representing the token.
`boolean` | `isInRole(java.lang.String role)` Returns a boolean indicating whether this token is authorized for the specified logical "role".

Method Detail

### getToken

    java.lang.String getToken()

  Returns string representing the token.

  Returns:
    string representing the token

### getSecret

    java.lang.String getSecret()

  Returns the token secret.

  Returns:
    token secret

### getConsumer

    OAuthConsumer getConsumer()

  Returns consumer this token was issued for.

  Returns:
    consumer this token was issued for.

### getAttributes

    MultivaluedMap<java.lang.String,java.lang.String> getAttributes()

  Returns additional custom attributes associated with the token. If this is a request token, this should be a the same set or a defined subset of parameters that were passed to the `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.

  Returns:
    immutable map of custom attributes

### getPrincipal

    java.security.Principal getPrincipal()

  Returns a `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.

  Returns:
    Principal corresponding to this token, or null if the token is not authorized

### isInRole

    boolean isInRole(java.lang.String role)

  Returns a boolean indicating whether this token is authorized for the specified logical "role". 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.isUserInRole(java.lang.String)` to this method.

  Parameters:
    `role` - a `String` specifying the name of the role
  Returns:
    a `boolean` indicating whether this token is authorized for a given role

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013 Oracle Corporation. All Rights Reserved.