Расширение токена keycloak с помощью пользовательских данныхJAVA

Программисты JAVA общаются здесь
Ответить
Гость
 Расширение токена keycloak с помощью пользовательских данных

Сообщение Гость »


My project works as follows:
  • Keycloak on the internal network for saving users
  • A service that available externally and proxies and supplements requests to Keycloak.

Since the basic information in the token is not enough for me, I use a modified version of the plugin from here where some data that I load by user ID is added to my token in the setClaim method.

Everything was fine, but now I ran into a problem that when requesting https://example.com/realms/realmname/pr ... nect/token
I need to pass some conditional parameters
key1=value1&key2=value2
in addition to the standard fields
client_id=account&grant_type=password&username=example&password=example
and somehow get access to them in the setClaim method.

Currently I emulate this behaviour by setting user attributes before requesting keycloak for token, but this decision is very bad because attributes remains on user forever and affects any next sessions.

I have no idea how to do this and haven't found any information on the internet on how to do it.


Источник: https://stackoverflow.com/questions/781 ... ustom-data
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»