У меня есть следующая конфигурация: некоторое веб-приложение с размещенным на iis с параметром «Требовать SSL». Также у меня есть служба аутентификации на основе IdentityServer3.IdentityServer3 pass Request.ClientCertificate из контекста запроса клиента
Мне нужно передать 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