using IdentityServer4.Extensions; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace IdentityServer4.Models | |
{ | |
/// <summary> | |
/// Models a web API resource. | |
/// </summary> | |
public class ApiResource : Resource |
推荐阅读 New in IdentityServer4: Resource-based Configuration
For RC4 we decided to re-design our configuration object model for resources (formerly known as scopes).
...
Starting with RC4 – the configuration model does not have scope anymore as a top-level concept, but rather identity resources and API resources.
就是看了没理解
@_York: 我觉得就是允许通过api访问的资源
因为我最近也在折腾这个鬼,
new ApiResource("api1", 。。)
的时候,会 new 一个同名的 scope,大概是:new scope("api1")
也就是说这个api资源 默认会在 api1 scopes 资源中。
谢谢 这些鬼净搞些鬼
In the simple case an API has exactly one scope. But there are cases where you might want to sub-divide the functionality of an API, and give different clients access to different parts.
在简单的情况下,API 只需一个作用域。但是,在某些情况下,您可能希望细分 API 功能,并允许不同客户端访问不同的部分。
Ref: https://identityserver4.readthedocs.io/en/release/reference/api_resource.html
谢谢