Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Max size of custom user attribute in keycloak

What is the max size of a custom user attribute in KeyCloak? The official doc only describes how to create such attributes. If the size is limmited to 255 characters as default size of the string in a database then is there an ability to configure this size not modifying the source code?

like image 858
Kirill Liubun Avatar asked Jan 31 '23 02:01

Kirill Liubun


1 Answers

Keycloak's attribute values maximum length is defined by its backend storage. The default setup uses PostgreSQL. Custom user attributes are stored in user_attribute table, which has value of type varchar(255).

You may want to change the field type to text. Please make sure to backup your database first.

ALTER TABLE user_attribute ALTER COLUMN value TYPE TEXT;

like image 186
Serge Yefimov Avatar answered Feb 12 '23 22:02

Serge Yefimov