[keycloak-user] Clarify "Create a new client" via Admin REST API

Juraj Janosik juraj.janosik77 at gmail.com
Thu Nov 12 04:32:58 EST 2015


Hi,
I want to clarify the "Create a new client" via REST API
especially for body parameter "id" from "ClientRepresentation".
If I set the parameter "id" in the request body (see example below),
the value is set to the client. No new id value is generated for the
client, which is the typically behavior of "Create a new role for the realm
or client
<http://keycloak.github.io/docs/rest-api/index.html#_create_a_new_role_for_the_realm_or_client>"
and "Create a new user
<http://keycloak.github.io/docs/rest-api/index.html#_create_a_new_user>".
Is this a correct behavior?

Tested data example:
"Create Client":
"method":"POST","url":"<URL>:<PORT>/auth/admin/realms/<REALM>/clients"
"body":
"{
"id":"3",
"clientId":"testclient-3",
"name": "testclient-3",
"description": "TESTCLIENT-3",
"enabled": true,
"redirectUris":[ "\\" ],
"publicClient": true
}"
"headers":
[["Content-Type","application/json"],
["Authorization","Bearer <ACCESS_TOKEN>]]

Output for GET clients looks like:
 {
        "*id": "3"*,
        "clientId": "testclient-3",
        "name": "testclient-3",
        "description": "TESTCLIENT-3",
        "surrogateAuthRequired": false,
        "enabled": true,
        "clientAuthenticatorType": "client-secret",
        "redirectUris":
        [
            "\"
        ],
        "webOrigins":
        [
        ],
        "notBefore": 0,
        "bearerOnly": false,
        "consentRequired": false,
        "serviceAccountsEnabled": false,
        "directGrantsOnly": false,
        "publicClient": true,
        "frontchannelLogout": false,
        "attributes":
        {
        },
...

Thanks a lot.

Best Regards,
Juraj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20151112/bd6c1251/attachment.html 


More information about the keycloak-user mailing list