【发布时间】:2017-01-13 01:32:39
【问题描述】:
我正在使用 IdentityServer3 开发一个身份验证/授权服务器,到目前为止一切正常。
我正在尝试通过 X509Certificate 而不是示例中的散列密钥来验证混合流客户端。
我的问题是:如何配置客户端应用程序以发送认证流程的证书?
我在X509CertificateSecretParser.cs 的源代码中看到,为了获取客户端证书,owin 环境变量“ssl.ClientCertificate”必须有一个值,但我找不到这个值的设置位置,即使在 Microsoft。 Owin源代码。
我也尝试使用我在服务器上加载的证书作为客户端应用程序的 SSL 证书,但这也不起作用。
设置客户端密码的代码:
[my client].ClientSecrets.Add(new Secret
{
Value = Convert.ToBase64String(cert.Export(X509ContentType.Cert)),
Type = Constants.SecretTypes.X509CertificateBase64
});
客户端应用程序的设置去验证代码:
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
Authority = ...,
Scope = ...,
ClientId = ...,
RedirectUri = ...,
ResponseType = "code id_token token",
ClientSecret = "" , //What should I do with this?
SignInAsAuthenticationType = "Cookies",
Notifications = new OpenIdConnectAuthenticationNotifications
{
RedirectToIdentityProvider = ...,
AuthorizationCodeReceived = ...
}
});
【问题讨论】:
标签: c# asp.net-mvc oauth-2.0 identityserver3 openid-connect