【发布时间】:2019-09-25 12:51:33
【问题描述】:
我正在为我的 Angular 应用程序使用 angular-auth-oidc-client 包。我已经在 Identity Server 3 中使用了很长时间,并且在使用隐式流时它运行良好。但是当尝试在 Identity Server 4 上使用 PKCE 的身份验证代码流时,我无法让它工作。
我的身份验证服务器客户端配置如下:
new Client
{
ClientId = "My.Angular.App",
// no interactive user, use the clientid/secret for authentication
AllowedGrantTypes = GrantTypes.Code,
// secret for authentication
ClientSecrets = new List<Secret> { ... },
RedirectUris = new List<string> { ... },
AllowedScopes = new List<string> { ... },
}
angular-auth-oidc-client的配置如下:
{
"stsServer": "https://auth2.test.hsahealthplan.com",
"redirect_url": "...",
"client_id": "My.Angular.app",
"response_type": "code",
"scope": "...",
"post_logout_redirect_uri": "...",
"start_checksession": false,
"silent_renew": true,
"silent_renew_url": "...",
"post_login_route": "...",
"forbidden_route": "...",
"unauthorized_route": "...",
"log_console_warning_active": true,
"log_console_debug_active": false,
"max_id_token_iat_offset_allowed_in_seconds": 300
}
当我在本地运行 Identity Server 4 并将 stsServer 设置为 https://localhost:5000 时:
当我在本地运行 Identity Server 4 并将 stsServer 设置为 http://localhost:5000 时:
当我尝试使用真正的身份验证服务器进行身份验证时,我们有其他应用程序正在使用该服务器进行身份验证:
我不确定为什么我从身份验证服务器收到错误代码 405,或者为什么它在本地也不起作用。如果有人有任何建议,将不胜感激。
【问题讨论】: