[keycloak-dev] Possible BUG creating User via REST API
sblanc at redhat.com
Fri Sep 30 03:13:51 EDT 2016
Hard to tell without seeing whole your code but when you create your user
you don't have this issue, right ? Do you do the reset in the same "flow"
of code ?
On Thu, Sep 29, 2016 at 10:36 PM, Maurício Giacomini Penteado <
mauriciogiacomini at hotmail.com> wrote:
> Hi Sebastien, thanks for answering.
> Sorry, my last message was not complete.
> I am trying your code but I always got a "Failed executing GET
> /admin/realms/SGCD/users: org.jboss.resteasy.spi.UnauthorizedException:
> I tryed set the Bearer Token using the code that follows (but I do not
> have successful):
> ResteasyClient resteasyClient = new ResteasyClientBuilder()
> Keycloak kc = KeycloakBuilder.builder()
> Please, you know if Is there some way for I put my bearer token on call
> of resetPassword or on build of KeycloakBuilder?
> *De:* Sebastien Blanc <sblanc at redhat.com>
> *Enviado:* quinta-feira, 29 de setembro de 2016 14:08
> *Para:* Maurício Giacomini Penteado
> *Assunto:* Re: [keycloak-dev] Possible BUG creating User via REST API
> Hi Mauricio,
> This is not a bug, you need to reset the password after that the user has
> been created, using something like :
> CredentialRepresentation credentials = new CredentialRepresentation();
> On Thu, Sep 29, 2016 at 3:51 PM, Maurício Giacomini Penteado <
> mauriciogiacomini at hotmail.com> wrote:
>> Hello everybody,
>> All times that I create an user via REST API I have to do login on
>> keycloak using administrator account and have to update the credentials
>> from user created via REST API with temporary password setted to false.
>> Just if I do these procedures I can do login on my app using the user
>> created via REST API.
>> I am using the follow code to create an user via REST API:
>> CredentialRepresentation credential = new
>> UserRepresentation user = new UserRepresentation();
>> Response result = kc.realm("rest-example").users().create(user);
>> I have setted on code false for temporary credential and user as enabled,
>> even so, I can not do login on my application using the created user
>> without do the procedures that I wrote at the beginning of this issue.
>> I think that REST API is not respecting the properties of temporary
>> credential setted to false and user setted as enabled. It can be a BUG?
>> If anybody knows how can I update the credentials from a new user created
>> via REST API leaving it able to do login on my application please let me
>> keycloak-dev mailing list
>> keycloak-dev at lists.jboss.org
More information about the keycloak-dev