[keycloak-user] Admin CLI - how to a a builtin protocol Mapper to a Client

Bruce Smith bruceesmith at gmail.com
Mon Sep 9 19:08:00 EDT 2019


Thank you Pedro.

I had experimented with "--file" to no avail, however I read your OpenShift
examples and they are most helpful.

For anyone who reads this thread in the future, here is my updated process
for using the Admin CLI to add a builtin protocol mapper to a client:
- use the Admin GUI to create a dummy client and add the builtin protocol
mapper to it
- use the Admin CLI to get a JSON version of that dummy client, then delete
the dummy client
- edit the JSON to suit requirements
- use "kdadm.sh create clients --target-realm your-realm --file
your-edited-JSON" in your scripts to add the actual client(s)

Regards
Bruce

On Mon, 9 Sep 2019 at 23:25, Pedro Igor Silva <psilva at redhat.com> wrote:

> Hi,
>
> Some time ago we did some work for integrating Keycloak with Openshift so
> that we had to use Admin CLI a lot in order to create/configure things more
> dynamically.
>
> You may want to have a look here
> https://github.com/keycloak/openshift-integration/blob/master/configure-keycloak#L57.
> Note that the CLI allows you to pass a full JSON with your client settings.
> In that example, we are creating a client and setting an
> user-property-mapper
> https://github.com/keycloak/openshift-integration/blob/master/kc-client-openshift-cli.json
> .
>
> Regards.
> Pedro Igor
>
> On Mon, Sep 9, 2019 at 10:07 AM Bruce Smith <bruceesmith at gmail.com> wrote:
>
>> Hi
>>
>> I am trying to add the built-in protocol mapper "realm roles" to a client
>> using the Admin CLI. I must have tried 500 syntactic combinations for the
>> "--set" parameter; they all result in either no error (but no mapper added
>> to the client), or a Java exception
>> (com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot
>> deserialize instance of `java.util.ArrayList` out of VALUE_STRING token).
>>
>> Does anyone have an example that can be shared of successfully using the
>> Admin CLI for this operation, please?
>>
>> Keycloak version is 6.0.1
>>
>> Regards
>> Bruce
>> _______________________________________________
>> keycloak-user mailing list
>> keycloak-user at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/keycloak-user
>>
>


More information about the keycloak-user mailing list