使用IdentityModel的DiscoveryClient
进行GET时,我遇到以下错误:
var discoveryResponse = await DiscoveryClient.GetAsync("https://localhost/IdentityServer");
颁发者名称与认证机构不匹配:https://localhost/identityserver
目标URL是在启用IdentityServer4的IIS上运行的ASP.NET Core Web应用程序。客户端应用程序是在同一台计算机上运行的经典ASP.NET Web应用程序。
显然,根据discoveryResponse.Raw
的内容可以看出,GET确实能够从IdentityServer中检索到值:
{
"issuer": "https://localhost/identityserver",
"jwks_uri": "https://localhost/IdentityServer/.well-known/openid-configuration/jwks",
"authorization_endpoint": "https://localhost/IdentityServer/connect/authorize",
"token_endpoint": "https://localhost/IdentityServer/connect/token",
"userinfo_endpoint": "https://localhost/IdentityServer/connect/userinfo",
"end_session_endpoint": "https://localhost/IdentityServer/connect/endsession",
"check_session_iframe": "https://localhost/IdentityServer/connect/checksession",
"revocation_endpoint": "https://localhost/IdentityServer/connect/revocation",
"introspection_endpoint": "https://localhost/IdentityServer/connect/introspect",
"frontchannel_logout_supported": true,
"frontchannel_logout_session_supported": true,
"scopes_supported": [ "CustomIdentityResources", "profile", "openid", "MyAPI.full_access", "offline_access" ],
"claims_supported": [],
"grant_types_supported": [ "authorization_code", "client_credentials", "refresh_token", "implicit" ],
"response_types_supported": [ "code", "token", "id_token", "id_token token", "code id_token", "code token", "code id_token token" ],
"response_modes_supported": [ "form_post", "query", "fragment" ],
"token_endpoint_auth_methods_supported": [ "client_secret_basic", "client_secret_post" ],
"subject_types_supported": [ "public" ],
"id_token_signing_alg_values_supported": [ "RS256" ],
"code_challenge_methods_supported": [ "plain", "S256" ]
}
issuer
字段的来源时遇到了麻烦。这是从托管应用程序的上下文中派生出来的吗?例如,如果我在名为“IdentityProvider”的应用程序中在IIS中托管IdenityServer端点,则发行者将是https://localhost/identityprovider
(小写)? - Sigurd Garsholhttps
端点的吗?我无法让RequestClientCredentialsAsync
与https
一起工作。 - Ruskin