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

Bill Burke bburke at redhat.com
Sat Mar 5 07:18:21 EST 2016


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 <mailto: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")
>     .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 <mailto:keycloak-user at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/keycloak-user
>
>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160305/07a6bb0a/attachment.html 


More information about the keycloak-user mailing list