使用identityserver4按案例配置好server端和client端后,在验证授权登录时候,一直报告此错误
我们看下面代码。按照案例我们要在Config.cs的Client中添加下边的Client
new Client
{
ClientId = "mvc",
ClientSecrets = { new Secret("secret".Sha256()) },
AllowedGrantTypes = GrantTypes.Code,
RedirectUris = {"http://localhost:5000/signin-oidc"},
PostLogoutRedirectUris = { "https://localhost:5000/signout-callback-oidc" },
AllowedScopes = new List<string>
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile
}
}
大家注意到这里两个地址
RedirectUris | 登入地址白名单,api是必须保持一致 |
PostLogoutRedirectUris | 退出地址白名单,api必须保持一直 |
我们看下这两个地址上的域名,这两个域名必须是client 端的域名,对就是要求授权的域名,不是server端的域名,网上很多瞎几把扯的,就是不指正问题核心
本文链接:https://blog.nnwk.net/article/47
有问题请留言。版权所有,转载请在显眼位置处保留文章出处,并留下原文连接
Leave your question and I'll get back to you as soon as I see it. All rights reserved. Please keep the source and links
友情链接:
子卿全栈
全部评论