org.glassfish.jersey.server.oauth1
Class OAuth1ServerFeature

java.lang.Object
  extended by org.glassfish.jersey.server.oauth1.OAuth1ServerFeature
All Implemented Interfaces:
javax.ws.rs.core.Feature

public class OAuth1ServerFeature
extends Object
implements javax.ws.rs.core.Feature

The feature enables support for OAuth 1.0a on the server.

The OAuth 1 server support requires implementation of OAuth1Provider; which will be used to retrieve Request Tokens, Access tokens, etc. The implementation should be configured in this feature or registered as a standard provider.

Feature can be created and configured by various constructors. Beside that, the feature behaviour can be overwritten by configuration properties OAuth1ServerProperties.ENABLE_TOKEN_RESOURCES, OAuth1ServerProperties.REQUEST_TOKEN_URI and OAuth1ServerProperties.ACCESS_TOKEN_URI.

Author:
Miroslav Fuksa (miroslav.fuksa at oracle.com)

Constructor Summary
OAuth1ServerFeature()
          Create a new feature.
OAuth1ServerFeature(OAuth1Provider oAuth1Provider)
          Create a new feature configured with OAuth provider.
OAuth1ServerFeature(OAuth1Provider oAuth1Provider, String requestTokenUri, String accessTokenUri)
          Create a new feature configured with OAuth provider and request and access token URIs.
 
Method Summary
 boolean configure(javax.ws.rs.core.FeatureContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuth1ServerFeature

public OAuth1ServerFeature(OAuth1Provider oAuth1Provider,
                           String requestTokenUri,
                           String accessTokenUri)
Create a new feature configured with OAuth provider and request and access token URIs. The feature also exposes Request and Access Token Resources. These resources are part of the Authorization process and grant Request and Access tokens. Resources will be available on URIs defined by parameters requestTokenUri and accessTokenUri.

Parameters:
oAuth1Provider - Instance of the OAuth1Provider that will handle authorization. If the value is null, then the provider must be registered explicitly outside of this feature as a standard provider.
requestTokenUri - URI (relative to application context path) of Request Token Resource that will be exposed.
accessTokenUri - URI (relative to application context path) of Request Token Resource that will be exposed.

OAuth1ServerFeature

public OAuth1ServerFeature(OAuth1Provider oAuth1Provider)
Create a new feature configured with OAuth provider. The feature will not expose Request and Access Token Resources. The OAuth 1 support will not be responsible for handling these authorization request types.

Parameters:
oAuth1Provider - Instance of the OAuth1Provider that will handle authorization.

OAuth1ServerFeature

public OAuth1ServerFeature()
Create a new feature. The feature will not register any OAuth provider and it will not expose Request and Access Token Resources. OAuth1Provider must be registered explicitly as a standard provider. As Token Resources are not exposed, the OAuth 1 support will not be responsible for handling Token Requests.

Method Detail

configure

public boolean configure(javax.ws.rs.core.FeatureContext context)
Specified by:
configure in interface javax.ws.rs.core.Feature


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.