can i create a user for only 24h in Keycloak?
- User
can i create a user for only 24h in Keycloak?
Assistant
Yes, you can create a user in Keycloak that is only valid for 24 hours. To do this, you can use the "expiration" property when creating the user. This property allows you to specify a date and time after which the user will no longer be valid.
Here's an example of how you can create a user with an expiration date of 24 hours from the time of creation:
curl -X POST -H 'Content-Type: application/json' \ -d '{ "username": "user-name", "password": "password", "enabled": true, "email": "user@example.com", "expiration": "2022-02-12T12:00:00.000Z" }' \ http://localhost:8080/auth/admin/realms/my-realm/usersIn this example, the expiration property is set to "2022-02-12T12:00:00.000Z", which represents the date and time 24 hours from the current time.
Note that the expiration property is only valid for users created through the REST API. If you are using Keycloak's web console to create users, you will need to set the expiration property manually after the user is created.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.