T
- Type of the builder implementation. This parameter is used for convenience to allow
better implementations of the builders implementing this interface (builder can return
their own specific type instead of type defined by this interface only).public static interface OAuth2CodeGrantFlow.Builder<T extends OAuth2CodeGrantFlow.Builder>
OAuth2CodeGrantFlow
.Modifier and Type | Method and Description |
---|---|
T |
accessTokenUri(String accessTokenUri)
Set the access token URI on which the access token can be requested.
|
T |
authorizationUri(String authorizationUri)
Set the URI to which the user should be redirected to authorize our application.
|
OAuth2CodeGrantFlow |
build()
Build the
OAuth2CodeGrantFlow instance. |
T |
client(javax.ws.rs.client.Client client)
Set the client that should be used internally by the
OAuth1AuthorizationFlow to make requests to
Authorization Server. |
T |
clientIdentifier(ClientIdentifier clientIdentifier)
Set client identifier of the application that should be authorized.
|
T |
property(OAuth2CodeGrantFlow.Phase phase,
String key,
String value)
Set property (parameter) that will be added to requests or URIs as a query parameters during
the Authorization Flow.
|
T |
redirectUri(String redirectUri)
Set the redirect URI to which the user (resource owner) should be redirected after he/she
grants access to our application.
|
T |
refreshTokenUri(String refreshTokenUri)
Set the refresh token URI on which the access token can be refreshed using a refresh token.
|
T |
scope(String scope)
Set a scope to which the application will get authorization grant.
|
T accessTokenUri(String accessTokenUri)
accessTokenUri
- Access token URI.T authorizationUri(String authorizationUri)
authorizationUri
- Authorization URI.T redirectUri(String redirectUri)
code
and state
that will be used in
OAuth2CodeGrantFlow.finish(String, String)
method.
If URI is not defined by this method, the default value urn:ietf:wg:oauth:2.0:oob
will be used
in the Authorization
Flow which should cause that code
will be passed to application in other way than request
redirection (for example shown to the user using html page).
redirectUri
- URI that should receive authorization response from the Service Provider.T clientIdentifier(ClientIdentifier clientIdentifier)
clientIdentifier
- Client identifier.T scope(String scope)
The parameter is optional but ServiceProvider might require it.
scope
- Scope string.T client(javax.ws.rs.client.Client client)
OAuth1AuthorizationFlow
to make requests to
Authorization Server. If this method is not called, it is up to the implementation to create or get
any private client instance to perform these requests. This method could be used mainly for
performance reasons to avoid creation of new client instances and have control about created client
instances used in the application.client
- Client instance.T refreshTokenUri(String refreshTokenUri)
accessTokenUri(String)
(which is the default value
defined by the OAuth2 spec).
Some providers do not support
refreshing access tokens at all.refreshTokenUri
- Refresh token URI.T property(OAuth2CodeGrantFlow.Phase phase, String key, String value)
phase
- Phase of the flow in which the properties (parameters) should be used. For example by using
a OAuth2CodeGrantFlow.Phase.ACCESS_TOKEN_REQUEST
, the parameter will be added only to the http request
for access token.key
- Property key.value
- Property value.OAuth2CodeGrantFlow build()
OAuth2CodeGrantFlow
instance.OAuth2CodeGrantFlow
.Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.