Class OAuth1AuthorizationFlowImpl
java.lang.Object
org.glassfish.jersey.client.oauth1.OAuth1AuthorizationFlowImpl
- All Implemented Interfaces:
OAuth1AuthorizationFlow
Default implementation of
OAuth1AuthorizationFlow
. The instance is used
to perform authorization flows.- Since:
- 2.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
OAuth1AuthorizationFlowImpl builder. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AccessToken
private final String
private final String
private final javax.ws.rs.client.Client
private static final Logger
private final Value
<javax.ws.rs.core.Feature> private final OAuth1Parameters
The OAuth parameters to be used in generating signature.private final String
private final OAuth1Secrets
The OAuth secrets to be used in generating signature. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
OAuth1AuthorizationFlowImpl
(OAuth1Parameters params, OAuth1Secrets secrets, String requestTokenUri, String accessTokenUri, String authorizationUri, String callbackUri, javax.ws.rs.client.Client client, boolean enableLogging) -
Method Summary
Modifier and TypeMethodDescriptionprivate javax.ws.rs.client.Invocation.Builder
addProperties
(javax.ws.rs.client.Invocation.Builder invocationBuilder) finish()
Finish the authorization process and return theAccessToken
.Finish the authorization process and return theAccessToken
.javax.ws.rs.client.Client
Return the client configured for performing authorized requests to the Service Provider.javax.ws.rs.core.Feature
Return theoauth filter feature
that can be used to configureclient
instances to perform authenticated requests to the Service Provider.start()
Start the authorization process and return redirection URI on which the user should give a consent for our application to access resources.
-
Field Details
-
LOGGER
-
parameters
The OAuth parameters to be used in generating signature. -
secrets
The OAuth secrets to be used in generating signature. -
requestTokenUri
-
accessTokenUri
-
authorizationUri
-
client
private final javax.ws.rs.client.Client client -
accessToken
-
oAuth1ClientFilterFeature
-
-
Constructor Details
-
OAuth1AuthorizationFlowImpl
private OAuth1AuthorizationFlowImpl(OAuth1Parameters params, OAuth1Secrets secrets, String requestTokenUri, String accessTokenUri, String authorizationUri, String callbackUri, javax.ws.rs.client.Client client, boolean enableLogging)
-
-
Method Details
-
addProperties
private javax.ws.rs.client.Invocation.Builder addProperties(javax.ws.rs.client.Invocation.Builder invocationBuilder) -
start
Description copied from interface:OAuth1AuthorizationFlow
Start the authorization process and return redirection URI on which the user should give a consent for our application to access resources.Note: the method makes a request to the Authorization Server in order to get request token.
- Specified by:
start
in interfaceOAuth1AuthorizationFlow
- Returns:
- URI to which user should be redirected.
-
finish
Description copied from interface:OAuth1AuthorizationFlow
Finish the authorization process and return theAccessToken
. The method must be called on the same instance after theOAuth1AuthorizationFlow.start()
method was called and user granted access to this application.The method makes a request to the Authorization Server but does not exchange verifier for access token. This method is intended only for some flows/cases in OAuth1.
- Specified by:
finish
in interfaceOAuth1AuthorizationFlow
- Returns:
- Access token.
-
finish
Description copied from interface:OAuth1AuthorizationFlow
Finish the authorization process and return theAccessToken
. The method must be called on the same instance after theOAuth1AuthorizationFlow.start()
method was called and user granted access to this application.The method makes a request to the Authorization Server in order to exchange verifier for access token.
- Specified by:
finish
in interfaceOAuth1AuthorizationFlow
- Parameters:
verifier
- Verifier provided from the user authorization.- Returns:
- Access token.
-
getAuthorizedClient
public javax.ws.rs.client.Client getAuthorizedClient()Description copied from interface:OAuth1AuthorizationFlow
Return the client configured for performing authorized requests to the Service Provider. The authorization process must be successfully finished by instance by calling methodsOAuth1AuthorizationFlow.start()
andOAuth1AuthorizationFlow.finish(String)
.- Specified by:
getAuthorizedClient
in interfaceOAuth1AuthorizationFlow
- Returns:
- Client configured to add correct
Authorization
header to requests.
-
getOAuth1Feature
public javax.ws.rs.core.Feature getOAuth1Feature()Description copied from interface:OAuth1AuthorizationFlow
Return theoauth filter feature
that can be used to configureclient
instances to perform authenticated requests to the Service Provider.The authorization process must be successfully finished by instance by calling methods
OAuth1AuthorizationFlow.start()
andOAuth1AuthorizationFlow.finish(String)
.- Specified by:
getOAuth1Feature
in interfaceOAuth1AuthorizationFlow
- Returns:
- oauth filter feature configured with received
AccessToken
.
-