-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Akamai validator #339
Akamai validator #339
Conversation
|
||
using HttpClient httpClient = CreateHttpClient(); | ||
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( | ||
$"EG1-HMAC-SHA256", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EG1-HMAC-SHA256 [](start = 18, length = 15)
I wonder why this header value is named this way? I don't see that we've done any HMAC generation! Where did you find information on how to authenticate for this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know as well.
https://developer.akamai.com/legacy/introduction/Client_Auth.html
In reply to: 601832564 [](ancestors = 601832564)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! you have only done part of the work. :) First you need to create the string that you've created! Then initialize an HMAC 256 signing object using the signing key. This will give you a signature. Then you create a string such as the following to use as the actual authorization header.
Authorization:EG1-HMAC-SHA256 client_token=akaa-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx;
access_token=akaa-xxxxxxxxxxxxxx-xxxxxxxxxxxxxx;timestamp=20130817T02:49:13+0000;
nonce=dd9957e2-4fe5-48ca-8d32-16a772ac6d8f;signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EdgeGrid Request Signature
In reply to: 601834361 [](ancestors = 601834361,601832564)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's code to produce the HMAC. Double-checking your initial string, not sure that it's right! I'll call you.
using (var hmac = new HMACSHA256(Convert.FromBase64String(key)))
In reply to: 601840967 [](ancestors = 601840967,601834361,601832564)
Fixes #338