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

[7.2.z] Unable to export clients created on RH-SSO 7.1 after upgrade to RH-SSO 7.2

XMLWordPrintable

      It is not possible to export a client created on RH-SSO 7.1 in RH-SSO 7.2 with clients mapped. After updating the RH-SSO from 7.1 to 7.2 is possible to see the error message below on web console when tries to export:

      TypeError: Cannot read property 'length' of undefined
          at m.$scope.exportClient (clients.js:768)
          at fn (eval at compile (angular.js:15551), <anonymous>:4:229)
          at e (angular.js:27341)
          at m.$eval (angular.js:18423)
          at m.$apply (angular.js:18523)
          at HTMLTableCellElement.<anonymous> (angular.js:27346)
          at HTMLTableCellElement.dispatch (jquery.min.js:3)
          at HTMLTableCellElement.q.handle (jquery.min.js:3)
      (anonymous) @ angular.js:14700
      (anonymous) @ angular.js:11142
      $apply @ angular.js:18528
      (anonymous) @ angular.js:27346
      dispatch @ jquery.min.js:3
      q.handle @ jquery.min.js:3
      

      The issue occurs because there are no clientCopy.protocolMappers defined for clients created on RH-SSO 7.1, that has only clientCopy.protocol declared on the clientCopy. Refer client.js 1

          $scope.exportClient = function(client) {
              var clientCopy = angular.copy(client);
              delete clientCopy.id;
      
              for (var i = 0; i < clientCopy.protocolMappers.length; i++) {
                  delete clientCopy.protocolMappers[i].id;
              }
      
              saveAs(new Blob([angular.toJson(clientCopy, 4)], { type: 'application/json' }), clientCopy.clientId + '.json');
          }
      });
      

      1 https://github.com/keycloak/keycloak/blob/3.4.3.Final-2/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js#L768

            ssilvert@redhat.com Stan Silvert
            rhn-support-pesilva Pedro Silva
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: