An old post. But since I am writing about AuthenticationHandler..this is still relevant!
Another RTM feature I was waiting for is (reasonable) SSL client certificate support in Web API.
Just like all the other authentication methods, you configure client certificate support on the AuthenticationConfiguration object. The following code configures the certificate to chain validation + check for a specific issuer subject name:
Validation modes are:
- Chain validation only
- Peer validation
- Chain validation + issuer certificate thumbprint
- Chain validation + issuer subject name
- Thumbprint only
On the client side, this is the necessary code to include a client certificate with the call:
client.GetAsync(
The code + client sample is in the github repository. Nuget will be updated soon.
Hi Dominick,will you please say,what is mean by signature in token?How can we implement in .net?
Explain.
Token contains claims and signature.I didn’t understand what is mean by signature at developing time.I mean how can we implement and how exactly the certificate will play a role
Hi Dominick,
I am new to ThinkTecture and just want to know that can we use X509 certificates to sign JSON Web token using ThinkTecture ?
You don’t need my library for that. That’s built straight into Microsoft’s JWT handler.
Hi Dominick,
Thanks for your your reply. Can you please share any Sample in which you explain how you are generating Json Web Token using ThinkTecture? Please guide me may be I am wrong. As per my understanding after looking in to your library, you are using ACS internally. You are generating Json Web token using OAuth class. Please suggest any better way to generate Json Web Token using ThinkTecture.
I am not using ACS nor OAuth. You could use the JsonWebTokenHandler class from Thinktecture.IdentityModel. But I really recommend using the Microsoft JWT handler since this supports signing with X.509 certs – and I don’t.
http://msdn.microsoft.com/en-us/library/dn205065.aspx
http://www.cloudidentity.com/blog/2012/11/20/introducing-the-developer-preview-of-the-json-web-token-handler-for-the-microsoft-net-framework-4-5-2/
Hi Dominick,
Thanks for your response and guidance.