Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to add custom attributes in Keycloak via REST API?

Tags:

keycloak

How to add custom attributes in Keycloak via REST API?

like image 490
Coder Avatar asked Dec 21 '18 10:12

Coder


People also ask

How do I add a custom field to the Keycloak registration page?

phone as an identifier to your new input field and setting it's value to a Freemarker template variable (check also the label for field). Add this to your template and activate your custom theme from the Keycloak administration interface. The field should now appear in your registration form.

What are Keycloak attributes?

Keycloak is a third-party authorization server that manages users of our web or mobile applications. It offers some default attributes, such as first name, last name, and email to be stored for any given user.

What are roles in Keycloak?

Keycloak roles are defined in a dedicated namespace so that all users with the same roles have identical permissions in that namespace. In other words, realm-level roles are a global namespace for a given realm, while client roles are namespaces intended for specific applications.


1 Answers

I guess you mean adding user attributes to the admin console by extending the theme - https://www.keycloak.org/docs/3.1/server_development/topics/custom-attributes.html Since that configures the admin console itself it does involve some configuration of files loaded by the keycloak app for a custom theme so I don't think the REST API alone will be enough.

As @Xtreme Biker points out, anything you can do via clicks in the admin console you can do via the REST API as the console uses that API. You can perform the relevant actions in the admin console and check the network tab in the browser console to see what the REST calls are (note you may need to tell your browser not to clear the log between page loads). So if you can do it just with clicks in the browser then the REST API is enough. If you also need to modify configuration files then you'll need to do that part outside of the REST API.

like image 174
Ryan Dawson Avatar answered Oct 05 '22 05:10

Ryan Dawson