Class DefaultOAuth1Provider.Consumer
- java.lang.Object
-
- org.glassfish.jersey.server.oauth1.DefaultOAuth1Provider.Consumer
-
- All Implemented Interfaces:
OAuth1Consumer
- Enclosing class:
- DefaultOAuth1Provider
public static class DefaultOAuth1Provider.Consumer extends Object implements OAuth1Consumer
Simple read-only implementation ofOAuth1Consumer.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultivaluedMap<String,String>getAttributes()Returns additional attributes associated with the consumer (e.g.StringgetKey()Returns consumer key.StringgetOwner()Returns identifier of owner of this consumer - i.e.PrincipalgetPrincipal()Returns aPrincipalobject representing this consumer.StringgetSecret()Returns consumer secret.booleanisInRole(String role)Returns a boolean indicating whether this consumer is authorized for the specified logical "role".
-
-
-
Method Detail
-
getKey
public String getKey()
Description copied from interface:OAuth1ConsumerReturns consumer key.- Specified by:
getKeyin interfaceOAuth1Consumer- Returns:
- consumer key
-
getSecret
public String getSecret()
Description copied from interface:OAuth1ConsumerReturns consumer secret.- Specified by:
getSecretin interfaceOAuth1Consumer- Returns:
- consumer secret
-
getOwner
public String getOwner()
Returns identifier of owner of this consumer - i.e. who registered the consumer.- Returns:
- consumer owner
-
getAttributes
public MultivaluedMap<String,String> getAttributes()
Returns additional attributes associated with the consumer (e.g. name, URI, description, etc.)- Returns:
- name-values pairs of additional attributes
-
getPrincipal
public Principal getPrincipal()
Description copied from interface:OAuth1ConsumerReturns aPrincipalobject 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:
getPrincipalin 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
public boolean isInRole(String role)
Description copied from interface:OAuth1ConsumerReturns 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:
isInRolein interfaceOAuth1Consumer- Parameters:
role- aStringspecifying the name of the role- Returns:
- a
booleanindicating whether this token is authorized for a given role
-
-