[keycloak-user] How to add user attribute through admin-cli

Subodh Joshi subodhcjoshi82 at gmail.com
Fri Mar 23 07:47:39 EDT 2018


I found the solution,



After too many hit & try,also with the help of my teammate we found the
solution and we have to fire below command through admin-cli to create user
attributes

/opt/keycloak/bin/kcadm.sh create users  -s username=admin111 -s
enabled=true -r master -s "attributes.tenantId=value" -s
"attributes.ugId=ugId" -s "attributes.appId=app"



On Fri, Mar 23, 2018 at 4:35 PM, Marko Strukelj <mstrukel at redhat.com> wrote:

> It looks like there is something wrong with attribute names, or their
> values for this provider.
>
> I suggest you try to perform the same operation through Admin Console with
> debug tools enabled, and see exactly what needs to be sent to the server.
>
> On Fri, Mar 23, 2018 at 10:55 AM, Subodh Joshi <subodhcjoshi82 at gmail.com>
> wrote:
>
>> Hi Marko,
>>
>> That may be typo i again tried
>> /opt/keycloak/bin/kcadm.sh create components -r master -s
>> name=user-attribute -s providerId=user-attribute -s
>> parentId=b33088e5-321e-4b2f-afa6-7dca1871084e -s
>> 'config."appid"=["SURE_APP"]'  -s 'config."tenantId"=["T0"]' -s
>> 'config."ugId"=["Admin_UserGroup"]'
>>
>> End with below error
>>
>> HTTP error - 400 Bad Request
>>
>> On Fri, Mar 23, 2018 at 3:22 PM, Marko Strukelj <mstrukel at redhat.com>
>> wrote:
>>
>>> Is there a space in the middle of parentId UUID?
>>>
>>> On Fri, Mar 23, 2018 at 8:42 AM, Subodh Joshi <subodhcjoshi82 at gmail.com>
>>> wrote:
>>>
>>>> I am trying to add three attributes of user and used below admin-cli
>>>> command
>>>>
>>>> /opt/keycloak/bin/kcadm.sh create components -r master -s
>>>> name=user-attribute -s providerId=user-attribute -s
>>>> parentId=1295a70f-25f7-4e45-bcb8-285d750 1c6d9 -s
>>>> 'config."appid"=["SURE_APP"]'  -s 'config."tenantId"=["T0"]' -s
>>>> 'config."ugId"=["Admin_UserGroup"]'
>>>>
>>>> but its throwing
>>>>
>>>> No server or realm specified. Use --server, --realm, or 'kcadm.sh config
>>>> credentials'.
>>>>
>>>> Can someone please let me know what wrong with above command?
>>>>
>>>> --
>>>> Subodh Chandra Joshi
>>>> subodh1_joshi82 at yahoo.co.in
>>>> http://www.questioninmind.com
>>>> _______________________________________________
>>>> keycloak-user mailing list
>>>> keycloak-user at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/keycloak-user
>>>>
>>>
>>>
>>
>>
>> --
>> Subodh Chandra Joshi
>> subodh1_joshi82 at yahoo.co.in
>> http://www.trendsinnews.com
>>
>
>


-- 
Subodh Chandra Joshi
subodh1_joshi82 at yahoo.co.in
http://www.trendsinnews.com


More information about the keycloak-user mailing list