[keycloak-user] Adding user from Java: Password credential not working

William Drescher [CELUM] William.Drescher at celum.com
Wed Aug 31 05:49:12 EDT 2016


Hi userlist,

I'm attempting to create a user in java in the way described here, from a java application and using the keycloak standalone server

http://www.first8.nl/blog/programmatically-adding-users-in-keycloak/

Specifically

CredentialRepresentation credential = new CredentialRepresentation();
credential.setType(CredentialRepresentation.PASSWORD);
credential.setValue("test123");
UserRepresentation user = new UserRepresentation();
user.setUsername("testuser");
user.setFirstName("Test");
user.setLastName("User");
user.setCredentials(Arrays.asList(credential));
kc.realm("master").users().create(user);

The user is created correctly no errors either java side or in the output from the standalone server and all data seems to be correct however when attempting to login with the user the credentials are incorrect. I've tried changing the password manually on the keycloak server and the login is then possible. Am I missing something or is this a bug?

Thanks,

Will
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160831/f9318e4a/attachment.html 


More information about the keycloak-user mailing list