首页 > 解决方案 > 绕过 oidc-client 中的颁发者检查

问题描述

我们使用 Angular 7 作为前端,使用 .NET Core 3.1 作为后端。对于身份验证,我们在 Angular 上使用 IdentityServer 4 和 oidc-client。

我们需要绕过对 oidc-client 的发行人检查。UserManagerSettings 中有一个名为 userInfoJwtIssuer 的字符串属性,它有 3 种可能性:'ANY'、'OP' 或其他。通过阅读源代码,似乎通过设置'ANY',它应该绕过发行者检查,但没有发生,我们仍然收到来自令牌的发行者与发行者设置不匹配的错误。这是一个oidc客户端的配置

getClientSettings(settings: any): UserManagerSettings {
        return {
            authority: 'https://localhost:8411/backend/api/v1/am-admin/UmmProxy',
            userInfoJwtIssuer: 'ANY',
            client_id: 'someClientId',    
            redirect_uri : 'https://localhost:8411/callback',
            post_logout_redirect_uri : 'https://localhost:8411',
            response_type : 'code',
            client_secret : 'someClientSecret',
            scope : 'openid',
            metadata: {
                issuer: 'https://localhost:8411/backend/api/v1/am-admin/UmmProxy',
                authorization_endpoint: `https://localhost:8411/backend/api/v1/am-admin/UmmProxy/connect/authorize?`,
                token_endpoint: `https://localhost:8411/backend/api/v1/am-admin/UmmProxy/connect/token`,
                end_session_endpoint: `https://localhost:8411/backend/api/v1/am-admin/UmmProxy/connect/checksession`,
                userinfo_endpoint: `https://localhost:8411/backend/api/v1/am-admin/UmmProxy/connect/userinfo`,
                
             }
        };

您对如何让 oidc-client 绕过发行人检查有任何想法吗?

标签: angularoidc-client

解决方案


推荐阅读