Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialagreatdaytocode
24,757 PointsAuthentication Request
Anyone have an experience working with Authentication request?
I am working with a custom API that requires a keyed-hashed based message authentication code (HMAC) signature for authentication. This HMAC signature must be calculated using the SHA-256 hash function. All requests must be sent over HTTPS.
Each request must include the following HTTP headers for authentication:
Authorization: TC<AccessID>:<Base64 Encoded Signature> Timestamp: <Unix format timestamp in GMT seconds>
Any help is appreciated.
2 Answers
Sam Soffes
Treehouse Guest TeacherIf you have control over the API, I'd recommend switching to OAuth 2.0 since it makes things a lot simpler. 1.0 used HMAC and was a huge pain to work with.
If you can't change the API, I have some code that may help. Here's an HMAC method you can use. Hope that helps!
agreatdaytocode
24,757 PointsSam the Photo Bombers course is really helping on this project. I am learning a lot. I would be willing to share more about the project with you offline from the forums. Just email me at aaronatMav3r1ck.com
Thanks again for the help!
agreatdaytocode
24,757 Pointsagreatdaytocode
24,757 PointsWhat would be the best way to setup headers and how do I include that into the url request?