public interface OAuth2Operations
Modifier and Type | Method and Description |
---|---|
AccessGrant |
authenticateClient()
Retrieves the client access grant using OAuth 2 client password flow.
|
AccessGrant |
authenticateClient(String scope)
Retrieves the client access grant using OAuth 2 client password flow.
|
String |
buildAuthenticateUrl(GrantType grantType,
OAuth2Parameters parameters)
Construct the URL to redirect the user to for authentication.
|
String |
buildAuthenticateUrl(OAuth2Parameters parameters)
Construct the URL to redirect the user to for authentication via OAuth2's "Authorization Code Grant".
|
String |
buildAuthorizeUrl(GrantType grantType,
OAuth2Parameters parameters)
Construct the URL to redirect the user to for authorization.
|
String |
buildAuthorizeUrl(OAuth2Parameters parameters)
Construct the URL to redirect the user to for authorization via OAuth2's "Authorization Code Grant".
|
AccessGrant |
exchangeCredentialsForAccess(String username,
String password,
MultiValueMap<String,String> additionalParameters)
Exchanges user credentials for an access grant using OAuth2's Resource Owner Credentials Grant (aka, "password" grant).
|
AccessGrant |
exchangeForAccess(String authorizationCode,
String redirectUri,
MultiValueMap<String,String> additionalParameters)
Exchange the authorization code for an access grant.
|
AccessGrant |
refreshAccess(String refreshToken,
MultiValueMap<String,String> additionalParameters)
Refreshes a previous access grant.
|
AccessGrant |
refreshAccess(String refreshToken,
String scope,
MultiValueMap<String,String> additionalParameters)
Deprecated.
Set the scope via additional parameters. This can be done conveniently user OAuth2Parameters.
|
String buildAuthorizeUrl(OAuth2Parameters parameters)
parameters
- authorization parameters needed to build the URLString buildAuthorizeUrl(GrantType grantType, OAuth2Parameters parameters)
buildAuthorizeUrl(OAuth2Parameters)
instead.grantType
- specifies whether to use client-side or server-side OAuth flowparameters
- authorization parameters needed to build the URLString buildAuthenticateUrl(OAuth2Parameters parameters)
parameters
- authorization parameters needed to build the URLString buildAuthenticateUrl(GrantType grantType, OAuth2Parameters parameters)
buildAuthenticateUrl(OAuth2Parameters)
instead.grantType
- specifies whether to use client-side or server-side OAuth flowparameters
- authorization parameters needed to build the URLAccessGrant exchangeForAccess(String authorizationCode, String redirectUri, MultiValueMap<String,String> additionalParameters)
authorizationCode
- the authorization code returned by the provider upon user authorizationredirectUri
- the authorization callback url; this value must match the redirectUri registered with the provideradditionalParameters
- any additional parameters to be sent when exchanging the authorization code for an access grant. Should not be encoded.AccessGrant exchangeCredentialsForAccess(String username, String password, MultiValueMap<String,String> additionalParameters)
username
- the user's username on the providerpassword
- the user's password on the provideradditionalParameters
- any additional parameters to be sent when exchanging the credentials for an access grant. Should not be encoded.@Deprecated AccessGrant refreshAccess(String refreshToken, String scope, MultiValueMap<String,String> additionalParameters)
refreshToken
- the refresh token from the previous access grant.scope
- optional scope to narrow to when refreshing access; if null, the existing scope is preserved.additionalParameters
- any additional parameters to be sent when refreshing a previous access grant. Should not be encoded.AccessGrant refreshAccess(String refreshToken, MultiValueMap<String,String> additionalParameters)
refreshToken
- the refresh token from the previous access grant.additionalParameters
- any additional parameters to be sent when refreshing a previous access grant. Should not be encoded.AccessGrant authenticateClient()
AccessGrant authenticateClient(String scope)
scope
- optional scope to get for the access grant