Class DefaultOAuth1Provider.Consumer
java.lang.Object
org.glassfish.jersey.server.oauth1.DefaultOAuth1Provider.Consumer
- All Implemented Interfaces:
OAuth1Consumer
- Enclosing class:
DefaultOAuth1Provider
Simple read-only implementation of
OAuth1Consumer
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns additional attributes associated with the consumer (e.g.getKey()
Returns consumer key.getOwner()
Returns identifier of owner of this consumer - i.e.Returns aPrincipal
object representing this consumer.Returns consumer secret.boolean
Returns a boolean indicating whether this consumer is authorized for the specified logical "role".
-
Field Details
-
key
-
secret
-
owner
-
attributes
-
-
Constructor Details
-
Consumer
-
-
Method Details
-
getKey
Description copied from interface:OAuth1Consumer
Returns consumer key.- Specified by:
getKey
in interfaceOAuth1Consumer
- Returns:
- consumer key
-
getSecret
Description copied from interface:OAuth1Consumer
Returns consumer secret.- Specified by:
getSecret
in interfaceOAuth1Consumer
- Returns:
- consumer secret
-
getOwner
Returns identifier of owner of this consumer - i.e. who registered the consumer.- Returns:
- consumer owner
-
getAttributes
Returns additional attributes associated with the consumer (e.g. name, URI, description, etc.)- Returns:
- name-values pairs of additional attributes
-
getPrincipal
Description copied from interface:OAuth1Consumer
Returns aPrincipal
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.- Specified by:
getPrincipal
in interfaceOAuth1Consumer
- Returns:
- Principal corresponding to this consumer, or null if 2-legged oauth not supported (i.e. consumers can't act on their own)
-
isInRole
Description copied from interface:OAuth1Consumer
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 delegatesSecurityContext.isUserInRole(String)
to this method.- Specified by:
isInRole
in interfaceOAuth1Consumer
- Parameters:
role
- aString
specifying the name of the role- Returns:
- a
boolean
indicating whether this token is authorized for a given role
-