Hi,
I'm using Keycloak 16 Admin REST API to create users with the createdTimestamp field set to a specific value (I'm importing them from another database). However this field seems to be read-only since when I open the users in Keycloak, the Created At entry shows the date and time of the request and not the value I've set.
Is this a wanted behaviour and is there an alternative way to set this this field other than using SQL? Otherwise my workaround will be to set the field in a custom attribute but I'd prefer not to, if possible.
This is the request I used:
--header 'Content-Type: application/json' \
--data-raw '{
"createdTimestamp": 1640995200000,
"username": "myuser",
"email": "myu...@example.com"
}'
Created At shows: 2/7/22 6:41:50 PM
This is what is stored in Keycloak's database:
keycloak=# select created_timestamp from user_entity where username = 'myuser';
created_timestamp
-------------------
1644255710030
(1 row)
Regards,
Bruno Parmentier