<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">I think it should be same consistent
      behaviour on all places. Probably we should make it to what is
      used for clients (id is allowed) and improve realms and users to
      allow it too.<br>
      <br>
      Feel free to create JIRA for this.<br>
      <br>
      Marek<br>
      <br>
      On 10/12/15 14:24, Juraj Janosik wrote:<br>
    </div>
    <blockquote
cite="mid:CALQqei3QWgwMBmb6vKe09w0zEnwE-CrxhTiTwRUfN-HVVaskAg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Hi all,<br>
            <br>
          </div>
          please, could somebody clarify issue (see bottom of the mail)
          discovered in version 1.6.1.Final?<br>
          The same behavior is detected in version 1.7.0.Final.<br>
          <br>
        </div>
        <div>This behavior differs from a Create a New User where the
          JSON body parameter "id" is skipped.<br>
        </div>
        <div><br>
          Thanks a lot.<br>
          <br>
        </div>
        <div>Best regards,<br>
        </div>
        <div>Juraj<br>
        </div>
        <div>
          <div>
            <div>
              <div class="gmail_extra"><br>
                <div class="gmail_quote">2015-11-12 10:32 GMT+01:00
                  Juraj Janosik <span dir="ltr">&lt;<a
                      moz-do-not-send="true"
                      href="mailto:juraj.janosik77@gmail.com"
                      target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:juraj.janosik77@gmail.com">juraj.janosik77@gmail.com</a></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>
                        <div>
                          <div>
                            <div>Hi,<br>
                            </div>
                            I want to clarify the "Create a new client"
                            via REST API <br>
                            especially for body parameter "id" from
                            "ClientRepresentation".<br>
                          </div>
                        </div>
                        If I set the parameter "id" in the request body
                        (see example below), <br>
                        the value is set to the client. No new id value
                        is generated for the client, which is the
                        typically behavior of "<a moz-do-not-send="true"
href="http://keycloak.github.io/docs/rest-api/index.html#_create_a_new_role_for_the_realm_or_client"
                          target="_blank">Create a new role for the
                          realm or client</a>" and "<a
                          moz-do-not-send="true"
href="http://keycloak.github.io/docs/rest-api/index.html#_create_a_new_user"
                          target="_blank">Create a new user</a>".<br>
                      </div>
                      <div>Is this a correct behavior?<br>
                      </div>
                      <div><br>
                        Tested data example:<br>
                        "Create Client":<br>
"method":"POST","url":"&lt;URL&gt;:&lt;PORT&gt;/auth/admin/realms/&lt;REALM&gt;/clients"<br>
                      </div>
                      <div>"body":<br>
                        "{<br>
                        "id":"3",<br>
                        "clientId":"testclient-3",<br>
                        "name": "testclient-3",<br>
                        "description": "TESTCLIENT-3",<br>
                        "enabled": true,<br>
                        "redirectUris":[ "\\" ],<br>
                        "publicClient": true<br>
                        }"<br>
                      </div>
                      <div>"headers":<br>
                        [["Content-Type","application/json"],<br>
                        ["Authorization","Bearer &lt;ACCESS_TOKEN&gt;]]<br>
                        <br>
                        Output for GET clients looks like:<br>
                         {<br>
                                "<b>id": "3"</b>,<br>
                                "clientId": "testclient-3",<br>
                                "name": "testclient-3",<br>
                                "description": "TESTCLIENT-3",<br>
                                "surrogateAuthRequired": false,<br>
                                "enabled": true,<br>
                                "clientAuthenticatorType":
                        "client-secret",<br>
                                "redirectUris":<br>
                                [<br>
                                    "\"<br>
                                ],<br>
                                "webOrigins":<br>
                                [<br>
                                ],<br>
                                "notBefore": 0,<br>
                                "bearerOnly": false,<br>
                                "consentRequired": false,<br>
                                "serviceAccountsEnabled": false,<br>
                                "directGrantsOnly": false,<br>
                                "publicClient": true,<br>
                                "frontchannelLogout": false,<br>
                                "attributes":<br>
                                {<br>
                                },<br>
                        ...<br>
                        <br>
                        Thanks a lot.<br>
                        <br>
                      </div>
                      <div>Best Regards,<br>
                      </div>
                      <div>Juraj<br>
                      </div>
                      <div><br>
                      </div>
                      <div>
                        <div>
                          <div><br>
                          </div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                </div>
                <br>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
    </blockquote>
    <br>
  </body>
</html>