0

如果令牌请求验证器返回 false,IdentityServer 返回 401。它返回一条错误消息。

使用 angular-auth-oidc-client,响应类型是代码,从 SPA 重定向到授权并重定向到 /unauthorized,在控制台日志中,它说

angular-auth-oidc-client.mjs:193 
    
[ERROR] 0-app-name - OidcService code request https://localhost:44379 () => new Error(error)

错误消息是真的:

error: "Cross login error"
error_description: "Cannot access to App due to policy"

如何从我的应用程序中捕获该错误,目前我没有看到任何可以支持该错误的 angular-auth-oidc-client 的公共 API。捕获错误的原因是我想在 /unauthorized 页面上显示错误消息

4

0 回答 0