Skip to content

Implementation of HMAC based authentication for WebAPI and OWIN

License

Notifications You must be signed in to change notification settings

valdisz/hmac-security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hmac-security

Implementation of HMAC based authentication for WebAPI and OWIN

Usage

HttpClient

string appId = "your application ID";
SecureString secret = "your application SECRET".ToSecureString();
HmacSigningAlgorithm alogrithm = new HmacSigningAlgorithm(sb => new HMACSHA256(sb));

using (HmacClientHandler hmacHandler = new HMACClientHandler(appId, secret, alogrithm))
using (HttpClient client = new HttpClient(hmacHandler))
{
    await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "http://localhost/foo"));
}

OWIN

HmacSigningAlgorithm alogrithm = new HmacSigningAlgorithm(sb => new HMACSHA256(sb));
IAppSecretRepository secretRepo = ...;

app.UseHmacAuthentication(new HmacAuthenticationOptions(alogrithm, secretRepo));

About

Implementation of HMAC based authentication for WebAPI and OWIN

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published