0
nhontran created
- ABP Framework version: v5.2.2
- UI Type: Angular
- Database System: EF Core (SQL Server)
- Auth Server Separated (for Angular): yes
Hi, we are using Identity Server 4 and have a custom claim called 'institution_id,' which we have included in the access token by adding it to the ApiResourcesClaims.
However, this claim does not appear in the id_token, and we need it to be included. Any customization needed to achieve this?
Your help would be greatly appreciated.
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
6 Answer(s)
-
0
hi
You can add a new
Identity Resoucenamedinstitution_id.Add the
institution_idto the request's scopes.options.Scope.Add("institution_id");[UnitOfWork] public virtual async Task SeedAsync(DataSeedContext context) { using (_currentTenant.Change(context?.TenantId)) { await _identityResourceDataSeeder.CreateStandardResourcesAsync(); if (!await _identityResourceRepository.CheckNameExistAsync(SHDPClaimTypes.InstitutionId)) { var institutionIdIdentityResource = new IdentityResource(_guidGenerator.Create(), SHDPClaimTypes.InstitutionId); institutionIdIdentityResource.AddUserClaim(SHDPClaimTypes.InstitutionId); await _identityResourceRepository.InsertAsync(institutionIdIdentityResource); if (await _claimTypeRepository.AnyAsync(SHDPClaimTypes.InstitutionId)) { await _claimTypeRepository.InsertAsync( new IdentityClaimType( _guidGenerator.Create(), SHDPClaimTypes.InstitutionId, isStatic: true ) ); } } await CreateClaimTypesAsync(); await CreateApiResourcesAsync(); await CreateClientsAsync(); } }var commonScopes = new[] { "email", "openid", "profile", "role", "phone", "address", "DigitalPlatform", "institution_id" };Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)








