我想知道是否有人能向我解释在启动期间注册身份服务器时AddInMemoryIdentityResources是用来做什么的。从他们展示的例子中可以看出如下所示(注意注释之间的代码):
services.AddIdentityServer()
.AddDeveloperSigningCredential()
.AddInMemoryPersistedGrants()
//********************
.AddInMemoryIdentityResources(Config.GetIdentityResources())
//********************
.AddInMemoryApiResources(configurationManager.GetApiResources())
.AddInMemoryClients(configurationManager.GetClients())
.AddAspNetIdentity<User>();然后配置文件如下所示:
public static IEnumerable<IdentityResource> GetIdentityResources()
{
return new List<IdentityResource>
{
new IdentityResources.OpenId(),
new IdentityResources.Profile(),
};
}现在,我想当您声明一个客户端时,您定义的范围基本上是允许您传递用户名、id等的范围。然而,这个声明的意义是什么-- .AddInMemoryIdentityResources(Config.GetIdentityResources())似乎在做同样的事情,但它的全局性,因为它不与任何客户端绑定?
发布于 2018-11-12 11:59:46
AddInMemoryIdentityResources基本上定义了可用标识作用域的全局列表。即客户可以引用的主列表。
https://stackoverflow.com/questions/53252389
复制相似问题