Class OAuth1ServerFeature
- java.lang.Object
-
- org.glassfish.jersey.server.oauth1.OAuth1ServerFeature
-
- All Implemented Interfaces:
javax.ws.rs.core.Feature
public class OAuth1ServerFeature extends java.lang.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 ofOAuth1Provider
; 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 propertiesOAuth1ServerProperties.ENABLE_TOKEN_RESOURCES
,OAuth1ServerProperties.REQUEST_TOKEN_URI
andOAuth1ServerProperties.ACCESS_TOKEN_URI
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
OAuth1ServerFeature.OAuthModelProcessor
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
accessTokenUri
private OAuth1Provider
oAuth1Provider
private java.lang.String
requestTokenUri
-
Constructor Summary
Constructors Constructor Description OAuth1ServerFeature()
Create a new feature.OAuth1ServerFeature(OAuth1Provider oAuth1Provider)
Create a new feature configured withOAuth provider
.OAuth1ServerFeature(OAuth1Provider oAuth1Provider, java.lang.String requestTokenUri, java.lang.String accessTokenUri)
Create a new feature configured withOAuth provider
and request and access token URIs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
configure(javax.ws.rs.core.FeatureContext context)
-
-
-
Field Detail
-
oAuth1Provider
private final OAuth1Provider oAuth1Provider
-
requestTokenUri
private final java.lang.String requestTokenUri
-
accessTokenUri
private final java.lang.String accessTokenUri
-
-
Constructor Detail
-
OAuth1ServerFeature
public OAuth1ServerFeature(OAuth1Provider oAuth1Provider, java.lang.String requestTokenUri, java.lang.String accessTokenUri)
Create a new feature configured withOAuth 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 parametersrequestTokenUri
andaccessTokenUri
.- Parameters:
oAuth1Provider
- Instance of theOAuth1Provider
that will handle authorization. If the value isnull
, 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 withOAuth 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 theOAuth1Provider
that will handle authorization.
-
OAuth1ServerFeature
public OAuth1ServerFeature()
Create a new feature. The feature will not register anyOAuth 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.
-
-