public class OAuth1Signer extends Object implements HttpProvider.HttpRequestAuthorizer
See also HTTP Authentication Scheme Registry for a list of authschemes.
| Constructor and Description |
|---|
OAuth1Signer(Clock clock,
String accessKeyId,
String accessKeySecret)
Construct the OAuth signer based on clock, accessKeyId, and accessKeySecret.
|
OAuth1Signer(Clock clock,
String consumerKey,
String consumerSecret,
SignatureMethod signatureMethod)
Construct the OAuth signer based on clock, consumerKey, consumerSecret,
and signatureMethod.
|
OAuth1Signer(String accessKeyId,
String accessKeySecret)
Construct the OAuth signer based on accessKeyId and accessKeySecret.
|
OAuth1Signer(String consumerKey,
String consumerSecret,
SignatureMethod signatureMethod) |
| 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.
|
protected void |
nextBytes(byte[] bytes)
The source of entropy for OAuth1.0 nonce values.
|
public OAuth1Signer(String accessKeyId, String accessKeySecret)
accessKeyId - the HERE client accessKeyId. Becomes the value of oauth_consumer_key in
the Authorization: OAuth header.accessKeySecret - the HERE client accessKeySecret. Used to calculate the oauth_signature
in the Authorization: OAuth header.public OAuth1Signer(Clock clock, String accessKeyId, String accessKeySecret)
clock - the implementation of a clock you want to useaccessKeyId - the HERE clientId. Becomes the value of oauth_consumer_key in
the Authorization: OAuth header.accessKeySecret - the HERE clientSecret. Used to calculate the oauth_signature
in the Authorization: OAuth header.public OAuth1Signer(String consumerKey, String consumerSecret, SignatureMethod signatureMethod)
consumerKey - the identity of the caller, sent in plaintext.
Becomes the value of oauth_consumer_key in
the Authorization: OAuth header.consumerSecret - secret of the caller, or private key of the caller.
Used to calculate the oauth_signature
in the Authorization: OAuth header.signatureMethod - the choice of signature algorithm to use.public OAuth1Signer(Clock clock, String consumerKey, String consumerSecret, SignatureMethod signatureMethod)
clock - the implementation of a clock you want to useconsumerKey - the identity of the caller, sent in plaintext.
Becomes the value of oauth_consumer_key in
the Authorization: OAuth header.consumerSecret - secret of the caller, or private key of the caller.
Used to calculate the oauth_signature
in the Authorization: OAuth header.signatureMethod - the choice of signature algorithm to use.protected void nextBytes(byte[] bytes)
bytes - the byte array in which to stick the nonce valuepublic 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 © 2020 HERE Europe B.V. All Rights Reserved.