# Claim to group with URL as key

**URL:** <https://forum.keycloak.org/t/claim-to-group-with-url-as-key/16694>\
**Category:** Getting advice\
**Created:** [July 31, 2022, 3:59pm UTC](https://forum.keycloak.org/t/claim-to-group-with-url-as-key/16694 "2022-07-31T15:59:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arnaud-F](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/arnaud-f/32/6188_2.png) [@Arnaud-F](https://forum.keycloak.org/u/Arnaud-F)\
**Post date:** [July 31, 2022, 3:59pm UTC](https://forum.keycloak.org/t/claim-to-group-with-url-as-key/16694/1 "2022-07-31T15:59:38Z")

</div>

Hello

Having Keycloak v18 using a company IdP that is sending claims with an URL as key:

```auto
"User Profile JSON Data for provider auth0":{
   "http://schemas.microsoft.com/ws/2008/06/identity/claims/role":[
      "SG_GR_Business",
      "SG_GR_Managers",
      "LOM",
      "SG_Corporate"
   ]
}

```

I try to map those claims to groups or roles without success.  
What I tried so far:

- `http://schemas.microsoft.com/ws/2008/06/identity/claims/role`
- `http://schemas\.microsoft\.com/ws/2008/06/identity/claims/role`

If you have any idea on how to solve this, would be much appreciated.

Thankd

---

<div class="post-metadata">

**Author:** ![weltonrodrigo](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/weltonrodrigo/32/3104_2.png) [@weltonrodrigo](https://forum.keycloak.org/u/weltonrodrigo)\
**Post date:** [August 2, 2022, 3:25pm UTC](https://forum.keycloak.org/t/claim-to-group-with-url-as-key/16694/2 "2022-08-02T15:25:03Z")

</div>

I suppose this is the code splitting your claim name. Maybe you can convince it to accept the url as one "level’:

[https://github.com/keycloak-poc/keycloak/blob/ecbfedb131d24ca9f5c0cec6d31d2d02a70b25f8/server-spi-private/src/main/java/org/keycloak/utils/JsonUtils.java#L43](https://github.com/keycloak-poc/keycloak/blob/ecbfedb131d24ca9f5c0cec6d31d2d02a70b25f8/server-spi-private/src/main/java/org/keycloak/utils/JsonUtils.java#L43)

Not sure if the

> [@Arnaud-F](#):
>
> `"User Profile JSON Data for provider auth0"`

is part of the json object or it’s just you explaining it. If that is part of the json, you need to give the full “path” like:

`User Profile JSON Data for provider auth0.http://schemas\.microsoft\.com/ws/2008/06/identity/claims/role`

---

<div class="post-metadata">

**Author:** ![Arnaud-F](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/arnaud-f/32/6188_2.png) [@Arnaud-F](https://forum.keycloak.org/u/Arnaud-F)\
**Post date:** [August 2, 2022, 4:14pm UTC](https://forum.keycloak.org/t/claim-to-group-with-url-as-key/16694/3 "2022-08-02T16:14:47Z")

</div>

“User Profile JSON Data for provider auth0” is not part of the path, it is the text found in the log file of Keycloak.

The claim name only contains the URL so far and as I am not a Java guy I do not understand how to exploit the piece of code in order to convince Keycloak to deal the claim “as is”.
