Skip to content

ifbaltics/hmac-security

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 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(inspector, 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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%