com.sun.jersey.oauth.server.spi
Interface OAuthConsumer

All Known Implementing Classes:
DefaultOAuthProvider.Consumer

public interface OAuthConsumer

Class representing a registered consumer.


Method Summary
 java.lang.String getKey()
          Returns consumer key.
 java.security.Principal getPrincipal()
          Returns a Principal object representing this consumer.
 java.lang.String getSecret()
          Returns consumer secret.
 boolean isInRole(java.lang.String role)
          Returns a boolean indicating whether this consumer is authorized for the specified logical "role".
 

Method Detail

getKey

java.lang.String getKey()
Returns consumer key.

Returns:
consumer key

getSecret

java.lang.String getSecret()
Returns consumer secret.

Returns:
consumer secret

getPrincipal

java.security.Principal getPrincipal()
Returns a Principal object representing this consumer. When the oauth filter verifies the request and no access token is provided, this is the principal that will get set to the security context. This can be used for 2-legged oauth. If the server does not allow consumers acting on their own (with no access token), this method should return null.

Returns:
Principal corresponding to this consumer, or null if 2-legged oauth not supported (i.e. consumers can't act on their own)
Since:
1.7

isInRole

boolean isInRole(java.lang.String role)
Returns a boolean indicating whether this consumer is authorized for the specified logical "role". When the oauth filter verifies the request and no access token is provided (2-legged oauth), it sets the consumer object to the 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
Since:
1.7


Copyright © 2014 Oracle Corporation. All Rights Reserved.