Hi there!
I would like to create a new user in the realm “foo” with the Java admin client library.
My connection code looks like this:
val keycloak = Keycloak.getInstance(authServerUrl, "foo", clientId, accessToken)
I have not understood what value should I use for the access token. So I tried two values:
- JWT access token of the frontend user, with a bearer only client - this results in 403
- secret of a confidential client - this results in 401
How is this intended to work? Should I use the master realm, with the security-admin-console client, and then use the “foo” realm when creating the user, like so:
val response = keycloak.realm(keyCloakConfig.realm).users().create(keyCloakUser)