0
Shanzhi_Chen created
Could I customize the OIDC webapi output of "connect/userinfo"?
When I call this webapi, It only returns a few user info like below.
{
"sub": "92af3c6e-0ea8-a0a1-bbeb-3a0a88b4953e",
"tenantid": null,
"preferred_username": "admin",
"family_name": "Casell",
"given_name": "Ryan",
"email": "xxx@xxx.com",
"email_verified": false,
"phone_number": "5871231234",
"phone_number_verified": false,
"role": [
"admin"
]
}
Is it possible to add other customized claims into it? What I want as follow:
{
"sub": "92af3c6e-0ea8-a0a1-bbeb-3a0a88b4953e",
"tenantid": null,
"preferred_username": "admin",
"family_name": "Casell",
"given_name": "Ryan",
"email": "xxx@xxx.com",
"email_verified": false,
"phone_number": "5871231234",
"phone_number_verified": false,
"role": [
"admin"
]
// Customized User Claims
"on_hold": true,
"sales_rep_id": yyc060
...
...
...
}
3 Answer(s)
-
0
Hi,
Which authserver provider are you using? IdentityServer or Openiddict
-
0
Hi,
Which authserver provider are you using? IdentityServer or Openiddict
Openiddict
-
0
hi
You have to override the
GetUserInfoClaims
method.https://github.com/abpframework/abp/blob/dev/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs#L39