Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k views
in Technique[技术] by (71.8m points)

c# - ASP.NET Core 3.1 Certificate Authentication in IIS

I am trying to use certificate authentication with ASP.NET Core 3.1. I will be hosting WebAPI in IIS using inprocess model. I looked at the sample code from official docs and tried doing the POC.

https://docs.microsoft.com/en-us/aspnet/core/security/authentication/certauth?view=aspnetcore-3.1

But I am not able to test it out. I have tried it with default certificate as well as custom certificate. I have added the certificate to Personal store. Run netsh commands to add ssl binding using this certificate thumbprint. When I launch the app in debug mode, I can see the site being protected by the appropriate certificate.

However, if I add [Authorize] to individual controller action method or at Controller level, I get 403 error. But I dont see the validate certificate method being triggered. So unable to identify what is the root cause. Please let me know if anyone has a working sample that I could refer to.

Thanks!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...