这是基于vue-vben-admin 模板适用于abp vNext的前端管理项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

4.7 KiB

身份资源管理

**本文档引用的文件** - [IdentityResourceAppService.cs](file://aspnet-core\modules\identityServer\LINGYUN.Abp.IdentityServer.Application\LINGYUN\Abp\IdentityServer\IdentityResources\IdentityResourceAppService.cs) - [IdentityResourceController.cs](file://aspnet-core\modules\identityServer\LINGYUN.Abp.IdentityServer.HttpApi\LINGYUN\Abp\IdentityServer\IdentityResources\IdentityResourceController.cs) - [IIdentityResourceRepository.cs](file://aspnet-core\modules\identityServer\LINGYUN.Abp.IdentityServer.Domain\LINGYUN\Abp\IdentityServer\IdentityResources\IIdentityResourceRepository.cs) - [EfCoreIdentityResourceRepository.cs](file://aspnet-core\modules\identityServer\LINGYUN.Abp.IdentityServer.EntityFrameworkCore\LINGYUN\Abp\IdentityServer\IdentityResources\EfCoreIdentityResourceRepository.cs) - [AbpIdentityServerPermissionDefinitionProvider.cs](file://aspnet-core\modules\identityServer\LINGYUN.Abp.IdentityServer.Application.Contracts\LINGYUN\Abp\IdentityServer\AbpIdentityServerPermissionDefinitionProvider.cs) - [IdentityResourceDto.cs](file://aspnet-core\modules\identityServer\LINGYUN.Abp.IdentityServer.Application.Contracts\LINGYUN\Abp\IdentityServer\IdentityResources\Dto\IdentityResourceDto.cs) - [IdentityResourceCreateOrUpdateDto.cs](file://aspnet-core\modules\identityServer\LINGYUN.Abp.IdentityServer.Application.Contracts\LINGYUN\Abp\IdentityServer\IdentityResources\Dto\IdentityResourceCreateOrUpdateDto.cs) - [CustomIdentityResources.cs](file://aspnet-core\services\LY.MicroService.IdentityServer\IdentityResources\CustomIdentityResources.cs) - [IdentityConsts.cs](file://aspnet-core\modules\identity\LINGYUN.Abp.Identity.Domain.Shared\LINGYUN\Abp\Identity\IdentityConsts.cs)

目录

  1. 简介
  2. 身份资源实体设计
  3. OpenID Connect协议中的身份资源
  4. 内置与自定义身份资源
  5. 身份资源管理API
  6. 声明转换与用户信息过滤
  7. 隐私保护与数据最小化
  8. 结论

简介

身份资源管理子模块是ABP Next Admin系统中用于管理用户身份声明的核心组件。该模块基于OpenID Connect协议,提供了一套完整的身份资源管理机制,支持标准声明和自定义声明的配置与管理。通过身份资源,系统能够精确控制ID令牌中包含的用户信息,实现细粒度的用户数据访问控制。

身份资源管理模块主要包含以下功能:

  • 标准身份声明(如姓名、邮箱、角色)的管理
  • 自定义身份声明的配置与管理
  • 身份资源在OpenID Connect协议中的应用
  • ID令牌中用户信息的控制
  • 内置与自定义身份资源的差异化配置

该模块通过分层架构设计,将应用服务、领域服务和数据访问层分离,确保了代码的可维护性和扩展性。同时,通过权限控制机制,确保只有授权用户才能管理身份资源。

身份资源实体设计

身份资源实体是身份资源管理模块的核心数据结构,用于定义和存储用户身份声明的相关信息。实体设计遵循OpenID Connect协议规范,同时扩展了自定义功能以满足特定业务需求。

身份资源实体包含以下关键属性:

  • 名称(Name):身份资源的唯一标识符,用于在系统中引用该资源
  • 显示名称(DisplayName):用户友好的名称,用于在管理界面显示
  • 描述(Description):对身份资源的详细说明
  • 启用状态(Enabled):标识该资源是否可用
  • 必需(Required):标识该资源是否为必需
  • 强调(Emphasize):标识该资源是否需要特别强调
  • 在发现文档中显示(ShowInDiscoveryDocument):标识该资源是否在发现文档中公开
  • 用户声明(UserClaims):该资源包含的具体声明列表
  • 属性(Properties):资源的附加属性集合
classDiagram
    class IdentityResourceDto {
        +string Name
        +string DisplayName
        +string Description
        +bool Enabled
        +bool Required
        +bool Emphasize
        +bool ShowInDiscoveryDocument
        +List~IdentityResourceClaimDto~ UserClaims
        +List~IdentityResourcePropertyDto~ Properties
    }
    
    class IdentityResourceCreateOrUpdateDto {
        +string Name
        +string DisplayName
        +string Description
        +bool Enabled
        +bool Required
        +bool Emphasize
        +bool ShowInDiscoveryDocument
        +List~IdentityResourceClaimDto~ UserClaims
        +List~IdentityResourcePropertyDto~ Properties
    }