title: Keycloak-admin-client always returns null in springboot
body: <p>I using the keycloak admin client in my app</p>
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.keycloak&lt;/groupId&gt;
          &lt;artifactId&gt;keycloak-admin-client&lt;/artifactId&gt;
          &lt;version&gt;${keycloak.version}&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  <p>and in my code I have:</p>
  <pre><code>package br.com.fabioebner.api.serivce;
  
  import lombok.extern.slf4j.Slf4j;
  import org.keycloak.admin.client.Keycloak;
  import org.keycloak.admin.client.KeycloakBuilder;
  import org.keycloak.admin.client.resource.RealmResource;
  import org.keycloak.representations.idm.ClientRepresentation;
  import org.keycloak.representations.idm.RealmRepresentation;
  import org.keycloak.representations.idm.UserRepresentation;
  import org.springframework.boot.context.event.ApplicationReadyEvent;
  import org.springframework.context.event.EventListener;
  import org.springframework.stereotype.Service;
  
  import java.util.List;
  import java.util.Optional;
  
  @Service
  @Slf4j
  public class KeycloakService {
      private final RealmRepresentation realm;
      private final Keycloak keycloak;
  
      public KeycloakService() {
          this.keycloak = Keycloak.getInstance(
                  &quot;https://myIp/auth/&quot;,
                  &quot;master&quot;,
                  &quot;admin&quot;,
                  &quot;password&quot;,
                  &quot;admin-cli&quot;);
          this.realm = keycloak.realm(&quot;myRealm&quot;).toRepresentation();
      }
  
      @EventListener(ApplicationReadyEvent.class)
      public void addUser(){
          List&lt;UserRepresentation&gt; users = realm.getUsers();
          users.forEach(user -&gt; {
              log.debug(user.getUsername());
          });
      }
  }
  </code></pre>
  <p>Why the <code>realm.getUsers()</code> always returns null??</p>
  <p>if I put <code>realm.getClients()</code> returns null too, but I have users and clients in my realm &quot;myRealm&quot;.</p>