polandj / ESPAWSClient

Simple AWS client v4 library for the ESP8266.
BSD 3-Clause "New" or "Revised" License
3 stars 5 forks source link

Could this library be used to sign also using `Session Token`? #2

Open MohammedNoureldin opened 3 years ago

MohammedNoureldin commented 3 years ago

Hi,

according to AWSv4 page, in addition to the access key and secret key, we need the session token to sign the requests. However, I see that we cannot use the Session Token in this library. Could you add it please?

polandj commented 3 years ago

Sorry for the delay, it's summer time, so much less time in front of computer.

Can you point me at the AWSv4 documentation? I'll try and take a look. However, I fix probably won't come until fall, as that's when I'll have time to develop and test it.

MohammedNoureldin commented 3 years ago

Thank you @polandj for you reply!

I am not an expert in the logic of signing, but when I changed a python implementation into a dart implementation, there has been a X-Amz-Security-Token value that has to be added to the signed URL. I was not sure how to do that using your library.

It is mentioned here https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html.

Please let me know if I am missing or misunderstood something.

polandj commented 3 years ago

Wow, since the original library is C.  I can’t say where or what would be adding that header…it could be many places.  Did you see this header mentioned in amazon docs anywhere?  Could be they’ve added it since the last time I read their spec.  I’ll keep this open and hope to get back to this in the fall (when kids back in school).