JavaQuery Examples
javaquery / examples Goto Github PK
View Code? Open in Web Editor NEWJavaQuery Examples
Home Page: http://www.javaquery.com
License: MIT License
JavaQuery Examples
Home Page: http://www.javaquery.com
License: MIT License
Hello,
i am having trouble with signature of aws canonical request, using your util
i am trying to make a post call for the iot endpoint
https://**-ats.iot.us-east-1.amazonaws.com/topics/test?qos=0
same req was working with postman client
TreeMap<String, String> awsHeaders = new TreeMap<String, String>();
awsHeaders.put("host", "***-ats.iot.us-east-1.amazonaws.com");
TreeMap<String, String> awsQueryParam = new TreeMap<>();
awsQueryParam.put("qos", "0");
AWSV4Auth aWSV4Auth = new AWSV4Auth.Builder(accessKey, secretKey)
.regionName("us-east-1")
.serviceName("iotdata") // es - elastic search. use your service name
.httpMethodName("POST") //GET, PUT, POST, DELETE, etc...
.canonicalURI("topics/test") //end point
.queryParametes(awsQueryParam) //query parameters if any
.awsHeaders(awsHeaders) //aws header parameters
.payload(payload) // payload if any
.debug() // turn on the debug mode
.build();
but getting signature error
Client error <403 FORBIDDEN Forbidden,{"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.","traceId":"80e40ad7-9db1-7a60-809a-889c9fecb852"},[date:"Mon, 11 Feb 2019 20:57:32 GMT", x-amzn-ErrorType:"ForbiddenException:", x-amzn-RequestId:"80e40ad7-9db1-7a60-809a-889c9fecb852", connection:"keep-alive", content-type:"application/json", content-length:"241"]>
let me know if i am doing anything wrong
Thank you,
When I Post data to S3, I must to send X-Amz-Content-Sha256 header.
In AWSV4Auth.java there isn't this business logic.
I tried to change source code, but I receive the following error message:
<Error><Code>XAmzContentSHA256Mismatch</Code><Message>The Content-SHA256 you specified did not match what we received</Message><Resource>bucket_prova1/filedaStandalone9.txt</Resource><RequestId>0c07c835:16b79321460:646d:60a</RequestId></Error>
Hi @javaquery
I came across your AWS signing example today but there's no licensing information attached to it. Can you add a license to it, please, so we can know if we're allowed to use it?
Cheers,
-James
Hi ,
I am trying to do GET requests such as describe images or describe regions using this URI
https://ec2.us-east-1.amazonaws.com/?Action=DescribeImages&Version=2016-11-15
GET
/
Action=DescribeImages&Version=2016-11-15
content-type:application/x-www-form-urlencoded; charset=utf-8
host:ec2.amazonaws.com
x-amz-date:20170629T132328Z
the headers are ,
x-amz-date : 20170629T132328Z
Authorization : AWS4-HMAC-SHA256 Credential=AbCdEfGhIjKASDFWER/20170629/us-east-1/ec2/aws4_request,SignedHeaders=content-type;host;x-amz-date,Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
host : ec2.amazonaws.com
content-type : application/x-www-form-urlencoded; charset=utf-8
and I am always getting this error
AuthFailure
AWS was not able to validate the provided access credentialsdcbsjdhbvjshdvbjhsbdvjhbsdcjhb
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.