Open Closed

how can I add some data to AccessToken JWT'data? #2905


User avatar
0
abllyboy created
  • ABP Framework version: v5.2.0
  • UI type: MVC r
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
  • Step1 I added my ClaimsPrincipalFactory in *.IdentityServer and added a claim named 'organizeName' like below
  • Step2 And also I added organizeName in the "Identity resources" like below:
  • Step3 Then I can found organizeName by CurrentUser.GetAllClaims() like below:
  • Step4 And also add identity resources "organizeName" to Client "Infrastructure_App", like below:
  • Step5And then I use Postman to get token, but the returned access_token' data don't contains my "organizeName" property.
  • So how can I add organizeName to JWT's data?
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    1
    liangshiwei created
    Fullstack Developer

    Hi,

    Try:

    Configure<AbpClaimsServiceOptions>(options=>
    {
        options.RequestedClaims.Add(claimName...)
    })
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    abllyboy created

    It works,YYDS

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.