You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public String generateSignature(String currentDate) throws URISyntaxException {
String contentSha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
URI uri = new URI("https://service.chime.aws.amazon.com");
HttpRequest request = new HttpRequest("GET", uri);
String signature = Signer.builder()
.awsCredentials(new AwsCredentials(ACCESS_KEY, SECRET_KEY))
.header("Host", "service.chime.aws.amazon.com")
.header("x-amz-date", currentDate)
.header("x-amz-content-sha256", contentSha256)
.build(request, "chime", contentSha256)
.getSignature();
return signature;
}
stil returning
<InvalidSignatureException>
<Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.</Message>
</InvalidSignatureException>
can you help me out? this lib is the closer thing i got from solving this issue of connecting at AWS/Chime Rest API.
The text was updated successfully, but these errors were encountered:
Hi Durval,
I only tested this library against S3 API (worked for me), however, what you put there looks correct at first glance.
The suspect could be the currentDate as you provide it in the parameter, make sure it has format like this, e.g.: "20150830T123600Z".
The "Host" is probably correct as it is, just a small remark - as I had distinct port to use, so I had to put hostname:port into that header in order to make it work, but that should not be your case.
Last but not least, try to validate the AWS credentials - easy to do e.g. in Postman tool (if you haven't tried already) - you can select AWS Signature on Authorization tab, set your credentials and see the auto-generated signature, which gets into Authorization header in the request, and try to test calling the API from the tool at first.
below my code from function created.
stil returning
can you help me out? this lib is the closer thing i got from solving this issue of connecting at AWS/Chime Rest API.
The text was updated successfully, but these errors were encountered: