我想知道有没有人能给我解释一下
AddInMemoryIdentityResources
用于在启动期间注册identity server时。从他们展示的示例来看,它是这样的(注意注释之间的代码):
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())
因为它似乎做同样的事情,但它的全球性,因为它没有联系到任何客户?