Uploaded image for project: 'RH-SSO'
  1. RH-SSO
  2. RHSSO-1681

Using kcadm to update an identity-provider instance via a json file does not work without an "internalId" present in the json

XMLWordPrintable

    • Hide

      Using latest RH-SSO 7.2.5 :

      1) create an identity provider from admin console (for example a SAMLv2.0 identity provider) and populate its settings

      2) query the IDP settings via kcadm:

      ./kcadm.sh get identity-provider/instances/adfs_sbb_prod -r master
      

      3) Save the outputs in a .json file

      4) Edit the .json file and make changes on some attributes while also removing the line with "internalId" attribute:

        "internalId" : "cda5b8cd-bdf1-4a42-a484-f74ee895f44c",
      

      5) Run the kcadm update command to apply the changes as made in the .json file updated from 4)

      ./kcadm.sh update identity-provider/instances/adfs_sbb_prod -r master -f adfs_sbb_prod.json
      

      6) Notice that the 'kcadm.sh update ...' completed fine without any errors returned on the terminal console. However the changes are not applied/saved in the identity-provider instance settings.

      This can be verified from either Admin Console, or querying with the kcadm cli:

      ./kcadm.sh get identity-provider/instances/adfs_sbb_prod -r master
      

      7) I tried to run the 'kcadm.sh update ...' with the "--merge" option, but this leads to error as 'HTTP error - 415 Unsupported Media Type':

      ./kcadm.sh update identity-provider/instances/adfs_sbb_prod -r master -f adfs_sbb_prod.json --merge
      HTTP error - 415 Unsupported Media Type
      

      8) NOTE: It is actually possible to change any specific attribute(s) of the identity-provider instance using the below command and that while NOT specifying any "internalId" of the same identity-provider instance

      $ ./kcadm.sh update identity-provider/instances/adfs_sbb_prod -r master -s displayName="ADFS SBB Produktion ISSA-IVO"
      $ 
      

      So, why isn't it possible to make bulk changes in an identity-provider instance from .json file using kcadm cli, without specifying the "internalId" of the identity-provider in the json file ?

      Also, why does the merge option returns error as 'HTTP error - 415 Unsupported Media Type' ?

      Show
      Using latest RH-SSO 7.2.5 : 1) create an identity provider from admin console (for example a SAMLv2.0 identity provider) and populate its settings 2) query the IDP settings via kcadm: ./kcadm.sh get identity-provider/instances/adfs_sbb_prod -r master 3) Save the outputs in a .json file 4) Edit the .json file and make changes on some attributes while also removing the line with "internalId" attribute: "internalId" : "cda5b8cd-bdf1-4a42-a484-f74ee895f44c" , 5) Run the kcadm update command to apply the changes as made in the .json file updated from 4) ./kcadm.sh update identity-provider/instances/adfs_sbb_prod -r master -f adfs_sbb_prod.json 6) Notice that the 'kcadm.sh update ...' completed fine without any errors returned on the terminal console. However the changes are not applied/saved in the identity-provider instance settings. This can be verified from either Admin Console, or querying with the kcadm cli: ./kcadm.sh get identity-provider/instances/adfs_sbb_prod -r master 7) I tried to run the 'kcadm.sh update ...' with the "--merge" option, but this leads to error as 'HTTP error - 415 Unsupported Media Type': ./kcadm.sh update identity-provider/instances/adfs_sbb_prod -r master -f adfs_sbb_prod.json --merge HTTP error - 415 Unsupported Media Type 8) NOTE: It is actually possible to change any specific attribute(s) of the identity-provider instance using the below command and that while NOT specifying any "internalId" of the same identity-provider instance $ ./kcadm.sh update identity-provider/instances/adfs_sbb_prod -r master -s displayName= "ADFS SBB Produktion ISSA-IVO" $ So, why isn't it possible to make bulk changes in an identity-provider instance from .json file using kcadm cli, without specifying the "internalId" of the identity-provider in the json file ? Also, why does the merge option returns error as 'HTTP error - 415 Unsupported Media Type' ?

      Using kcadm cli tool to update an identity-provider instance via a json file does not work without specifying an "internalId" of the same identity-provider in the supplied json file.

      See 'Steps to Reproduce' for more.

            vramik@redhat.com Vlasta Ramik
            rhn-support-igueye Issa Gueye
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: