We are currently adding default Keycloak users in the following way:
/opt/jboss/keycloak/bin/add-user-keycloak.sh -r realm-name -u admin@test.com -p admin
However, when I attempt to generate a bearer token like this:
curl --location --request POST 'http://auth.server-name.localhost/auth/realms/realm-name/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username=admin@test.com' \
--data-urlencode 'password=admin' \
--data-urlencode 'client_id=my-clien-id'
I get the following error response:
{"error":"invalid_grant","error_description":"Account is not fully set up"}
From searching I've found this is due to the user email not being verified.
Is there any way that I can verify the user, perhaps by passing an emailVerified
parameter to add-user-keycloak.sh
or something similar?