SimpleIdServer icon indicating copy to clipboard operation
SimpleIdServer copied to clipboard

Dotnet template: Admin website can not add profile mapper

Open littlesmilelove opened this issue 8 months ago • 4 comments

Image The add mapper dialog show nothing. What I want to do is add userId and realm info to profile, so I can include these infos in access token, how can I achieve this?

littlesmilelove avatar Jun 12 '25 03:06 littlesmilelove

I think add password page also have a bug like this @simpleidserver

Image

littlesmilelove avatar Jun 12 '25 09:06 littlesmilelove

Both issues are fixed in the release/v6.0.3 branch :). There were some missing using statements.

simpleidserver avatar Jun 12 '25 15:06 simpleidserver

When will version 6.0.3 be released? And before that, if I want to get the userId and realm in the access token, is modifying it through an API the only way? @simpleidserver

littlesmilelove avatar Jun 13 '25 02:06 littlesmilelove

Hello @littlesmilelove,

First of all, sorry — I didn’t notice your latest question. :(

Yes, it’s possible to include the userId in the access token by updating the mapping rules of a scope:

  1. Edit an OpenID scope, for example profile, and navigate to the Mappers tab.
  2. Click on the Add mapper button.
  3. In the popup, select the Property option and click Next.
  4. Fill in the form with the following values and click Save to add the mapping rule:
Property Value Description
Name userId Unique name of the mapping rule
Token Claim Name userId Name of the claim to be added in the identity/access token
Claim JSON Type STRING Type of the JSON element
User Property Id Property from the user object (e.g., Id, Email, etc.)
Include in Access Token true Ensures the claim is included in the access token

At the moment, it's not possible to include the realm in the access token unless you implement custom classes.

That said, the iss (issuer) claim in the access token already contains the realm information — isn't that sufficient for your needs?

KR,

SID

simpleidserver avatar Jul 20 '25 20:07 simpleidserver