首页 新闻 会员 周边

IdentityServer4的ApiResource 是个啥 一直没理解

0
悬赏园豆:10 [已解决问题] 解决于 2018-04-09 11:08
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
_York的主页 _York | 初学一级 | 园豆:3
提问于:2018-01-18 17:15
< >
分享
最佳答案
0

推荐阅读 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.

收获园豆:10
dudu | 高人七级 |园豆:30943 | 2018-01-18 17:26

就是看了没理解

_York | 园豆:3 (初学一级) | 2018-01-19 09:04

@_York: 我觉得就是允许通过api访问的资源

dudu | 园豆:30943 (高人七级) | 2018-01-19 09:38
其他回答(2)
0

因为我最近也在折腾这个鬼,

 new ApiResource("api1", 。。)

的时候,会 new 一个同名的 scope,大概是:new scope("api1")

也就是说这个api资源 默认会在 api1 scopes 资源中。

放逐人 | 园豆:694 (小虾三级) | 2018-08-23 16:35

谢谢 这些鬼净搞些鬼

支持(0) 反对(0) _York | 园豆:3 (初学一级) | 2018-08-23 16:53
1

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

唯梦永恒 | 园豆:202 (菜鸟二级) | 2018-10-22 19:21

谢谢

支持(0) 反对(0) _York | 园豆:3 (初学一级) | 2018-10-23 09:24
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册