public class OAuth2Authorizer extends Object implements HttpProvider.HttpRequestAuthorizer
See also HTTP Authentication Scheme Registry for a list of authschemes.
| Constructor and Description |
|---|
OAuth2Authorizer(String accessToken)
Construct the Bearer authorizer with the specified accessToken.
|
OAuth2Authorizer(Supplier<String> accessTokenSupplier)
Construct the Bearer authorizer with the specified accessTokenSupplier.
|
| Modifier and Type | Method and Description |
|---|---|
void |
authorize(HttpProvider.HttpRequest httpRequest,
String method,
String url,
Map<String,List<String>> formParams)
Computes and adds a signature or token to the request as appropriate
for the authentication or authorization scheme.
|
public OAuth2Authorizer(String accessToken)
accessToken - the OAuth2.0 Bearer Access Token valuepublic OAuth2Authorizer(Supplier<String> accessTokenSupplier)
accessTokenSupplier - the Supplier for
the OAuth2.0 Bearer Access Token valuespublic void authorize(HttpProvider.HttpRequest httpRequest, String method, String url, Map<String,List<String>> formParams)
authorize in interface HttpProvider.HttpRequestAuthorizerhttpRequest - the HttpRequest under construction,
to which to attach authorizationmethod - the HTTP methodurl - the URL of the requestformParams - the
Content-Type: application/x-www-form-urlencoded
form parameters.Copyright © 2022 HERE Europe B.V. All Rights Reserved.