This is a simple API Key generator that creates API Key when user registers or is created by the admin.
The API key will be put under the user's attributes
as api-key
.
Maven needs to be installed first.
- Run
mvn install
in the directory. - Copy
.jar
file fromtarget
directory into Keycloak'sstandalone/deployments
directory. Keycloak will hot-reload. - It should be done! Now you can try to register or add a user and
check for the
api-key
attribute.
Most of the work here came from zak905's repo. All I did is simplify the example to do only the things that I need which is API key generation on Keycloak (without Docker and the web services).