Mapping keycloak user's attribute into Jupyterhub

Dear all,
I have deployed Jupyterhub with Keycloak authentication and dockerspawner. I would like to define a set of attributes for my users in Keycloak and based on them change my Jupyter environment.
I would like to know if anyone has had experience with mapping user’s attributes defined in Keycloak into Jupyterhub?
Thanks in advance for your feedbacks.

#jupyterhub #keycloak #dockerspawner

I understand it’s been several years since this was posted, but it’s still actual for me.

Replying with a solution:

async def options_form(self, spawner):
          user = await self.user.get_auth_state()
          profile = user['oauth_user']
          def_form = self._options_form_default();
          return def_form

In the profile, you will find all the fields in the token.