0
我有以下配置:某些帶有「Require SSL」參數集的iis上託管的Web應用程序。另外我有基於IdentityServer3的身份驗證服務。IdentityServer3通過來自客戶端請求上下文的Request.ClientCertificate
我需要將身份驗證流中的Web應用程序中的Request.ClientCertificate.SerialNumber傳遞給IdentityServer。
這裏是我的客戶端配置的一部分:
Notifications = new OpenIdConnectAuthenticationNotifications
{
RedirectToIdentityProvider = n =>
{
// if signing in, send certificate parameters
if(n.ProtocolMessage.RequestType == OpenIdConnectRequestType.AuthenticationRequest)
{
// here i would like to get client certificate
var req = n.OwinContext.Request;
// and pass it's serial number to IdentityServer someway
n.ProtocolMessage.AcrValues = req.ClientCertificate.SerialNumber
}
return Task.FromResult(0);
},
}
這可能嗎?我如何獲得當前請求的ClientCertificate?
見https://leastprivilege.com/2013/11/11/client-certificate-authentication-middleware-for-katana/的示例與客戶證書一起工作。 – Tratcher