<div dir="ltr">Hello,<div><br></div><div>I created: <a href="https://issues.jboss.org/browse/KEYCLOAK-2343">https://issues.jboss.org/browse/KEYCLOAK-2343</a> to track this.</div><div><br></div><div>Cheers,</div><div>Thomas</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-19 10:15 GMT+01:00 Thomas Darimont <span dir="ltr">&lt;<a href="mailto:thomas.darimont@googlemail.com" target="_blank">thomas.darimont@googlemail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Okay, how about offering a new search method that accepts s UserSearch DTO that would hold the attributes to search by </div><div>as well as a &quot;match mode&quot;. Could also be used to specify pagination.</div><div><br></div><div>This could also be send via a @POST in order to avoid retaining userdata like usernames, email addresses etc. in </div><div>access logs...</div><div><br></div><div>Alternatively you could introduce a searchExact(..) method with the same parameterization as the existing search method.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-01-19 10:07 GMT+01:00 Stian Thorgersen <span dir="ltr">&lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It was by design, but it wasn&#39;t a good design. Would be better to make it match exact, but allow including a wildcard to make it fuzzy.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On 19 January 2016 at 09:58, Thomas Darimont <span dir="ltr">&lt;<a href="mailto:thomas.darimont@googlemail.com" target="_blank">thomas.darimont@googlemail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>Hi,</div><div><br></div><div>I was looking for a way to query users based on their exact username but it turned out, that</div><div>  org.keycloak.admin.client.resource.UsersResource.search(String, String, String, String, Integer, Integer)</div><div><br></div><div>  @GET</div><div>  @Produces(MediaType.APPLICATION_JSON)</div><div>  List&lt;UserRepresentation&gt; search(@QueryParam(&quot;username&quot;) String username,</div><div>                                       @QueryParam(&quot;firstName&quot;) String firstName,</div><div>                                       @QueryParam(&quot;lastName&quot;) String lastName,</div><div>                                       @QueryParam(&quot;email&quot;) String email,</div><div>                                       @QueryParam(&quot;first&quot;) Integer firstResult,</div><div>                                       @QueryParam(&quot;max&quot;) Integer maxResults);</div><div><br></div><div>  ...</div><div>  usersResource.search(&quot;exactusername&quot;,null,null, null, null, email, 0, 10)</div><div><br></div><div>generates a like %..% query in JpaUserProvider.searchForUserByAttributes(...).</div><div><br></div><div>Since usernames are unique per realm I think it would make sense to be able to perform a</div><div>query for the exact username (or perhaps the combination of other attributes as well).</div><div><br></div><div>Was this omitted by design, or may I create a JIRA for this?</div><div><br></div><div>Cheers,</div><div>Thomas</div></div>
<br></div></div>_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>