Search code examples
keycloakkeycloak-services

Keycloak Phase Two Organization Attribute in Token and Introspection


I was trying to use the attribute functionality of Organization in Keycloak PhaseTwo. But now i have to add some of the parameters in attribute in token, not all the attribute.

This is how added organization attribute in token,

enter image description here

Below is an example of the attribute added.

enter image description here

And with token i am getting all the information

  "feature": {
    "e0ee6577-1310-4335-9ea0-16dda0f5178b": {
      "name": "ASTER",
      "attributes": {
        "subId": [
          "test"
        ],
        "expiryDate": [
          "2023-12-31"
        ],
        "feature": [
          "{\"feature1\":\"on\",\"feature2\":\"off\"}"
        ],
        "subscriptionStatus": [
          "active"
        ]
      }
    }
  },

I just need to add expiryDate and feature (and feature should be JSON not string),in the token. Is there any way to add attributes like that?


Solution

  • I have a merged PR for this issue in GIT.

    I have added a new mapper, "Organization Specific Attribute", which will add the attribute matching claim name, just as the user attribute.

    enter image description here