diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js index a30030fde1..9b7ba1c79b 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js @@ -642,45 +642,6 @@ module.config([ '$routeProvider', function($routeProvider) { }, controller : 'ClientCredentialsCtrl' }) - .when('/realms/:realm/clients/:client/credentials/client-secret', { - templateUrl : resourceUrl + '/partials/client-credentials-secret.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientSecretCtrl' - }) - .when('/realms/:realm/clients/:client/credentials/client-jwt', { - templateUrl : resourceUrl + '/partials/client-credentials-jwt.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientSignedJWTCtrl' - }) - .when('/realms/:realm/clients/:client/credentials/:provider', { - templateUrl : resourceUrl + '/partials/client-credentials-generic.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - clientConfigProperties: function(PerClientAuthenticationConfigDescriptionLoader) { - return PerClientAuthenticationConfigDescriptionLoader(); - } - }, - controller : 'ClientGenericCredentialsCtrl' - }) .when('/realms/:realm/clients/:client/credentials/client-jwt/:keyType/import/:attribute', { templateUrl : resourceUrl + '/partials/client-credentials-jwt-key-import.html', resolve : { diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js index 4ec4c22160..46f6c9a494 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js @@ -62,23 +62,36 @@ module.controller('ClientCredentialsCtrl', function($scope, $location, realm, cl } }, true); + $scope.$watch('client.clientAuthenticatorType', function(val) { + $scope.clientAuthenticatorConfigPartial; + switch(val) { + case 'client-secret': + $scope.clientAuthenticatorConfigPartial = 'client-credentials-secret.html'; + break; + case 'client-jwt': + $scope.clientAuthenticatorConfigPartial = 'client-credentials-jwt.html'; + break; + default: + $scope.clientAuthenticatorConfigPartial = 'client-credentials-generic.html'; + break; + } + }); + $scope.configureAuthenticator = function() { $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/credentials/" + client.clientAuthenticatorType); } }); -module.controller('ClientSecretCtrl', function($scope, $location, realm, client, ClientSecret, Notifications) { - $scope.realm = realm; - $scope.client = client; - var secret = ClientSecret.get({ realm : realm.realm, client : client.id }, +module.controller('ClientSecretCtrl', function($scope, $location, ClientSecret, Notifications) { + var secret = ClientSecret.get({ realm : $scope.realm.realm, client : $scope.client.id }, function() { $scope.secret = secret.value; } ); $scope.changePassword = function() { - var secret = ClientSecret.update({ realm : realm.realm, client : client.id }, + var secret = ClientSecret.update({ realm : $scope.realm.realm, client : $scope.client.id }, function() { Notifications.success('The secret has been changed.'); $scope.secret = secret.value; @@ -97,31 +110,27 @@ module.controller('ClientSecretCtrl', function($scope, $location, realm, client, }); $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/credentials"); + $location.url("/realms/" + $scope.realm.realm + "/clients/" + $scope.client.id + "/credentials"); }; }); -module.controller('ClientSignedJWTCtrl', function($scope, $location, realm, client, ClientCertificate, Notifications) { - - $scope.realm = realm; - $scope.client = client; - - var signingKeyInfo = ClientCertificate.get({ realm : realm.realm, client : client.id, attribute: 'jwt.credential' }, +module.controller('ClientSignedJWTCtrl', function($scope, $location, ClientCertificate) { + var signingKeyInfo = ClientCertificate.get({ realm : $scope.realm.realm, client : $scope.client.id, attribute: 'jwt.credential' }, function() { $scope.signingKeyInfo = signingKeyInfo; } ); $scope.importCertificate = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/credentials/client-jwt/Signing/import/jwt.credential"); + $location.url("/realms/" + $scope.realm.realm + "/clients/" + $scope.client.id + "/credentials/client-jwt/Signing/import/jwt.credential"); }; $scope.generateSigningKey = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/credentials/client-jwt/Signing/export/jwt.credential"); + $location.url("/realms/" + $scope.realm.realm + "/clients/" + $scope.client.id + "/credentials/client-jwt/Signing/export/jwt.credential"); }; $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/credentials"); + $location.url("/realms/" + $scope.realm.realm + "/clients/" + $scope.client.id + "/credentials"); }; }); @@ -328,7 +337,7 @@ module.controller('ClientCertificateImportCtrl', function($scope, $location, $ht var redirectLocation = "/realms/" + realm.realm + "/clients/" + client.id + "/saml/keys"; } else if (callingContext == 'jwt-credentials') { var uploadUrl = authUrl + '/admin/realms/' + realm.realm + '/clients/' + client.id + '/certificates/' + attribute + '/upload-certificate'; - var redirectLocation = "/realms/" + realm.realm + "/clients/" + client.id + "/credentials/client-jwt"; + var redirectLocation = "/realms/" + realm.realm + "/clients/" + client.id + "/credentials"; } $scope.files = []; @@ -337,8 +346,8 @@ module.controller('ClientCertificateImportCtrl', function($scope, $location, $ht $scope.files = $files; }; - $scope.clearFileSelect = function() { - $scope.files = null; + $scope.cancel = function() { + $location.url(redirectLocation); } $scope.keyFormats = [ @@ -438,7 +447,7 @@ module.controller('ClientCertificateExportCtrl', function($scope, $location, $ht if ($scope.jks.format == 'PKCS12') ext = ".p12"; if (callingContext == 'jwt-credentials') { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/credentials/client-jwt"); + $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/credentials"); Notifications.success("New keypair and certificate generated successfully. Download keystore file") } @@ -461,7 +470,7 @@ module.controller('ClientCertificateExportCtrl', function($scope, $location, $ht }); $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/credentials/client-jwt"); + $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/credentials"); } }); diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-generic.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-generic.html index 7d33e8a70f..c7595dd54b 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-generic.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-generic.html @@ -1,24 +1,12 @@ -
+
+
+ +
- - - - - -
- -
- -
-
- - -
+
+
+ +
- -
- - \ No newline at end of file +
+ \ No newline at end of file diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-export.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-export.html index b00a22797c..fc8236f4e2 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-export.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-export.html @@ -7,7 +7,7 @@
  • Generate Client Private Key
  • -

    Generate Private Key {{client.clientId|capitalize}}

    +

    Generate Private Key

    @@ -47,7 +47,7 @@
    - +
    diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-import.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-import.html index f11a1eab75..654d1d6bec 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-import.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-import.html @@ -7,7 +7,7 @@
  • Client Certificate Import
  • -

    Import Client Certificate {{client.clientId|capitalize}}

    +

    Import Client Certificate

    @@ -50,9 +50,9 @@
    -
    - - +
    + +
    diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt.html index 5290b1871b..3da4d7d124 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt.html @@ -1,36 +1,21 @@ -
    +
    + +
    + + Client Certificate for validate JWT issued by client and signed by Client private key from your keystore. - - - - - -
    - Client Certificate Client Certificate for validate JWT issued by client and signed by Client private key from your keystore. -
    - - -
    - -
    +
    +
    -
    - +
    + No client certificate configured
    -
    -
    - - - -
    +
    +
    +
    + +
    -
    +
    - -
    - - \ No newline at end of file +
    \ No newline at end of file diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret.html index cec0f15264..3062e8fb51 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret.html @@ -1,27 +1,17 @@ -
    - - - - - -
    +
    +
    - -
    -
    - -
    -
    - - +
    +
    + +
    +
    + +
    +
    - - diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html index 8415fbe5da..18f6a4ac16 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html @@ -21,13 +21,13 @@
    Client Authenticator used for authentication this client against Keycloak server -
    - Configure chosen authenticator -
    +
    +
    +