我有一个使用隐式流与身份服务器4进行身份验证的应用程序。该应用程序分为两个独立的.net核心应用程序。一个应用程序处理服务于前端的后端和其他手柄。在客户端之间共享访问令牌
后端和前端共享相同的作用域,API名称和权限设置。
我将与第三方进行整合。我们的后端应用程序将调用第三方应用程序。我们需要确保对第三方应用程序的呼叫进行身份验证。我想共享后端应用程序从前端接收到的访问令牌并将其发送给第三方应用程序。我不太确定这样做所需的设置。
我以为我可以添加一个新的客户端到身份服务器,并设置它只有第三方所需的所需范围。但在我的本地测试中,我一直无法得到这个工作。我得到一个错误IDX10804无法从... /。获取配置。well-known/openid-configuration - 发生安全错误。
我的配置是这样的:
new Client
{
ClientId = "thirdPartyClient",
ClientName = "thirdPartyClient",
AllowedGrantTypes = GrantTypes.HybridAndClientCredentials,
ClientSecrets =
{
new Secret("secret".Sha256())
},
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email
},
AllowOfflineAccess = true,
AllowAccessTokensViaBrowser = true,
RequireConsent = false
},
new Client
{
ClientId = "myapplication",
ClientName = "myapplication",
AllowedGrantTypes = GrantTypes.Implicit,
ClientSecrets =
{
new Secret("secret".Sha256())
},
RedirectUris = { "https://.../callback.html" },
PostLogoutRedirectUris = { "https://.../index.html"
AllowedCorsOrigins = { "https://..." },
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
IdentityServerConstants.StandardScopes.Address,
"myscope",
},
AllowOfflineAccess = true,
AllowAccessTokensViaBrowser = true,
RequireConsent = false
}
我要对这个正确的方式?
这是什么状态? – MJK