[keycloak-user] Credentials on create a new user.

Stian Thorgersen sthorger at redhat.com
Mon Mar 7 01:07:32 EST 2016


We'll fix this in the future so you can do a single post with new user,
including credentials and role mappings. For now you'll have to do the two
separate requests though.

On 5 March 2016 at 13:18, Bill Burke <bburke at redhat.com> wrote:

> If you pass in temporary = false in the json rep, then it won't set up the
> required action.
>
>
> On 3/4/2016 9:22 PM, Chris Hairfield wrote:
>
> I've been encountering the same issue with 1.4.0 and 1.6.1 and assume it's
> by design. I believe I've come across past threads confirming this.
>
> My solution is to first create the user, then hit the reset password API,
> and, as a final and optional step, update the user with an empty
> requiredActions array to clear the Update Password action inherent in the
> reset password flow.
>
> Hopefully someone that is more sure can step in to confirm.
>
> On Fri, Mar 4, 2016, 11:38 AM Thiago Leonardo <thiagoleocosta at gmail.com>
> wrote:
>
>> Hi,
>>
>> I'am trying create a new user in admin-client, but the credentials are
>> not saved.
>> The new user is saved normaly. Can you help me ?
>>
>> My code is:
>>
>> Keycloak kc = KeycloakBuilder.builder()
>> .serverUrl(" <http://localhost:8080/auth>http://localhost:8080/auth")
>> .realm("Realm")
>> .username(username)
>> .password(password)
>> .clientId("admin-cli")
>> .resteasyClient( new
>> ResteasyClientBuilder().connectionPoolSize(10).build() )
>> .build();
>>
>> UserRepresentation newUser = new UserRepresentation();
>> newUser.setUsername(user.getEmail());
>> newUser.setFirstName(user.getName());
>> newUser.setEmail(usuario.getEmail());
>> newUser.setEnabled(true);
>>
>> CredentialRepresentation credential = new CredentialRepresentation();
>> credential.setType(CredentialRepresentation.PASSWORD);
>> credential.setValue(user.getEmail());
>> credential.setTemporary(true);
>>
>> newUser.setCredentials(Arrays.asList(credential));
>> kc.realm("Realm").users().create(newUser);
>>
>>
>> Regards,
>>
>> Thiago
>> _______________________________________________
>> keycloak-user mailing list
>> keycloak-user at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/keycloak-user
>
>
>
> _______________________________________________
> keycloak-user mailing listkeycloak-user at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/keycloak-user
>
>
> --
> Bill Burke
> JBoss, a division of Red Hathttp://bill.burkecentral.com
>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160307/b236c6a5/attachment.html 


More information about the keycloak-user mailing list