Uploaded image for project: 'RH-SSO'
  1. RH-SSO
  2. RHSSO-206

Admin-client ignores password when creating a user.

XMLWordPrintable

      The following code creates a user without a password.

      Keycloak kc = Keycloak.getInstance(
                      "http://localhost:8180/auth",
                      "master",
                      "admin", "admin",
                      "admin-cli");
      
      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("test").users().create(user);
      

      Please note that required user actions are also ignored - Though I may be missing a configuration in the realm itself.

            Unassigned Unassigned
            mbaluch@redhat.com Marek Baluch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: