mrsheepuk / ASPNETSelfCreatedTokenAuthExample

Example of how to protect an ASP.NET Core (1.0.1) Web API using simple self-created JWT bearer tokens.
http://stackoverflow.com/a/33217122/789529
173 stars 64 forks source link

HMAC-SHA signing with secret #8

Closed bragma closed 8 years ago

bragma commented 8 years ago

Hi, thanks again for this excellent demo. I am trying to reduce the size of generated JWT tokens. At the moment, signature is more than 3 times the size of the payload. I think using HMACSHA256 signature with secret key could reduce the global token size. I've tried to use it instead of RSA, but failed. Could you please improve your demo with this signing method? Thanks a lot!

mrsheepuk commented 8 years ago

I don't have the need for this myself, but if you can work out how to do it as an optional feature I'd be happy to receive a pull request to add that functionality in to this demo.