From d3ba2ecbed463607af298a519fac9083d95539cc Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Wed, 8 Feb 2023 09:22:39 +0100 Subject: [PATCH] Remove old admin console theme (#16864) Closes #16862 --- .../migration/migrators/MigrateTo21_0_0.java | 37 + .../datastore/LegacyMigrationManager.java | 4 +- .../admin/messages/messages_en.properties | 2 - .../admin/messages/messages_test.properties | 2 - .../localized-theme/admin/theme.properties | 2 - .../keycloak/testsuite/ui/AbstractUiTest.java | 1 - themes/UPDATING-NODE-MODULES.md | 2 +- .../META-INF/keycloak-themes.json | 2 +- .../main/resources/theme/base/admin/index.ftl | 99 - .../theme/base/admin/resources/js/app.js | 3858 -------------- .../admin/resources/js/authz/authz-app.js | 569 -- .../resources/js/authz/authz-controller.js | 2833 ---------- .../resources/js/authz/authz-services.js | 218 - .../admin/resources/js/controllers/clients.js | 4054 --------------- .../admin/resources/js/controllers/groups.js | 625 --- .../admin/resources/js/controllers/realm.js | 4598 ----------------- .../admin/resources/js/controllers/roles.js | 48 - .../admin/resources/js/controllers/users.js | 2041 -------- .../theme/base/admin/resources/js/loaders.js | 587 --- .../theme/base/admin/resources/js/services.js | 2267 -------- .../authentication-flow-bindings.html | 83 - .../partials/authentication-flows.html | 72 - .../partials/authenticator-config.html | 52 - .../authz/mgmt/broker-permissions.html | 40 - .../authz/mgmt/client-permissions.html | 39 - .../authz/mgmt/client-role-permissions.html | 40 - .../authz/mgmt/group-permissions.html | 39 - .../authz/mgmt/realm-role-permissions.html | 39 - .../authz/mgmt/users-permissions.html | 35 - ...esource-server-policy-resource-detail.html | 131 - .../resource-server-policy-scope-detail.html | 137 - .../resource-server-permission-list.html | 118 - ...source-server-policy-aggregate-detail.html | 123 - .../resource-server-policy-client-detail.html | 93 - ...rce-server-policy-client-scope-detail.html | 126 - .../resource-server-policy-group-detail.html | 126 - .../resource-server-policy-js-detail.html | 68 - .../resource-server-policy-regex-detail.html | 100 - .../resource-server-policy-role-detail.html | 169 - .../resource-server-policy-time-detail.html | 119 - .../resource-server-policy-user-detail.html | 93 - ...esource-server-policy-evaluate-result.html | 72 - .../resource-server-policy-evaluate.html | 267 - .../policy/resource-server-policy-list.html | 117 - .../authz/resource-server-detail.html | 77 - .../resource-server-export-settings.html | 35 - .../partials/authz/resource-server-list.html | 49 - .../resource-server-resource-detail.html | 126 - .../authz/resource-server-resource-list.html | 169 - .../authz/resource-server-scope-detail.html | 50 - .../authz/resource-server-scope-list.html | 102 - .../admin/resources/partials/brute-force.html | 114 - .../admin/resources/partials/ciba-policy.html | 63 - .../base/admin/resources/partials/claims.html | 62 - .../partials/client-clustering-node.html | 37 - .../resources/partials/client-clustering.html | 76 - .../partials/client-credentials-generic.html | 14 - .../partials/client-credentials-jwt.html | 26 - .../client-credentials-secret-jwt.html | 55 - .../partials/client-credentials-secret.html | 33 - .../partials/client-credentials-x509.html | 28 - .../partials/client-credentials.html | 38 - .../resources/partials/client-detail.html | 1080 ---- .../resources/partials/client-import.html | 46 - .../client-initial-access-create.html | 63 - .../partials/client-initial-access.html | 55 - .../partials/client-installation.html | 36 - .../admin/resources/partials/client-keys.html | 146 - .../admin/resources/partials/client-list.html | 68 - .../partials/client-mappers-add.html | 53 - .../resources/partials/client-mappers.html | 55 - .../partials/client-offline-sessions.html | 59 - .../partials/client-oidc-key-export.html | 57 - .../partials/client-oidc-key-import.html | 62 - .../resources/partials/client-oidc-keys.html | 108 - .../partials/client-policies-json.html | 60 - .../partials/client-policies-list.html | 74 - ...client-policies-policy-edit-condition.html | 65 - .../partials/client-policies-policy-edit.html | 140 - ...lient-policies-profiles-edit-executor.html | 65 - .../client-policies-profiles-edit.html | 97 - .../client-policies-profiles-json.html | 60 - .../client-policies-profiles-list.html | 80 - .../client-protocol-mapper-detail.html | 13 - .../partials/client-reg-policies.html | 106 - .../partials/client-reg-policy-detail.html | 68 - .../client-reg-trusted-host-create.html | 55 - .../client-reg-trusted-host-detail.html | 64 - .../client-registration-access-token.html | 18 - .../resources/partials/client-revocation.html | 30 - .../partials/client-role-attributes.html | 45 - .../partials/client-role-detail.html | 140 - .../resources/partials/client-role-list.html | 64 - .../resources/partials/client-role-users.html | 52 - .../partials/client-saml-key-export.html | 63 - .../partials/client-saml-key-import.html | 62 - .../resources/partials/client-saml-keys.html | 66 - .../partials/client-scope-detail.html | 102 - .../resources/partials/client-scope-list.html | 60 - .../partials/client-scope-mappers-add.html | 53 - .../partials/client-scope-mappers.html | 55 - .../partials/client-scope-mappings.html | 127 - .../client-scope-protocol-mapper-detail.html | 13 - .../partials/client-scope-scope-mappings.html | 116 - .../partials/client-scopes-evaluate.html | 268 - .../partials/client-scopes-realm-default.html | 99 - .../partials/client-scopes-setup.html | 123 - .../client-service-account-roles.html | 140 - .../resources/partials/client-sessions.html | 57 - .../partials/client-storage-generic.html | 207 - .../partials/client-storage-list.html | 67 - .../resources/partials/create-client.html | 72 - .../resources/partials/create-execution.html | 31 - .../partials/create-flow-execution.html | 55 - .../admin/resources/partials/create-flow.html | 43 - .../resources/partials/create-group.html | 25 - .../resources/partials/default-groups.html | 91 - .../resources/partials/defense-headers.html | 71 - .../admin/resources/partials/forbidden.html | 7 - .../resources/partials/group-attributes.html | 41 - .../resources/partials/group-detail.html | 28 - .../admin/resources/partials/group-list.html | 50 - .../resources/partials/group-members.html | 48 - .../partials/group-role-mappings.html | 111 - .../base/admin/resources/partials/home.html | 4 - .../identity-provider-mapper-detail.html | 84 - .../partials/identity-provider-mappers.html | 49 - .../base/admin/resources/partials/menu.html | 26 - .../partials/modal/group-selector.html | 50 - .../modal/realm-events-admin-auth.html | 8 - .../realm-events-admin-representation.html | 3 - .../partials/modal/role-selector.html | 39 - ...unregistered-required-action-selector.html | 21 - .../partials/modal/user-credential-data.html | 8 - .../resources/partials/modal/view-key.html | 18 - .../resources/partials/modal/view-object.html | 3 - .../admin/resources/partials/notfound.html | 7 - .../admin/resources/partials/otp-policy.html | 108 - .../resources/partials/pagenotfound.html | 7 - .../resources/partials/partial-export.html | 34 - .../resources/partials/partial-import.html | 130 - .../resources/partials/password-policy.html | 51 - .../partials/protocol-mapper-detail.html | 64 - .../partials/realm-cache-settings.html | 30 - .../resources/partials/realm-create.html | 45 - .../partials/realm-default-roles.html | 88 - .../resources/partials/realm-detail.html | 90 - .../partials/realm-events-admin.html | 134 - .../partials/realm-events-config.html | 117 - .../resources/partials/realm-events.html | 124 - .../realm-identity-provider-bitbucket.html | 142 - .../realm-identity-provider-facebook-ext.html | 7 - .../realm-identity-provider-facebook.html | 1 - .../realm-identity-provider-github-ext.html | 14 - .../realm-identity-provider-github.html | 1 - .../realm-identity-provider-gitlab.html | 142 - .../realm-identity-provider-google-ext.html | 21 - .../realm-identity-provider-google.html | 1 - ...realm-identity-provider-instagram-ext.html | 0 .../realm-identity-provider-instagram.html | 1 - ...realm-identity-provider-keycloak-oidc.html | 1 - .../realm-identity-provider-linkedin-ext.html | 11 - .../realm-identity-provider-linkedin.html | 1 - ...realm-identity-provider-microsoft-ext.html | 0 .../realm-identity-provider-microsoft.html | 1 - .../realm-identity-provider-oidc.html | 395 -- ...lm-identity-provider-openshift-v3-ext.html | 7 - .../realm-identity-provider-openshift-v3.html | 164 - ...lm-identity-provider-openshift-v4-ext.html | 7 - .../realm-identity-provider-openshift-v4.html | 164 - .../realm-identity-provider-paypal-ext.html | 7 - .../realm-identity-provider-paypal.html | 1 - .../realm-identity-provider-saml.html | 447 -- .../realm-identity-provider-social.html | 157 - ...m-identity-provider-stackoverflow-ext.html | 7 - ...realm-identity-provider-stackoverflow.html | 1 - .../realm-identity-provider-twitter-ext.html | 0 .../realm-identity-provider-twitter.html | 1 - .../partials/realm-identity-provider.html | 81 - .../partials/realm-keys-disabled.html | 70 - .../partials/realm-keys-generic.html | 69 - .../partials/realm-keys-passive.html | 70 - .../partials/realm-keys-providers.html | 75 - .../admin/resources/partials/realm-keys.html | 73 - .../admin/resources/partials/realm-list.html | 20 - .../partials/realm-localization-detail.html | 50 - .../partials/realm-localization-upload.html | 37 - .../partials/realm-localization.html | 61 - .../partials/realm-login-settings.html | 107 - .../resources/partials/realm-role-users.html | 50 - .../admin/resources/partials/realm-smtp.html | 96 - .../partials/realm-theme-settings.html | 97 - .../resources/partials/realm-tokens.html | 409 -- .../partials/realm-user-profile.html | 372 -- .../resources/partials/required-actions.html | 38 - .../resources/partials/role-attributes.html | 41 - .../admin/resources/partials/role-detail.html | 135 - .../admin/resources/partials/role-list.html | 63 - .../resources/partials/role-mappings.html | 119 - .../partials/server-info-providers.html | 55 - .../admin/resources/partials/server-info.html | 135 - .../resources/partials/session-realm.html | 34 - .../partials/session-revocation.html | 30 - .../resources/partials/user-attributes.html | 41 - .../resources/partials/user-consents.html | 41 - .../resources/partials/user-credentials.html | 173 - .../admin/resources/partials/user-detail.html | 186 - .../user-federated-identity-detail.html | 53 - .../user-federated-identity-list.html | 41 - .../resources/partials/user-federation.html | 69 - .../partials/user-group-membership.html | 114 - .../admin/resources/partials/user-list.html | 69 - .../partials/user-offline-sessions.html | 35 - .../resources/partials/user-sessions.html | 43 - .../partials/user-storage-generic.html | 246 - .../partials/user-storage-kerberos.html | 264 - .../user-storage-ldap-mapper-detail.html | 64 - .../partials/user-storage-ldap-mappers.html | 46 - .../resources/partials/user-storage-ldap.html | 568 -- .../resources/partials/user-storage.html | 45 - .../webauthn-policy-passwordless.html | 177 - .../resources/partials/webauthn-policy.html | 159 - .../templates/authz/kc-authz-modal.html | 11 - .../authz/kc-tabs-resource-server.html | 14 - .../templates/kc-component-config.html | 67 - .../admin/resources/templates/kc-copy.html | 18 - .../resources/templates/kc-dropdown.html | 12 - .../admin/resources/templates/kc-edit.html | 22 - .../admin/resources/templates/kc-menu.html | 65 - .../resources/templates/kc-modal-message.html | 10 - .../admin/resources/templates/kc-modal.html | 11 - .../admin/resources/templates/kc-paging.html | 25 - .../templates/kc-provider-config.html | 104 - .../admin/resources/templates/kc-switch.html | 12 - .../templates/kc-tabs-authentication.html | 16 - .../templates/kc-tabs-client-role.html | 17 - .../templates/kc-tabs-client-scope.html | 20 - .../resources/templates/kc-tabs-client.html | 65 - .../resources/templates/kc-tabs-clients.html | 16 - .../templates/kc-tabs-group-list.html | 11 - .../resources/templates/kc-tabs-group.html | 17 - .../templates/kc-tabs-identity-provider.html | 16 - .../resources/templates/kc-tabs-ldap.html | 12 - .../resources/templates/kc-tabs-realm.html | 24 - .../resources/templates/kc-tabs-role.html | 16 - .../templates/kc-tabs-user-storage.html | 11 - .../resources/templates/kc-tabs-user.html | 18 - .../resources/templates/kc-tabs-users.html | 11 - .../keycloak/admin/resources/css/styles.css | 505 -- .../admin/resources/img/keyclok-logo.png | Bin 5268 -> 0 bytes .../admin/resources/img/keyclok-logo.svg | 194 - .../admin/resources/img/select-arrow.png | Bin 1154 -> 0 bytes .../theme/keycloak/admin/theme.properties | 5 - 253 files changed, 42 insertions(+), 40004 deletions(-) create mode 100644 model/legacy-private/src/main/java/org/keycloak/migration/migrators/MigrateTo21_0_0.java delete mode 100644 testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/messages/messages_en.properties delete mode 100644 testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/messages/messages_test.properties delete mode 100644 testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/theme.properties delete mode 100755 themes/src/main/resources/theme/base/admin/index.ftl delete mode 100755 themes/src/main/resources/theme/base/admin/resources/js/app.js delete mode 100644 themes/src/main/resources/theme/base/admin/resources/js/authz/authz-app.js delete mode 100644 themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js delete mode 100644 themes/src/main/resources/theme/base/admin/resources/js/authz/authz-services.js delete mode 100755 themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js delete mode 100755 themes/src/main/resources/theme/base/admin/resources/js/controllers/groups.js delete mode 100644 themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js delete mode 100644 themes/src/main/resources/theme/base/admin/resources/js/controllers/roles.js delete mode 100755 themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js delete mode 100755 themes/src/main/resources/theme/base/admin/resources/js/loaders.js delete mode 100755 themes/src/main/resources/theme/base/admin/resources/js/services.js delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/authentication-flow-bindings.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/authentication-flows.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/authenticator-config.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/broker-permissions.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/client-permissions.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/client-role-permissions.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/group-permissions.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/realm-role-permissions.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/users-permissions.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-scope-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/resource-server-permission-list.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-scope-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-regex-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-evaluate-result.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-evaluate.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-list.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-export-settings.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-list.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-resource-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-resource-list.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-scope-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-scope-list.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/brute-force.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/ciba-policy.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/claims.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-clustering-node.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-clustering.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-generic.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret-jwt.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-x509.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-import.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-initial-access-create.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-initial-access.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-installation.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-keys.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-list.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-mappers-add.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-mappers.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-offline-sessions.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-key-export.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-key-import.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-keys.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-policies-json.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-policies-list.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-policies-policy-edit-condition.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-policies-policy-edit.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-edit-executor.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-edit.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-json.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-list.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-protocol-mapper-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-reg-policies.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-reg-policy-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-reg-trusted-host-create.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-reg-trusted-host-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-registration-access-token.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-revocation.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-role-attributes.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-role-detail.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-role-users.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-saml-key-export.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-saml-key-import.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-saml-keys.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-scope-detail.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-scope-list.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappers-add.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappers.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-scope-protocol-mapper-detail.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-scope-scope-mappings.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-evaluate.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-realm-default.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-setup.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/client-service-account-roles.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-sessions.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-storage-generic.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/client-storage-list.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/create-client.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/create-execution.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/create-flow-execution.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/create-flow.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/create-group.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/default-groups.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/defense-headers.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/forbidden.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/group-attributes.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/group-detail.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/group-list.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/group-members.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/group-role-mappings.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/home.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mapper-detail.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mappers.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/menu.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/modal/group-selector.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/modal/realm-events-admin-auth.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/modal/realm-events-admin-representation.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/modal/role-selector.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/modal/unregistered-required-action-selector.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/modal/user-credential-data.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/modal/view-key.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/modal/view-object.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/notfound.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/otp-policy.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/pagenotfound.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/partial-export.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/partial-import.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/password-policy.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/protocol-mapper-detail.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-cache-settings.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-create.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-default-roles.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-detail.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-events-admin.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-events-config.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-events.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-bitbucket.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-facebook-ext.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-facebook.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-github-ext.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-github.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-gitlab.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-google-ext.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-google.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-instagram-ext.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-instagram.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-keycloak-oidc.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-linkedin-ext.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-linkedin.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-microsoft-ext.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-microsoft.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-oidc.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v3-ext.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v3.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v4-ext.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v4.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-paypal-ext.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-paypal.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-saml.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-social.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-stackoverflow-ext.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-stackoverflow.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-twitter-ext.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-twitter.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-disabled.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-generic.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-passive.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-providers.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-keys.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-list.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/realm-localization-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/realm-localization-upload.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/realm-localization.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-login-settings.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/realm-role-users.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-smtp.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-theme-settings.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-tokens.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/realm-user-profile.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/required-actions.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/role-attributes.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/role-detail.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/role-list.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/role-mappings.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/server-info-providers.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/server-info.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/session-realm.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/session-revocation.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/user-consents.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/user-credentials.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/user-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/user-federated-identity-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/user-federated-identity-list.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/user-federation.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/user-group-membership.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/user-list.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/user-offline-sessions.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/user-sessions.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/user-storage-generic.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/user-storage-kerberos.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap-mapper-detail.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap-mappers.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/partials/user-storage.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/webauthn-policy-passwordless.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/partials/webauthn-policy.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/templates/authz/kc-authz-modal.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/authz/kc-tabs-resource-server.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-component-config.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-copy.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/templates/kc-dropdown.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/templates/kc-edit.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-menu.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-modal-message.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/templates/kc-modal.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/templates/kc-paging.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-provider-config.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/templates/kc-switch.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-authentication.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client-role.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client-scope.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-clients.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-group-list.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-group.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-identity-provider.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-ldap.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-realm.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-role.html delete mode 100644 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user-storage.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user.html delete mode 100755 themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-users.html delete mode 100755 themes/src/main/resources/theme/keycloak/admin/resources/css/styles.css delete mode 100644 themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.png delete mode 100644 themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.svg delete mode 100644 themes/src/main/resources/theme/keycloak/admin/resources/img/select-arrow.png delete mode 100755 themes/src/main/resources/theme/keycloak/admin/theme.properties diff --git a/model/legacy-private/src/main/java/org/keycloak/migration/migrators/MigrateTo21_0_0.java b/model/legacy-private/src/main/java/org/keycloak/migration/migrators/MigrateTo21_0_0.java new file mode 100644 index 0000000000..dc5d53758c --- /dev/null +++ b/model/legacy-private/src/main/java/org/keycloak/migration/migrators/MigrateTo21_0_0.java @@ -0,0 +1,37 @@ +package org.keycloak.migration.migrators; + +import org.keycloak.migration.ModelVersion; +import org.keycloak.models.AccountRoles; +import org.keycloak.models.ClientModel; +import org.keycloak.models.Constants; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.RealmModel; +import org.keycloak.models.RoleModel; +import org.keycloak.representations.idm.RealmRepresentation; + +public class MigrateTo21_0_0 implements Migration { + + public static final ModelVersion VERSION = new ModelVersion("21.0.0"); + + @Override + public void migrate(KeycloakSession session) { + session.realms().getRealmsStream().forEach(this::updateAdminTheme); + } + + @Override + public void migrateImport(KeycloakSession session, RealmModel realm, RealmRepresentation rep, boolean skipUserDependent) { + updateAdminTheme(realm); + } + + private void updateAdminTheme(RealmModel realm) { + String adminTheme = realm.getAdminTheme(); + if (adminTheme.equals("keycloak") || adminTheme.equals("rh-sso")) { + realm.setAdminTheme("keycloak.v2"); + } + } + + @Override + public ModelVersion getVersion() { + return VERSION; + } +} diff --git a/model/legacy-private/src/main/java/org/keycloak/storage/datastore/LegacyMigrationManager.java b/model/legacy-private/src/main/java/org/keycloak/storage/datastore/LegacyMigrationManager.java index e236928f27..9449676072 100644 --- a/model/legacy-private/src/main/java/org/keycloak/storage/datastore/LegacyMigrationManager.java +++ b/model/legacy-private/src/main/java/org/keycloak/storage/datastore/LegacyMigrationManager.java @@ -34,6 +34,7 @@ import org.keycloak.migration.migrators.MigrateTo1_7_0; import org.keycloak.migration.migrators.MigrateTo1_8_0; import org.keycloak.migration.migrators.MigrateTo1_9_0; import org.keycloak.migration.migrators.MigrateTo1_9_2; +import org.keycloak.migration.migrators.MigrateTo21_0_0; import org.keycloak.migration.migrators.MigrateTo2_0_0; import org.keycloak.migration.migrators.MigrateTo2_1_0; import org.keycloak.migration.migrators.MigrateTo2_2_0; @@ -106,7 +107,8 @@ public class LegacyMigrationManager implements MigrationManager { new MigrateTo12_0_0(), new MigrateTo14_0_0(), new MigrateTo18_0_0(), - new MigrateTo20_0_0() + new MigrateTo20_0_0(), + new MigrateTo21_0_0() }; private final KeycloakSession session; diff --git a/testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/messages/messages_en.properties b/testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/messages/messages_en.properties deleted file mode 100644 index d5ac3fa3ad..0000000000 --- a/testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/messages/messages_en.properties +++ /dev/null @@ -1,2 +0,0 @@ -#encoding: utf-8 -locale_test=Přísný jazyk diff --git a/testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/messages/messages_test.properties b/testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/messages/messages_test.properties deleted file mode 100644 index 363f47efd0..0000000000 --- a/testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/messages/messages_test.properties +++ /dev/null @@ -1,2 +0,0 @@ -#encoding: utf-8 -locale_test=Přísný jazyk \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/theme.properties b/testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/theme.properties deleted file mode 100644 index 39e87c7462..0000000000 --- a/testsuite/integration-arquillian/tests/other/base-ui/src/main/resources/themes/localized-theme/admin/theme.properties +++ /dev/null @@ -1,2 +0,0 @@ -parent=${theme-default-name} -locales=en,lang01,lang02,lang03,lang04,lang05,test,lang06,lang07,lang08,lang09,lang10 \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/AbstractUiTest.java b/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/AbstractUiTest.java index b4545431aa..6a2f8152f2 100644 --- a/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/AbstractUiTest.java +++ b/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/AbstractUiTest.java @@ -70,7 +70,6 @@ public abstract class AbstractUiTest extends AbstractAuthTest { realm.setInternationalizationEnabled(true); realm.setSupportedLocales(supportedLocales); realm.setLoginTheme(LOCALIZED_THEME); - realm.setAdminTheme(LOCALIZED_THEME); realm.setAccountTheme(localizedTheme); realm.setEmailTheme(LOCALIZED_THEME); } diff --git a/themes/UPDATING-NODE-MODULES.md b/themes/UPDATING-NODE-MODULES.md index 2c06ce58b1..c60e6620d9 100644 --- a/themes/UPDATING-NODE-MODULES.md +++ b/themes/UPDATING-NODE-MODULES.md @@ -2,7 +2,7 @@ The dependencies will be downloaded at build time, based on the contents of `package-lock.json`. You should verify the new set of packages don't break anything before committing the new `package-lock.json`. -## For login, admin console, and old account console +## For login and old account console ```bash cd src/main/resources/theme/keycloak/common/resources diff --git a/themes/src/main/resources-community/META-INF/keycloak-themes.json b/themes/src/main/resources-community/META-INF/keycloak-themes.json index c58ad91aa1..1df68b3b51 100755 --- a/themes/src/main/resources-community/META-INF/keycloak-themes.json +++ b/themes/src/main/resources-community/META-INF/keycloak-themes.json @@ -4,7 +4,7 @@ "types": [ "admin", "account", "login", "email" ] }, { "name" : "keycloak", - "types": [ "admin", "account", "login", "common", "email", "welcome" ] + "types": [ "account", "login", "common", "email", "welcome" ] }, { "name" : "keycloak.v2", "types": [ "account", "admin" ] diff --git a/themes/src/main/resources/theme/base/admin/index.ftl b/themes/src/main/resources/theme/base/admin/index.ftl deleted file mode 100755 index bbf1549fa6..0000000000 --- a/themes/src/main/resources/theme/base/admin/index.ftl +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - <#if properties.stylesCommon?has_content> - <#list properties.stylesCommon?split(' ') as style> - - - <#list properties.styles?split(' ') as style> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <#if properties.scripts?has_content> - <#list properties.scripts?split(' ') as script> - - - - - - - - -
-
-
-
-
- -
-
- - - - - - - {{notification.header}} {{notification.message}} -
-
- -
Loading...
- - - diff --git a/themes/src/main/resources/theme/base/admin/resources/js/app.js b/themes/src/main/resources/theme/base/admin/resources/js/app.js deleted file mode 100755 index 04f0cc6164..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/app.js +++ /dev/null @@ -1,3858 +0,0 @@ -'use strict'; - -var auth = {}; -var resourceBundle; -var locale = 'en'; - -var module = angular.module('keycloak', [ 'keycloak.services', 'keycloak.loaders', 'ui.bootstrap', 'ui.select2', 'angularFileUpload', 'angularTreeview', 'pascalprecht.translate', 'ngCookies', 'ngSanitize']); -var resourceRequests = 0; -var loadingTimer = -1; -var translateProvider = null; -var currentRealm = null; - -angular.element(document).ready(function () { - var keycloakAuth = new Keycloak(consoleBaseUrl + 'config'); - - function whoAmI(success, error) { - var req = new XMLHttpRequest(); - req.open('GET', consoleBaseUrl + 'whoami', true); - req.setRequestHeader('Accept', 'application/json'); - req.setRequestHeader('Authorization', 'bearer ' + keycloakAuth.token); - - req.onreadystatechange = function () { - if (req.readyState == 4) { - if (req.status == 200) { - var data = JSON.parse(req.responseText); - success(data); - } else { - error(); - } - } - } - - req.send(); - } - - function loadResourceBundle(success, error) { - var req = new XMLHttpRequest(); - req.open('GET', consoleBaseUrl + 'messages.json?lang=' + locale, true); - req.setRequestHeader('Accept', 'application/json'); - - req.onreadystatechange = function () { - if (req.readyState == 4) { - if (req.status == 200) { - var data = JSON.parse(req.responseText); - success && success(data); - } else { - error && error(); - } - } - } - - req.send(); - } - - function loadSelect2Localization() { - // 'en' is the built-in default and does not have to be loaded. - var supportedLocales = ['ar', 'az', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'es', 'et', 'eu', 'fa', 'fi', 'fr', - 'gl', 'he', 'hr', 'hu', 'id', 'is', 'it', 'ja', 'ka', 'ko', 'lt', 'lv', 'mk', 'ms', 'nl', 'no', 'pl', - 'pt-BR', 'pt-PT', 'ro', 'rs', 'ru', 'sk', 'sv', 'th', 'tr', 'ug-CN', 'uk', 'vi', 'zh-CN', 'zh-TW']; - if (supportedLocales.indexOf(locale) == -1) return; - var select2JsUrl; - var allScriptElements = document.getElementsByTagName('script'); - for (var i = 0, n = allScriptElements.length; i < n; i++) { - var src = allScriptElements[i].getAttribute('src'); - if (src && src.match(/\/select2\/select2\.js$/)) { - select2JsUrl = src; - break; - } - } - if (!select2JsUrl) return; - var scriptElement = document.createElement('script'); - scriptElement.src = select2JsUrl.replace(/\/select2\/select2\.js$/, '/select2/select2_locale_'+locale+'.js'); - scriptElement.type = 'text/javascript'; - document.getElementsByTagName('head')[0].appendChild(scriptElement); - } - - function hasAnyAccess(user) { - return user && user['realm_access']; - } - - keycloakAuth.onAuthLogout = function() { - location.reload(); - } - - auth.refreshPermissions = function(success, error) { - whoAmI(function(data) { - auth.user = data; - auth.loggedIn = true; - auth.hasAnyAccess = hasAnyAccess(data); - - success(); - }, function() { - error(); - }); - }; - - module.factory('Auth', function () { - return auth; - }); - - keycloakAuth.init({ onLoad: 'login-required', pkceMethod: 'S256' }).then(function () { - auth.authz = keycloakAuth; - - whoAmI(function(data) { - auth.user = data; - auth.loggedIn = true; - auth.hasAnyAccess = hasAnyAccess(data); - locale = auth.user.locale || locale; - - loadResourceBundle(function(data) { - resourceBundle = data; - - var injector = angular.bootstrap(document, ["keycloak"]); - - injector.get('$translate')('consoleTitle').then(function (consoleTitle) { - document.title = consoleTitle; - }); - }); - }); - - loadSelect2Localization(); - }).catch(function () { - window.location.reload(); - }); -}); - -module.factory('authInterceptor', function($q, Auth) { - return { - request: function (config) { - if (!config.url.match(/.html$/)) { - var deferred = $q.defer(); - if (Auth.authz.token) { - Auth.authz.updateToken(5).then(function () { - config.headers = config.headers || {}; - config.headers.Authorization = 'Bearer ' + Auth.authz.token; - - deferred.resolve(config); - }).catch(function () { - location.reload(); - }); - } - return deferred.promise; - } else { - return config; - } - } - }; -}); - -module.config(['$translateProvider', function($translateProvider) { - translateProvider = $translateProvider; - $translateProvider.useSanitizeValueStrategy('sanitizeParameters'); - $translateProvider.preferredLanguage(locale); - $translateProvider.translations(locale, resourceBundle); -}]); - -// Change for upgrade to AngularJS 1.6 -// See https://github.com/angular/angular.js/commit/aa077e81129c740041438688dff2e8d20c3d7b52 -module.config(['$locationProvider', function($locationProvider) { - $locationProvider.hashPrefix(''); -}]); - -module.config([ '$routeProvider', function($routeProvider) { - $routeProvider - .when('/create/realm', { - templateUrl : resourceUrl + '/partials/realm-create.html', - resolve : { - - }, - controller : 'RealmCreateCtrl' - }) - .when('/realms/:realm', { - templateUrl : resourceUrl + '/partials/realm-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmDetailCtrl' - }) - .when('/realms/:realm/localization', { - templateUrl : resourceUrl + '/partials/realm-localization.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - realmSpecificLocales : function(RealmSpecificLocalesLoader) { - return RealmSpecificLocalesLoader(); - } - }, - controller : 'RealmLocalizationCtrl' - }) - .when('/realms/:realm/localization/upload', { - templateUrl : resourceUrl + '/partials/realm-localization-upload.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmLocalizationUploadCtrl' - }) - .when('/realms/:realm/login-settings', { - templateUrl : resourceUrl + '/partials/realm-login-settings.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmLoginSettingsCtrl' - }) - .when('/realms/:realm/theme-settings', { - templateUrl : resourceUrl + '/partials/realm-theme-settings.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmThemeCtrl' - }) - .when('/realms/:realm/cache-settings', { - templateUrl : resourceUrl + '/partials/realm-cache-settings.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmCacheCtrl' - }) - .when('/realms', { - templateUrl : resourceUrl + '/partials/realm-list.html', - controller : 'RealmListCtrl' - }) - .when('/realms/:realm/token-settings', { - templateUrl : resourceUrl + '/partials/realm-tokens.html', - resolve : { - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'RealmTokenDetailCtrl' - }) - .when('/realms/:realm/user-profile', { - templateUrl : resourceUrl + '/partials/realm-user-profile.html', - resolve : { - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientScopes : function(ClientScopeListLoader) { - return ClientScopeListLoader(); - }, - }, - controller : 'RealmUserProfileCtrl' - }) - .when('/realms/:realm/client-registration/client-initial-access', { - templateUrl : resourceUrl + '/partials/client-initial-access.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientInitialAccess : function(ClientInitialAccessLoader) { - return ClientInitialAccessLoader(); - } - }, - controller : 'ClientInitialAccessCtrl' - }) - .when('/realms/:realm/client-registration/client-initial-access/create', { - templateUrl : resourceUrl + '/partials/client-initial-access-create.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'ClientInitialAccessCreateCtrl' - }) - .when('/realms/:realm/client-registration/client-reg-policies', { - templateUrl : resourceUrl + '/partials/client-reg-policies.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - policies : function(ComponentsLoader) { - return ComponentsLoader.loadComponents(null, 'org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy'); - }, - clientRegistrationPolicyProviders : function(ClientRegistrationPolicyProvidersLoader) { - return ClientRegistrationPolicyProvidersLoader(); - } - }, - controller : 'ClientRegPoliciesCtrl' - }) - .when('/realms/:realm/client-registration/client-reg-policies/create/:componentType/:providerId', { - templateUrl : resourceUrl + '/partials/client-reg-policy-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function($route) { - return { - providerType: 'org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy', - subType: $route.current.params.componentType, - providerId: $route.current.params.providerId - }; - }, - clientRegistrationPolicyProviders : function(ClientRegistrationPolicyProvidersLoader) { - return ClientRegistrationPolicyProvidersLoader(); - } - }, - controller : 'ClientRegPolicyDetailCtrl' - }) - .when('/realms/:realm/client-registration/client-reg-policies/:provider/:componentId', { - templateUrl : resourceUrl + '/partials/client-reg-policy-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function(ComponentLoader) { - return ComponentLoader(); - }, - clientRegistrationPolicyProviders : function(ClientRegistrationPolicyProvidersLoader) { - return ClientRegistrationPolicyProvidersLoader(); - } - }, - controller : 'ClientRegPolicyDetailCtrl' - }) - .when('/realms/:realm/client-policies/profiles', { - templateUrl : resourceUrl + '/partials/client-policies-profiles-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientProfiles : function(ClientPoliciesProfilesLoader) { - return ClientPoliciesProfilesLoader.loadClientProfiles('true'); - }, - }, - controller : 'ClientPoliciesProfilesListCtrl' - }) - .when('/realms/:realm/client-policies/profiles-json', { - templateUrl : resourceUrl + '/partials/client-policies-profiles-json.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientProfiles : function(ClientPoliciesProfilesLoader) { - return ClientPoliciesProfilesLoader.loadClientProfiles('true'); - } - }, - controller : 'ClientPoliciesProfilesJsonCtrl' - }) - .when('/realms/:realm/client-policies/profiles-create', { - templateUrl : resourceUrl + '/partials/client-policies-profiles-edit.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientProfiles : function(ClientPoliciesProfilesLoader) { - return ClientPoliciesProfilesLoader.loadClientProfiles('false'); - } - }, - controller : 'ClientPoliciesProfilesEditCtrl' - }) - .when('/realms/:realm/client-policies/profiles-update/:profileName', { - templateUrl : resourceUrl + '/partials/client-policies-profiles-edit.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientProfiles : function(ClientPoliciesProfilesLoader) { - return ClientPoliciesProfilesLoader.loadClientProfiles('true'); - } - }, - controller : 'ClientPoliciesProfilesEditCtrl' - }) - .when('/realms/:realm/client-policies/profiles-update/:profileName/create-executor', { - templateUrl : resourceUrl + '/partials/client-policies-profiles-edit-executor.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientProfiles : function(ClientPoliciesProfilesLoader) { - return ClientPoliciesProfilesLoader.loadClientProfiles('false'); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientPoliciesProfilesEditExecutorCtrl' - }) - .when('/realms/:realm/client-policies/profiles-update/:profileName/update-executor/:executorIndex', { - templateUrl : resourceUrl + '/partials/client-policies-profiles-edit-executor.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientProfiles : function(ClientPoliciesProfilesLoader) { - return ClientPoliciesProfilesLoader.loadClientProfiles('true'); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientPoliciesProfilesEditExecutorCtrl' - }) - .when('/realms/:realm/client-policies/policies', { - templateUrl : resourceUrl + '/partials/client-policies-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientPolicies : function(ClientPoliciesLoader) { - return ClientPoliciesLoader(); - } - }, - controller : 'ClientPoliciesListCtrl' - }) - .when('/realms/:realm/client-policies/policies-json', { - templateUrl : resourceUrl + '/partials/client-policies-json.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientPolicies : function(ClientPoliciesLoader) { - return ClientPoliciesLoader(); - } - }, - controller : 'ClientPoliciesJsonCtrl' - }) - .when('/realms/:realm/client-policies/policy-create', { - templateUrl : resourceUrl + '/partials/client-policies-policy-edit.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientProfiles : function(ClientPoliciesProfilesLoader) { - return ClientPoliciesProfilesLoader.loadClientProfiles('true'); - }, - clientPolicies : function(ClientPoliciesLoader) { - return ClientPoliciesLoader(); - } - }, - controller : 'ClientPoliciesEditCtrl' - }) - .when('/realms/:realm/client-policies/policies-update/:policyName', { - templateUrl : resourceUrl + '/partials/client-policies-policy-edit.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientProfiles : function(ClientPoliciesProfilesLoader) { - return ClientPoliciesProfilesLoader.loadClientProfiles('true'); - }, - clientPolicies : function(ClientPoliciesLoader) { - return ClientPoliciesLoader(); - } - }, - controller : 'ClientPoliciesEditCtrl' - }) - .when('/realms/:realm/client-policies/policies-update/:policyName/create-condition', { - templateUrl : resourceUrl + '/partials/client-policies-policy-edit-condition.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientPolicies : function(ClientPoliciesLoader) { - return ClientPoliciesLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientPoliciesEditConditionCtrl' - }) - .when('/realms/:realm/client-policies/policies-update/:policyName/update-condition/:conditionIndex', { - templateUrl : resourceUrl + '/partials/client-policies-policy-edit-condition.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientPolicies : function(ClientPoliciesLoader) { - return ClientPoliciesLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientPoliciesEditConditionCtrl' - }) - .when('/realms/:realm/keys', { - templateUrl : resourceUrl + '/partials/realm-keys.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - keys: function(RealmKeysLoader) { - return RealmKeysLoader(); - } - }, - controller : 'RealmKeysCtrl' - }) - .when('/realms/:realm/keys/passive', { - templateUrl : resourceUrl + '/partials/realm-keys-passive.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - keys: function(RealmKeysLoader) { - return RealmKeysLoader(); - } - }, - controller : 'RealmKeysCtrl' - }) - .when('/realms/:realm/keys/disabled', { - templateUrl : resourceUrl + '/partials/realm-keys-disabled.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - keys: function(RealmKeysLoader) { - return RealmKeysLoader(); - } - }, - controller : 'RealmKeysCtrl' - }) - .when('/realms/:realm/keys/providers', { - templateUrl : resourceUrl + '/partials/realm-keys-providers.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmKeysProvidersCtrl' - }) - .when('/create/keys/:realm/providers/:provider', { - templateUrl : resourceUrl + '/partials/realm-keys-generic.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function() { - return { - }; - }, - providerId : function($route) { - return $route.current.params.provider; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'GenericKeystoreCtrl' - }) - .when('/realms/:realm/keys/providers/:provider/:componentId', { - templateUrl : resourceUrl + '/partials/realm-keys-generic.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function(ComponentLoader) { - return ComponentLoader(); - }, - providerId : function($route) { - return $route.current.params.provider; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'GenericKeystoreCtrl' - }) - .when('/realms/:realm/identity-provider-settings', { - templateUrl : resourceUrl + '/partials/realm-identity-provider.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - instance : function(IdentityProviderLoader) { - return {}; - }, - providerFactory : function(IdentityProviderFactoryLoader) { - return {}; - }, - authFlows : function(AuthenticationFlowsLoader) { - return {}; - } - }, - controller : 'RealmIdentityProviderCtrl' - }) - .when('/create/identity-provider/:realm/:provider_id', { - templateUrl : function(params){ return resourceUrl + '/partials/realm-identity-provider-' + params.provider_id + '.html'; }, - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - instance : function(IdentityProviderLoader) { - return {}; - }, - providerFactory : function(IdentityProviderFactoryLoader) { - return new IdentityProviderFactoryLoader(); - }, - authFlows : function(AuthenticationFlowsLoader) { - return AuthenticationFlowsLoader(); - } - }, - controller : 'RealmIdentityProviderCtrl' - }) - .when('/realms/:realm/identity-provider-settings/provider/:provider_id/:alias', { - templateUrl : function(params){ return resourceUrl + '/partials/realm-identity-provider-' + params.provider_id + '.html'; }, - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - instance : function(IdentityProviderLoader) { - return IdentityProviderLoader(); - }, - providerFactory : function(IdentityProviderFactoryLoader) { - return IdentityProviderFactoryLoader(); - }, - authFlows : function(AuthenticationFlowsLoader) { - return AuthenticationFlowsLoader(); - } - }, - controller : 'RealmIdentityProviderCtrl' - }) - .when('/realms/:realm/identity-provider-settings/provider/:provider_id/:alias/export', { - templateUrl : resourceUrl + '/partials/realm-identity-provider-export.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - identityProvider : function(IdentityProviderLoader) { - return IdentityProviderLoader(); - }, - providerFactory : function(IdentityProviderFactoryLoader) { - return IdentityProviderFactoryLoader(); - } - }, - controller : 'RealmIdentityProviderExportCtrl' - }) - .when('/realms/:realm/identity-provider-mappers/:alias/mappers', { - templateUrl : function(params){ return resourceUrl + '/partials/identity-provider-mappers.html'; }, - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - identityProvider : function(IdentityProviderLoader) { - return IdentityProviderLoader(); - }, - mapperTypes : function(IdentityProviderMapperTypesLoader) { - return IdentityProviderMapperTypesLoader(); - }, - mappers : function(IdentityProviderMappersLoader) { - return IdentityProviderMappersLoader(); - } - }, - controller : 'IdentityProviderMapperListCtrl' - }) - .when('/realms/:realm/identity-provider-mappers/:alias/mappers/:mapperId', { - templateUrl : function(params){ return resourceUrl + '/partials/identity-provider-mapper-detail.html'; }, - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - identityProvider : function(IdentityProviderLoader) { - return IdentityProviderLoader(); - }, - mapperTypes : function(IdentityProviderMapperTypesLoader) { - return IdentityProviderMapperTypesLoader(); - }, - mapper : function(IdentityProviderMapperLoader) { - return IdentityProviderMapperLoader(); - } - }, - controller : 'IdentityProviderMapperCtrl' - }) - .when('/create/identity-provider-mappers/:realm/:alias', { - templateUrl : function(params){ return resourceUrl + '/partials/identity-provider-mapper-detail.html'; }, - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - identityProvider : function(IdentityProviderLoader) { - return IdentityProviderLoader(); - }, - mapperTypes : function(IdentityProviderMapperTypesLoader) { - return IdentityProviderMapperTypesLoader(); - } - }, - controller : 'IdentityProviderMapperCreateCtrl' - }) - - .when('/realms/:realm/default-roles', { - templateUrl : resourceUrl + '/partials/realm-default-roles.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - roles : function(RoleListLoader) { - return RoleListLoader(); - } - }, - controller : 'RealmDefaultRolesCtrl' - }) - .when('/realms/:realm/smtp-settings', { - templateUrl : resourceUrl + '/partials/realm-smtp.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'RealmSMTPSettingsCtrl' - }) - .when('/realms/:realm/events', { - templateUrl : resourceUrl + '/partials/realm-events.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmEventsCtrl' - }) - .when('/realms/:realm/admin-events', { - templateUrl : resourceUrl + '/partials/realm-events-admin.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmAdminEventsCtrl' - }) - .when('/realms/:realm/events-settings', { - templateUrl : resourceUrl + '/partials/realm-events-config.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - eventsConfig : function(RealmEventsConfigLoader) { - return RealmEventsConfigLoader(); - } - }, - controller : 'RealmEventsConfigCtrl' - }) - .when('/realms/:realm/partial-import', { - templateUrl : resourceUrl + '/partials/partial-import.html', - resolve : { - resourceName : function() { return 'users'}, - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'RealmImportCtrl' - }) - .when('/realms/:realm/partial-export', { - templateUrl : resourceUrl + '/partials/partial-export.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'RealmExportCtrl' - }) - .when('/create/user/:realm', { - templateUrl : resourceUrl + '/partials/user-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function() { - return {}; - } - }, - controller : 'UserDetailCtrl' - }) - .when('/realms/:realm/users/:user', { - templateUrl : resourceUrl + '/partials/user-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(UserLoader) { - return UserLoader(); - } - }, - controller : 'UserDetailCtrl' - }) - .when('/realms/:realm/users/:user/user-attributes', { - templateUrl : resourceUrl + '/partials/user-attributes.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(UserLoader) { - return UserLoader(); - } - }, - controller : 'UserDetailCtrl' - }) - .when('/realms/:realm/users/:user/user-credentials', { - templateUrl : resourceUrl + '/partials/user-credentials.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(UserLoader) { - return UserLoader(); - } - }, - controller : 'UserCredentialsCtrl' - }) - .when('/realms/:realm/users/:user/role-mappings', { - templateUrl : resourceUrl + '/partials/role-mappings.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(UserLoader) { - return UserLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - }, - client : function() { - return {}; - } - }, - controller : 'UserRoleMappingCtrl' - }) - .when('/realms/:realm/users/:user/groups', { - templateUrl : resourceUrl + '/partials/user-group-membership.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(UserLoader) { - return UserLoader(); - } - }, - controller : 'UserGroupMembershipCtrl' - }) - .when('/realms/:realm/users/:user/sessions', { - templateUrl : resourceUrl + '/partials/user-sessions.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(UserLoader) { - return UserLoader(); - }, - sessions : function(UserSessionsLoader) { - return UserSessionsLoader(); - } - }, - controller : 'UserSessionsCtrl' - }) - .when('/realms/:realm/users/:user/federated-identity', { - templateUrl : resourceUrl + '/partials/user-federated-identity-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(UserLoader) { - return UserLoader(); - }, - federatedIdentities : function(UserFederatedIdentityLoader) { - return UserFederatedIdentityLoader(); - } - }, - controller : 'UserFederatedIdentityCtrl' - }) - .when('/create/federated-identity/:realm/:user', { - templateUrl : resourceUrl + '/partials/user-federated-identity-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(UserLoader) { - return UserLoader(); - }, - federatedIdentities : function(UserFederatedIdentityLoader) { - return UserFederatedIdentityLoader(); - } - }, - controller : 'UserFederatedIdentityAddCtrl' - }) - .when('/realms/:realm/users/:user/consents', { - templateUrl : resourceUrl + '/partials/user-consents.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(UserLoader) { - return UserLoader(); - }, - userConsents : function(UserConsentsLoader) { - return UserConsentsLoader(); - } - }, - controller : 'UserConsentsCtrl' - }) - .when('/realms/:realm/users/:user/offline-sessions/:client', { - templateUrl : resourceUrl + '/partials/user-offline-sessions.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(UserLoader) { - return UserLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - offlineSessions : function(UserOfflineSessionsLoader) { - return UserOfflineSessionsLoader(); - } - }, - controller : 'UserOfflineSessionsCtrl' - }) - .when('/realms/:realm/users', { - templateUrl : resourceUrl + '/partials/user-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'UserListCtrl' - }) - - .when('/create/role/:realm', { - templateUrl : resourceUrl + '/partials/role-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - role : function() { - return {}; - }, - roles : function(RoleListLoader) { - return RoleListLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'RoleDetailCtrl' - }) - .when('/realms/:realm/roles/:role', { - templateUrl : resourceUrl + '/partials/role-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - role : function(RoleLoader) { - return RoleLoader(); - }, - roles : function(RoleListLoader) { - return RoleListLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'RoleDetailCtrl' - }) - .when('/realms/:realm/roles/:role/role-attributes', { - templateUrl : resourceUrl + '/partials/role-attributes.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - role : function(RoleLoader) { - return RoleLoader(); - }, - roles : function(RoleListLoader) { - return RoleListLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'RoleDetailCtrl' - }) - .when('/realms/:realm/roles/:role/users', { - templateUrl : resourceUrl + '/partials/realm-role-users.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - role : function(RoleLoader) { - return RoleLoader(); - } - }, - controller : 'RoleMembersCtrl' - }) - .when('/realms/:realm/roles', { - templateUrl : resourceUrl + '/partials/role-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'RoleListCtrl' - }) - .when('/realms/:realm/groups', { - templateUrl : resourceUrl + '/partials/group-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'GroupListCtrl' - }) - .when('/create/group/:realm/parent/:parentId', { - templateUrl : resourceUrl + '/partials/create-group.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - parentId : function($route) { - return $route.current.params.parentId; - } - }, - controller : 'GroupCreateCtrl' - }) - .when('/realms/:realm/groups/:group', { - templateUrl : resourceUrl + '/partials/group-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - group : function(GroupLoader) { - return GroupLoader(); - } - }, - controller : 'GroupDetailCtrl' - }) - .when('/realms/:realm/groups/:group/attributes', { - templateUrl : resourceUrl + '/partials/group-attributes.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - group : function(GroupLoader) { - return GroupLoader(); - } - }, - controller : 'GroupDetailCtrl' - }) - .when('/realms/:realm/groups/:group/members', { - templateUrl : resourceUrl + '/partials/group-members.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - group : function(GroupLoader) { - return GroupLoader(); - } - }, - controller : 'GroupMembersCtrl' - }) - .when('/realms/:realm/groups/:group/role-mappings', { - templateUrl : resourceUrl + '/partials/group-role-mappings.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - group : function(GroupLoader) { - return GroupLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - }, - client : function() { - return {}; - } - }, - controller : 'GroupRoleMappingCtrl' - }) - .when('/realms/:realm/default-groups', { - templateUrl : resourceUrl + '/partials/default-groups.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'DefaultGroupsCtrl' - }) - - - .when('/create/role/:realm/clients/:client', { - templateUrl : resourceUrl + '/partials/client-role-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - role : function() { - return {}; - }, - roles : function(RoleListLoader) { - return RoleListLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'ClientRoleDetailCtrl' - }) - .when('/realms/:realm/clients/:client/roles/:role', { - templateUrl : resourceUrl + '/partials/client-role-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - role : function(ClientRoleLoader) { - return ClientRoleLoader(); - }, - roles : function(RoleListLoader) { - return RoleListLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'ClientRoleDetailCtrl' - }) - .when('/realms/:realm/clients/:client/roles/:role/role-attributes', { - templateUrl : resourceUrl + '/partials/client-role-attributes.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - role : function(ClientRoleLoader) { - return ClientRoleLoader(); - }, - roles : function(RoleListLoader) { - return RoleListLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'ClientRoleDetailCtrl' - }) - .when('/realms/:realm/clients/:client/roles/:role/users', { - templateUrl : resourceUrl + '/partials/client-role-users.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - role : function(ClientRoleLoader) { - return ClientRoleLoader(); - } - }, - controller : 'ClientRoleMembersCtrl' - }) - .when('/realms/:realm/clients/:client/mappers', { - templateUrl : resourceUrl + '/partials/client-mappers.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientProtocolMapperListCtrl' - }) - .when('/realms/:realm/clients/:client/add-mappers', { - templateUrl : resourceUrl + '/partials/client-mappers-add.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'AddBuiltinProtocolMapperCtrl' - }) - .when('/realms/:realm/clients/:client/mappers/:id', { - templateUrl : resourceUrl + '/partials/client-protocol-mapper-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - mapper : function(ClientProtocolMapperLoader) { - return ClientProtocolMapperLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - - }, - controller : 'ClientProtocolMapperCtrl' - }) - .when('/create/client/:realm/:client/mappers', { - templateUrl : resourceUrl + '/partials/client-protocol-mapper-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'ClientProtocolMapperCreateCtrl' - }) - .when('/realms/:realm/clients/:client/client-scopes/setup-scopes', { - templateUrl : resourceUrl + '/partials/client-scopes-setup.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - clientScopes : function(ClientScopeListLoader) { - return ClientScopeListLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - clientDefaultClientScopes : function(ClientDefaultClientScopesLoader) { - return ClientDefaultClientScopesLoader(); - }, - clientOptionalClientScopes : function(ClientOptionalClientScopesLoader) { - return ClientOptionalClientScopesLoader(); - } - }, - controller : 'ClientClientScopesSetupCtrl' - }) - .when('/realms/:realm/clients/:client/client-scopes/evaluate-scopes', { - templateUrl : resourceUrl + '/partials/client-scopes-evaluate.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - }, - clientScopes : function(ClientScopeListLoader) { - return ClientScopeListLoader(); - }, - clientDefaultClientScopes : function(ClientDefaultClientScopesLoader) { - return ClientDefaultClientScopesLoader(); - }, - clientOptionalClientScopes : function(ClientOptionalClientScopesLoader) { - return ClientOptionalClientScopesLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientClientScopesEvaluateCtrl' - }) - .when('/realms/:realm/client-scopes/:clientScope/mappers', { - templateUrl : resourceUrl + '/partials/client-scope-mappers.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientScope : function(ClientScopeLoader) { - return ClientScopeLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientScopeProtocolMapperListCtrl' - }) - .when('/realms/:realm/client-scopes/:clientScope/add-mappers', { - templateUrl : resourceUrl + '/partials/client-scope-mappers-add.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientScope : function(ClientScopeLoader) { - return ClientScopeLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientScopeAddBuiltinProtocolMapperCtrl' - }) - .when('/realms/:realm/client-scopes/:clientScope/mappers/:id', { - templateUrl : resourceUrl + '/partials/client-scope-protocol-mapper-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientScope : function(ClientScopeLoader) { - return ClientScopeLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - mapper : function(ClientScopeProtocolMapperLoader) { - return ClientScopeProtocolMapperLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - - }, - controller : 'ClientScopeProtocolMapperCtrl' - }) - .when('/create/client-scope/:realm/:clientScope/mappers', { - templateUrl : resourceUrl + '/partials/client-scope-protocol-mapper-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - clientScope : function(ClientScopeLoader) { - return ClientScopeLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'ClientScopeProtocolMapperCreateCtrl' - }) - .when('/realms/:realm/clients/:client/sessions', { - templateUrl : resourceUrl + '/partials/client-sessions.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - sessionCount : function(ClientSessionCountLoader) { - return ClientSessionCountLoader(); - } - }, - controller : 'ClientSessionsCtrl' - }) - .when('/realms/:realm/clients/:client/offline-access', { - templateUrl : resourceUrl + '/partials/client-offline-sessions.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - offlineSessionCount : function(ClientOfflineSessionCountLoader) { - return ClientOfflineSessionCountLoader(); - } - }, - controller : 'ClientOfflineSessionsCtrl' - }) - .when('/realms/:realm/clients/:client/credentials', { - templateUrl : resourceUrl + '/partials/client-credentials.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - clientAuthenticatorProviders : function(ClientAuthenticatorProvidersLoader) { - return ClientAuthenticatorProvidersLoader(); - }, - clientConfigProperties: function(PerClientAuthenticationConfigDescriptionLoader) { - return PerClientAuthenticationConfigDescriptionLoader(); - } - }, - controller : 'ClientCredentialsCtrl' - }) - .when('/realms/:realm/clients/:client/oidc/:keyType/import/:attribute', { - templateUrl : resourceUrl + '/partials/client-oidc-key-import.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - callingContext : function() { - return "oidc"; - } - }, - controller : 'ClientCertificateImportCtrl' - }) - .when('/realms/:realm/clients/:client/oidc/:keyType/export/:attribute', { - templateUrl : resourceUrl + '/partials/client-oidc-key-export.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - callingContext : function() { - return "oidc"; - } - }, - controller : 'ClientCertificateExportCtrl' - }) - .when('/realms/:realm/clients/:client/identity-provider', { - templateUrl : resourceUrl + '/partials/client-identity-provider.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientIdentityProviderCtrl' - }) - .when('/realms/:realm/clients/:client/clustering', { - templateUrl : resourceUrl + '/partials/client-clustering.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientClusteringCtrl' - }) - .when('/register-node/realms/:realm/clients/:client/clustering', { - templateUrl : resourceUrl + '/partials/client-clustering-node.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientClusteringNodeCtrl' - }) - .when('/realms/:realm/clients/:client/clustering/:node', { - templateUrl : resourceUrl + '/partials/client-clustering-node.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientClusteringNodeCtrl' - }) - .when('/realms/:realm/clients/:client/saml/keys', { - templateUrl : resourceUrl + '/partials/client-saml-keys.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientSamlKeyCtrl' - }) - .when('/realms/:realm/clients/:client/saml/:keyType/import/:attribute', { - templateUrl : resourceUrl + '/partials/client-saml-key-import.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - callingContext : function() { - return "saml"; - } - }, - controller : 'ClientCertificateImportCtrl' - }) - .when('/realms/:realm/clients/:client/saml/:keyType/export/:attribute', { - templateUrl : resourceUrl + '/partials/client-saml-key-export.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - callingContext : function() { - return "saml"; - } - }, - controller : 'ClientCertificateExportCtrl' - }) - .when('/realms/:realm/clients/:client/oidc/keys', { - templateUrl : resourceUrl + '/partials/client-oidc-keys.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientOidcKeyCtrl' - }) - .when('/realms/:realm/clients/:client/roles', { - templateUrl : resourceUrl + '/partials/client-role-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientRoleListCtrl' - }) - .when('/realms/:realm/clients/:client/revocation', { - templateUrl : resourceUrl + '/partials/client-revocation.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientRevocationCtrl' - }) - .when('/realms/:realm/clients/:client/scope-mappings', { - templateUrl : resourceUrl + '/partials/client-scope-mappings.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'ClientScopeMappingCtrl' - }) - .when('/realms/:realm/clients/:client/installation', { - templateUrl : resourceUrl + '/partials/client-installation.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientInstallationCtrl' - }) - .when('/realms/:realm/clients/:client/service-account-roles', { - templateUrl : resourceUrl + '/partials/client-service-account-roles.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - user : function(ClientServiceAccountUserLoader) { - return ClientServiceAccountUserLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'UserRoleMappingCtrl' - }) - .when('/create/client/:realm', { - templateUrl : resourceUrl + '/partials/create-client.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - }, - client : function() { - return {}; - }, - flows : function(AuthenticationFlowsLoader) { - return AuthenticationFlowsLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'CreateClientCtrl' - }) - .when('/realms/:realm/clients/:client', { - templateUrl : resourceUrl + '/partials/client-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - flows : function(AuthenticationFlowsLoader) { - return AuthenticationFlowsLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientDetailCtrl' - }) - .when('/create/client-scope/:realm', { - templateUrl : resourceUrl + '/partials/client-scope-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientScope : function() { - return {}; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientScopeDetailCtrl' - }) - .when('/realms/:realm/client-scopes/:clientScope', { - templateUrl : resourceUrl + '/partials/client-scope-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientScope : function(ClientScopeLoader) { - return ClientScopeLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientScopeDetailCtrl' - }) - .when('/realms/:realm/client-scopes/:clientScope/scope-mappings', { - templateUrl : resourceUrl + '/partials/client-scope-scope-mappings.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientScope : function(ClientScopeLoader) { - return ClientScopeLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'ClientScopeScopeMappingCtrl' - }) - .when('/realms/:realm/clients', { - templateUrl : resourceUrl + '/partials/client-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - - }, - controller : 'ClientListCtrl' - }) - .when('/realms/:realm/client-scopes', { - templateUrl : resourceUrl + '/partials/client-scope-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientScopes : function(ClientScopeListLoader) { - return ClientScopeListLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - - }, - controller : 'ClientScopeListCtrl' - }) - .when('/realms/:realm/default-client-scopes', { - templateUrl : resourceUrl + '/partials/client-scopes-realm-default.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - clientScopes : function(ClientScopeListLoader) { - return ClientScopeListLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - }, - realmDefaultClientScopes : function(RealmDefaultClientScopesLoader) { - return RealmDefaultClientScopesLoader(); - }, - realmOptionalClientScopes : function(RealmOptionalClientScopesLoader) { - return RealmOptionalClientScopesLoader(); - } - }, - controller : 'ClientScopesRealmDefaultCtrl' - }) - .when('/import/client/:realm', { - templateUrl : resourceUrl + '/partials/client-import.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientImportCtrl' - }) - .when('/realms/:realm/client-stores', { - templateUrl : resourceUrl + '/partials/client-storage-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ClientStoresCtrl' - }) - .when('/realms/:realm/client-storage/providers/:provider/:componentId', { - templateUrl : resourceUrl + '/partials/client-storage-generic.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function(ComponentLoader) { - return ComponentLoader(); - }, - providerId : function($route) { - return $route.current.params.provider; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'GenericClientStorageCtrl' - }) - .when('/create/client-storage/:realm/providers/:provider', { - templateUrl : resourceUrl + '/partials/client-storage-generic.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function() { - return { - - }; - }, - providerId : function($route) { - return $route.current.params.provider; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'GenericClientStorageCtrl' - }) - .when('/', { - templateUrl : resourceUrl + '/partials/home.html', - controller : 'HomeCtrl' - }) - .when('/mocks/:realm', { - templateUrl : resourceUrl + '/partials/realm-detail_mock.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmDetailCtrl' - }) - .when('/realms/:realm/sessions/revocation', { - templateUrl : resourceUrl + '/partials/session-revocation.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'RealmRevocationCtrl' - }) - .when('/realms/:realm/sessions/realm', { - templateUrl : resourceUrl + '/partials/session-realm.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - stats : function(RealmClientSessionStatsLoader) { - return RealmClientSessionStatsLoader(); - } - }, - controller : 'RealmSessionStatsCtrl' - }) - .when('/create/user-storage/:realm/providers/ldap', { - templateUrl : resourceUrl + '/partials/user-storage-ldap.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function() { - return { - - }; - }, - providerId : function($route) { - return $route.current.params.provider; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'LDAPUserStorageCtrl' - }) - .when('/create/user-storage/:realm/providers/kerberos', { - templateUrl : resourceUrl + '/partials/user-storage-kerberos.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function() { - return { - - }; - }, - providerId : function($route) { - return "kerberos"; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'GenericUserStorageCtrl' - }) - .when('/create/user-storage/:realm/providers/:provider', { - templateUrl : resourceUrl + '/partials/user-storage-generic.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function() { - return { - - }; - }, - providerId : function($route) { - return $route.current.params.provider; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'GenericUserStorageCtrl' - }) - .when('/realms/:realm/user-storage/providers/ldap/:componentId', { - templateUrl : resourceUrl + '/partials/user-storage-ldap.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function(ComponentLoader) { - return ComponentLoader(); - }, - providerId : function($route) { - return $route.current.params.provider; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'LDAPUserStorageCtrl' - }) - .when('/realms/:realm/user-storage/providers/kerberos/:componentId', { - templateUrl : resourceUrl + '/partials/user-storage-kerberos.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function(ComponentLoader) { - return ComponentLoader(); - }, - providerId : function($route) { - return "kerberos"; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'GenericUserStorageCtrl' - }) - .when('/realms/:realm/user-storage/providers/:provider/:componentId', { - templateUrl : resourceUrl + '/partials/user-storage-generic.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - instance : function(ComponentLoader) { - return ComponentLoader(); - }, - providerId : function($route) { - return $route.current.params.provider; - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'GenericUserStorageCtrl' - }) - .when('/realms/:realm/ldap-mappers/:componentId', { - templateUrl : function(params){ return resourceUrl + '/partials/user-storage-ldap-mappers.html'; }, - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - provider : function(ComponentLoader) { - return ComponentLoader(); - }, - mappers : function(ComponentsLoader, $route) { - return ComponentsLoader.loadComponents($route.current.params.componentId, 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper'); - } - }, - controller : 'LDAPMapperListCtrl' - }) - .when('/create/ldap-mappers/:realm/:componentId', { - templateUrl : function(params){ return resourceUrl + '/partials/user-storage-ldap-mapper-detail.html'; }, - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - provider : function(ComponentLoader) { - return ComponentLoader(); - }, - mapperTypes : function(SubComponentTypesLoader, $route) { - return SubComponentTypesLoader.loadComponents($route.current.params.componentId, 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper'); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'LDAPMapperCreateCtrl' - }) - .when('/realms/:realm/ldap-mappers/:componentId/mappers/:mapperId', { - templateUrl : function(params){ return resourceUrl + '/partials/user-storage-ldap-mapper-detail.html'; }, - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - provider : function(ComponentLoader) { - return ComponentLoader(); - }, - mapperTypes : function(SubComponentTypesLoader, $route) { - return SubComponentTypesLoader.loadComponents($route.current.params.componentId, 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper'); - }, - mapper : function(LDAPMapperLoader) { - return LDAPMapperLoader(); - }, - clients : function(ClientListLoader) { - return ClientListLoader(); - } - }, - controller : 'LDAPMapperCtrl' - }) - .when('/realms/:realm/user-federation', { - templateUrl : resourceUrl + '/partials/user-federation.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'UserFederationCtrl' - }) - .when('/realms/:realm/defense/headers', { - templateUrl : resourceUrl + '/partials/defense-headers.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - - }, - controller : 'DefenseHeadersCtrl' - }) - .when('/realms/:realm/defense/brute-force', { - templateUrl : resourceUrl + '/partials/brute-force.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'RealmBruteForceCtrl' - }) - .when('/realms/:realm/protocols', { - templateUrl : resourceUrl + '/partials/protocol-list.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - - }, - controller : 'ProtocolListCtrl' - }) - .when('/realms/:realm/authentication/flows', { - templateUrl : resourceUrl + '/partials/authentication-flows.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - flows : function(AuthenticationFlowsLoader) { - return AuthenticationFlowsLoader(); - }, - selectedFlow : function() { - return null; - } - }, - controller : 'AuthenticationFlowsCtrl' - }) - .when('/realms/:realm/authentication/flow-bindings', { - templateUrl : resourceUrl + '/partials/authentication-flow-bindings.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - flows : function(AuthenticationFlowsLoader) { - return AuthenticationFlowsLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmFlowBindingCtrl' - }) - .when('/realms/:realm/authentication/flows/:flow', { - templateUrl : resourceUrl + '/partials/authentication-flows.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - flows : function(AuthenticationFlowsLoader) { - return AuthenticationFlowsLoader(); - }, - selectedFlow : function($route) { - return $route.current.params.flow; - } - }, - controller : 'AuthenticationFlowsCtrl' - }) - .when('/realms/:realm/authentication/flows/:flow/create/execution/:topFlow', { - templateUrl : resourceUrl + '/partials/create-execution.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - topFlow: function($route) { - return $route.current.params.topFlow; - }, - parentFlow : function(AuthenticationFlowLoader) { - return AuthenticationFlowLoader(); - }, - formActionProviders : function(AuthenticationFormActionProvidersLoader) { - return AuthenticationFormActionProvidersLoader(); - }, - authenticatorProviders : function(AuthenticatorProvidersLoader) { - return AuthenticatorProvidersLoader(); - }, - clientAuthenticatorProviders : function(ClientAuthenticatorProvidersLoader) { - return ClientAuthenticatorProvidersLoader(); - } - }, - controller : 'CreateExecutionCtrl' - }) - .when('/realms/:realm/authentication/flows/:flow/create/flow/execution/:topFlow', { - templateUrl : resourceUrl + '/partials/create-flow-execution.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - topFlow: function($route) { - return $route.current.params.topFlow; - }, - parentFlow : function(AuthenticationFlowLoader) { - return AuthenticationFlowLoader(); - }, - formProviders : function(AuthenticationFormProvidersLoader) { - return AuthenticationFormProvidersLoader(); - } - }, - controller : 'CreateExecutionFlowCtrl' - }) - .when('/realms/:realm/authentication/create/flow', { - templateUrl : resourceUrl + '/partials/create-flow.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'CreateFlowCtrl' - }) - .when('/realms/:realm/authentication/required-actions', { - templateUrl : resourceUrl + '/partials/required-actions.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - unregisteredRequiredActions : function(UnregisteredRequiredActionsListLoader) { - return UnregisteredRequiredActionsListLoader(); - } - }, - controller : 'RequiredActionsCtrl' - }) - .when('/realms/:realm/authentication/password-policy', { - templateUrl : resourceUrl + '/partials/password-policy.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmPasswordPolicyCtrl' - }) - .when('/realms/:realm/authentication/otp-policy', { - templateUrl : resourceUrl + '/partials/otp-policy.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmOtpPolicyCtrl' - }) - .when('/realms/:realm/authentication/webauthn-policy', { - templateUrl : resourceUrl + '/partials/webauthn-policy.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmWebAuthnPolicyCtrl' - }) - .when('/realms/:realm/authentication/webauthn-policy-passwordless', { - templateUrl : resourceUrl + '/partials/webauthn-policy-passwordless.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmWebAuthnPasswordlessPolicyCtrl' - }) - .when('/realms/:realm/authentication/ciba-policy', { - templateUrl : resourceUrl + '/partials/ciba-policy.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'RealmCibaPolicyCtrl' - }) - .when('/realms/:realm/authentication/flows/:flow/config/:provider/:config', { - templateUrl : resourceUrl + '/partials/authenticator-config.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - flow : function(AuthenticationFlowLoader) { - return AuthenticationFlowLoader(); - }, - configType : function(AuthenticationConfigDescriptionLoader) { - return AuthenticationConfigDescriptionLoader(); - }, - config : function(AuthenticationConfigLoader) { - return AuthenticationConfigLoader(); - } - }, - controller : 'AuthenticationConfigCtrl' - }) - .when('/create/authentication/:realm/flows/:flow/execution/:executionId/provider/:provider', { - templateUrl : resourceUrl + '/partials/authenticator-config.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - flow : function(AuthenticationFlowLoader) { - return AuthenticationFlowLoader(); - }, - configType : function(AuthenticationConfigDescriptionLoader) { - return AuthenticationConfigDescriptionLoader(); - }, - execution : function(ExecutionIdLoader) { - return ExecutionIdLoader(); - } - }, - controller : 'AuthenticationConfigCreateCtrl' - }) - .when('/create/localization/:realm/:locale', { - templateUrl : resourceUrl + '/partials/realm-localization-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - locale: function($route) { - return $route.current.params.locale; - }, - key: function() { - return null - }, - localizationText : function() { - return null; - } - }, - controller : 'RealmLocalizationDetailCtrl' - }) - .when('/realms/:realm/localization/:locale/:key', { - templateUrl : resourceUrl + '/partials/realm-localization-detail.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - locale: function($route) { - return $route.current.params.locale; - }, - key: function($route) { - return $route.current.params.key; - }, - localizationText : function(RealmSpecificlocalizationTextLoader) { - return RealmSpecificlocalizationTextLoader(); - } - }, - controller : 'RealmLocalizationDetailCtrl' - }) - .when('/server-info', { - templateUrl : resourceUrl + '/partials/server-info.html', - resolve : { - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ServerInfoCtrl' - }) - .when('/server-info/providers', { - templateUrl : resourceUrl + '/partials/server-info-providers.html', - resolve : { - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller : 'ServerInfoCtrl' - }) - .when('/logout', { - templateUrl : resourceUrl + '/partials/home.html', - controller : 'LogoutCtrl' - }) - .when('/notfound', { - templateUrl : resourceUrl + '/partials/notfound.html' - }) - .when('/forbidden', { - templateUrl : resourceUrl + '/partials/forbidden.html' - }) - .otherwise({ - templateUrl : resourceUrl + '/partials/pagenotfound.html' - }); -} ]); - -module.config(function($httpProvider) { - $httpProvider.interceptors.push('errorInterceptor'); - - var spinnerFunction = function(data, headersGetter) { - if (resourceRequests == 0) { - loadingTimer = window.setTimeout(function() { - $('#loading').show(); - loadingTimer = -1; - }, 500); - } - resourceRequests++; - return data; - }; - $httpProvider.defaults.transformRequest.push(spinnerFunction); - - $httpProvider.interceptors.push('spinnerInterceptor'); - $httpProvider.interceptors.push('authInterceptor'); - -}); - -module.factory('spinnerInterceptor', function($q, $window, $rootScope, $location) { - return { - response: function(response) { - resourceRequests--; - if (resourceRequests == 0) { - if(loadingTimer != -1) { - window.clearTimeout(loadingTimer); - loadingTimer = -1; - } - $('#loading').hide(); - } - return response; - }, - responseError: function(response) { - resourceRequests--; - if (resourceRequests == 0) { - if(loadingTimer != -1) { - window.clearTimeout(loadingTimer); - loadingTimer = -1; - } - $('#loading').hide(); - } - - return $q.reject(response); - } - }; -}); - -module.factory('errorInterceptor', function($q, $window, $rootScope, $location, Notifications, Auth) { - return { - response: function(response) { - return response; - }, - responseError: function(response) { - if (response.status == 401) { - Auth.authz.logout(); - } else if (response.status == 403) { - $location.path('/forbidden'); - } else if (response.status == 404) { - $location.path('/notfound'); - } else if (response.status) { - if (response.data && response.data.errorMessage) { - Notifications.error(response.data.errorMessage); - } else if (response.data && response.data.errors) { - var messages = "Multiple errors found: "; - - for (var i = 0; i < response.data.errors.length; i++) { - messages+=response.data.errors[i].errorMessage + " "; - } - - Notifications.error(messages); - } else if (response.data && response.data.error_description) { - Notifications.error(response.data.error_description); - } else { - Notifications.error("An unexpected server error has occurred"); - } - } else { - Notifications.error("No response from server."); - } - return $q.reject(response); - } - }; -}); - -// collapsable form fieldsets -module.directive('collapsable', function() { - return function(scope, element, attrs) { - element.click(function() { - $(this).toggleClass('collapsed'); - $(this).find('.toggle-icons').toggleClass('kc-icon-collapse').toggleClass('kc-icon-expand'); - $(this).find('.toggle-icons').text($(this).text() == "Icon: expand" ? "Icon: collapse" : "Icon: expand"); - $(this).parent().find('.form-group').toggleClass('hidden'); - }); - } -}); - -// collapsable form fieldsets -module.directive('uncollapsed', function() { - return function(scope, element, attrs) { - element.prepend(' '); - element.click(function() { - $(this).find('.toggle-class').toggleClass('fa-angle-down').toggleClass('fa-angle-right'); - $(this).parent().find('.form-group').toggleClass('hidden'); - }); - } -}); - -// collapsable form fieldsets -module.directive('collapsed', function() { - return function(scope, element, attrs) { - element.prepend(' '); - element.parent().find('.form-group').toggleClass('hidden'); - element.click(function() { - $(this).find('.toggle-class').toggleClass('fa-angle-down').toggleClass('fa-angle-right'); - $(this).parent().find('.form-group').toggleClass('hidden'); - }); - } -}); - -/** - * Directive for presenting an ON-OFF switch for checkbox. - * Usage: - */ -module.directive('onoffswitch', function() { - return { - restrict: "EA", - replace: true, - scope: { - name: '@', - id: '@', - ngModel: '=', - ngDisabled: '=', - kcOnText: '@onText', - kcOffText: '@offText' - }, - // TODO - The same code acts differently when put into the templateURL. Find why and move the code there. - //templateUrl: "templates/kc-switch.html", - template: "
", - compile: function(element, attrs) { - /* - We don't want to propagate basic attributes to the root element of directive. Id should be passed to the - input element only to achieve proper label binding (and validity). - */ - element.removeAttr('name'); - element.removeAttr('id'); - - if (!attrs.onText) { attrs.onText = "ON"; } - if (!attrs.offText) { attrs.offText = "OFF"; } - - element.bind('keydown', function(e){ - var code = e.keyCode || e.which; - if (code === 32 || code === 13) { - e.stopImmediatePropagation(); - e.preventDefault(); - $(e.target).find('input').click(); - } - }); - } - } -}); - -/** - * Directive for presenting an ON-OFF switch for checkbox. The directive expects the value to be string 'true' or 'false', not boolean true/false - * This directive provides some additional capabilities to the default onoffswitch such as: - * - * - Dynamic values for id and name attributes. Useful if you need to use this directive inside a ng-repeat - * - Specific scope to specify the value. Instead of just true or false. - * - * Usage: - */ -module.directive('onoffswitchstring', function() { - return { - restrict: "EA", - replace: true, - scope: { - name: '=', - id: '=', - value: '=', - ngModel: '=', - ngDisabled: '=', - kcOnText: '@onText', - kcOffText: '@offText' - }, - // TODO - The same code acts differently when put into the templateURL. Find why and move the code there. - //templateUrl: "templates/kc-switch.html", - template: '
', - compile: function(element, attrs) { - - if (!attrs.onText) { attrs.onText = "ON"; } - if (!attrs.offText) { attrs.offText = "OFF"; } - - element.bind('keydown click', function(e){ - var code = e.keyCode || e.which; - if (code === 32 || code === 13) { - e.stopImmediatePropagation(); - e.preventDefault(); - $(e.target).find('input').click(); - } - }); - } - } -}); - -/** - * Directive for presenting an ON-OFF switch for checkbox. The directive expects the true-value or false-value to be string like 'true' or 'false', not boolean true/false. - * This directive provides some additional capabilities to the default onoffswitch such as: - * - * - Specific scope to specify the value. Instead of just 'true' or 'false' you can use any other values. For example: true-value="'foo'" false-value="'bar'" . - * But 'true'/'false' are defaults if true-value and false-value are not specified - * - * Usage: - */ -module.directive('onoffswitchvalue', function() { - return { - restrict: "EA", - replace: true, - scope: { - name: '@', - id: '@', - trueValue: '@', - falseValue: '@', - ngModel: '=', - ngDisabled: '=', - kcOnText: '@onText', - kcOffText: '@offText' - }, - // TODO - The same code acts differently when put into the templateURL. Find why and move the code there. - //templateUrl: "templates/kc-switch.html", - template: "
", - compile: function(element, attrs) { - /* - We don't want to propagate basic attributes to the root element of directive. Id should be passed to the - input element only to achieve proper label binding (and validity). - */ - element.removeAttr('name'); - element.removeAttr('id'); - - if (!attrs.trueValue) { attrs.trueValue = "'true'"; } - if (!attrs.falseValue) { attrs.falseValue = "'false'"; } - - if (!attrs.onText) { attrs.onText = "ON"; } - if (!attrs.offText) { attrs.offText = "OFF"; } - - element.bind('keydown', function(e){ - var code = e.keyCode || e.which; - if (code === 32 || code === 13) { - e.stopImmediatePropagation(); - e.preventDefault(); - $(e.target).find('input').click(); - } - }); - } - } -}); - -module.directive('kcInput', function() { - var d = { - scope : true, - replace : false, - link : function(scope, element, attrs) { - var form = element.children('form'); - var label = element.children('label'); - var input = element.children('input'); - - var id = form.attr('name') + '.' + input.attr('name'); - - element.attr('class', 'control-group'); - - label.attr('class', 'control-label'); - label.attr('for', id); - - input.wrap('
'); - input.attr('id', id); - - if (!input.attr('placeHolder')) { - input.attr('placeHolder', label.text()); - } - - if (input.attr('required')) { - label.append(' *'); - } - } - }; - return d; -}); - -module.directive('kcEnter', function() { - return function(scope, element, attrs) { - element.bind("keydown keypress", function(event) { - if (event.which === 13) { - scope.$apply(function() { - scope.$eval(attrs.kcEnter); - }); - - event.preventDefault(); - } - }); - }; -}); - -// Don't allow URI reserved characters -module.directive('kcNoReservedChars', function (Notifications, $translate) { - return function($scope, element) { - element.bind("keypress", function(event) { - var keyPressed = String.fromCharCode(event.which || event.keyCode || 0); - - // ] and ' can not be used inside a character set on POSIX and GNU - if (keyPressed.match('[:/?#[@!$&()*+,;=]') || keyPressed === ']' || keyPressed === '\'') { - event.preventDefault(); - $scope.$apply(function() { - Notifications.warn($translate.instant('key-not-allowed-here', {character: keyPressed})); - }); - } - }); - }; -}); - -module.directive('kcSave', function ($compile, $timeout, Notifications) { - var clickDelay = 500; // 500 ms - - return { - restrict: 'A', - link: function ($scope, elem, attr, ctrl) { - elem.addClass("btn btn-primary"); - elem.attr("type","submit"); - - var disabled = false; - elem.on('click', function(evt) { - if ($scope.hasOwnProperty("changed") && !$scope.changed) return; - - // KEYCLOAK-4121: Prevent double form submission - if (disabled) { - evt.preventDefault(); - evt.stopImmediatePropagation(); - return; - } else { - disabled = true; - $timeout(function () { disabled = false; }, clickDelay, false); - } - - $scope.$apply(function() { - var form = elem.closest('form'); - if (form && form.attr('name')) { - var ngValid = form.find('.ng-valid'); - if ($scope[form.attr('name')].$valid) { - //ngValid.removeClass('error'); - ngValid.parent().removeClass('has-error'); - $scope['save'](); - } else { - Notifications.error("Missing or invalid field(s). Please verify the fields in red.") - //ngValid.removeClass('error'); - ngValid.parent().removeClass('has-error'); - - var ngInvalid = form.find('.ng-invalid'); - //ngInvalid.addClass('error'); - ngInvalid.parent().addClass('has-error'); - } - } - }); - }) - } - } -}); - -module.directive('kcReset', function ($compile, Notifications) { - return { - restrict: 'A', - link: function ($scope, elem, attr, ctrl) { - elem.addClass("btn btn-default"); - elem.attr("type","submit"); - elem.bind('click', function() { - $scope.$apply(function() { - var form = elem.closest('form'); - if (form && form.attr('name')) { - form.find('.ng-valid').removeClass('error'); - form.find('.ng-invalid').removeClass('error'); - $scope['reset'](); - } - }) - }) - } - } -}); - -module.directive('kcCancel', function ($compile, Notifications) { - return { - restrict: 'A', - link: function ($scope, elem, attr, ctrl) { - elem.addClass("btn btn-default"); - elem.attr("type","submit"); - } - } -}); - -module.directive('kcDelete', function ($compile, Notifications) { - return { - restrict: 'A', - link: function ($scope, elem, attr, ctrl) { - elem.addClass("btn btn-danger"); - elem.attr("type","submit"); - } - } -}); - - -module.directive('kcDropdown', function ($compile, Notifications) { - return { - scope: { - kcOptions: '=', - kcModel: '=', - id: "=", - kcPlaceholder: '@' - }, - restrict: 'EA', - replace: true, - templateUrl: resourceUrl + '/templates/kc-select.html', - link: function(scope, element, attr) { - scope.updateModel = function(item) { - scope.kcModel = item; - }; - } - } -}); - -module.directive('kcReadOnly', function() { - var disabled = {}; - - var d = { - replace : false, - link : function(scope, element, attrs) { - var disable = function(i, e) { - if (!e.disabled) { - disabled[e.tagName + i] = true; - e.disabled = true; - } - } - - var enable = function(i, e) { - if (disabled[e.tagName + i]) { - e.disabled = false; - delete disabled[i]; - } - } - - var filterIgnored = function(i, e){ - return !e.attributes['kc-read-only-ignore']; - } - - scope.$watch(attrs.kcReadOnly, function(readOnly) { - if (readOnly) { - element.find('input').filter(filterIgnored).each(disable); - element.find('button').filter(filterIgnored).each(disable); - element.find('select').filter(filterIgnored).each(disable); - element.find('textarea').filter(filterIgnored).each(disable); - } else { - element.find('input').filter(filterIgnored).each(enable); - element.find('input').filter(filterIgnored).each(enable); - element.find('button').filter(filterIgnored).each(enable); - element.find('select').filter(filterIgnored).each(enable); - element.find('textarea').filter(filterIgnored).each(enable); - } - }); - } - }; - return d; -}); - -module.directive('kcMenu', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-menu.html' - } -}); - -module.directive('kcTabsRealm', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-realm.html' - } -}); - -module.directive('kcTabsAuthentication', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-authentication.html' - } -}); - -module.directive('kcTabsRole', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-role.html' - } -}); - -module.directive('kcTabsClientRole', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-client-role.html' - } -}); - -module.directive('kcTabsUser', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-user.html' - } -}); - -module.directive('kcTabsUsers', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-users.html' - } -}); - -module.directive('kcTabsClients', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-clients.html' - } -}); - -module.directive('kcTabsGroup', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-group.html' - } -}); - -module.directive('kcTabsGroupList', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-group-list.html' - } -}); - -module.directive('kcTabsClient', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-client.html' - } -}); - -module.directive('kcTabsClientScope', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-client-scope.html' - } -}); - -module.directive('kcNavigationUser', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-navigation-user.html' - } -}); - -module.directive('kcTabsIdentityProvider', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-identity-provider.html' - } -}); - -module.directive('kcTabsUserFederation', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-user-federation.html' - } -}); - -module.directive('kcTabsLdap', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/kc-tabs-ldap.html' - } -}); - -module.controller('RoleSelectorModalCtrl', function($scope, realm, config, configName, RealmRoles, Client, ClientRole, $modalInstance) { - $scope.selectedRealmRole = { - role: undefined - }; - $scope.selectedClientRole = { - role: undefined - }; - $scope.client = { - selected: undefined - }; - - $scope.selectRealmRole = function() { - config[configName] = $scope.selectedRealmRole.role.name; - $modalInstance.close(); - } - - $scope.selectClientRole = function() { - config[configName] = $scope.selectedClient.clientId + "." + $scope.selectedClientRole.role.name; - $modalInstance.close(); - } - - $scope.cancel = function() { - $modalInstance.dismiss(); - } - - clientSelectControl($scope, realm.realm, Client); - - $scope.selectedClient = null; - - $scope.changeClient = function(client) { - $scope.selectedClient = client; - if (!client || !client.id) { - $scope.selectedClient = null; - return; - } - if ($scope.selectedClient) { - ClientRole.query({realm: realm.realm, client: $scope.selectedClient.id}, function (data) { - $scope.clientRoles = data; - }); - } else { - console.log('selected client was null'); - $scope.clientRoles = null; - } - - $scope.selectedClient = client; - } - - RealmRoles.query({realm: realm.realm}, function(data) { - $scope.realmRoles = data; - }) -}); - -module.controller('GroupSelectorModalCtrl', function($scope, $q, realm, config, configName, GroupsCount, Groups, Group, GroupChildren, Notifications, Dialog, ComponentUtils, $modalInstance, $translate) { - $scope.realm = realm; - $scope.groupList = [ - { - "id" : "realm", - "name": $translate.instant('groups'), - "subGroups" : [] - } - ]; - $scope.groupSelector = { - searchCriteria: undefined, - currentPage: 1, - pageSize: 20, - numberOfPages: 1 - }; - $scope.groupSelector.currentPageInput = $scope.groupSelector.currentPage; - - var refreshGroups = function (search) { - console.log('refreshGroups'); - $scope.groupSelector.currentPageInput = $scope.groupSelector.currentPage; - - var first = ($scope.groupSelector.currentPage * $scope.groupSelector.pageSize) - $scope.groupSelector.pageSize; - console.log('first:' + first); - var queryParams = { - realm : realm.realm, - first : first, - max : $scope.groupSelector.pageSize - }; - var countParams = { - realm : realm.realm, - top : 'true' - }; - - if(angular.isDefined(search) && search !== '') { - queryParams.search = search; - countParams.search = search; - } - - var promiseGetGroups = $q.defer(); - Groups.query(queryParams, function(entry) { - promiseGetGroups.resolve(entry); - }, function() { - promiseGetGroups.reject($translate.instant('group.fetch.fail', {params: queryParams})); - }); - promiseGetGroups.promise.then(function(groups) { - $scope.groupList = [ - { - "id" : "realm", - "name": $translate.instant('groups'), - "subGroups": ComponentUtils.sortGroups('name', groups) - } - ]; - if (angular.isDefined(search) && search !== '') { - // Add highlight for concrete text match - setTimeout(function () { - document.querySelectorAll('span').forEach(function (element) { - if (element.textContent.indexOf(search) != -1) { - angular.element(element).addClass('highlight'); - } - }); - }, 500); - } - }, function (failed) { - Notifications.error(failed); - }); - - var promiseCount = $q.defer(); - console.log('countParams: realm[' + countParams.realm); - GroupsCount.query(countParams, function(entry) { - promiseCount.resolve(entry); - }, function() { - promiseCount.reject($translate.instant('group.fetch.fail', {params: countParams})); - }); - promiseCount.promise.then(function(entry) { - if(angular.isDefined(entry.count) && entry.count > $scope.groupSelector.pageSize) { - $scope.groupSelector.numberOfPages = Math.ceil(entry.count/$scope.groupSelector.pageSize); - } else { - $scope.groupSelector.numberOfPages = 1; - } - }, function (failed) { - Notifications.error(failed); - }); - }; - - refreshGroups(); - - $scope.$watch('groupSelector.currentPage', function(newValue, oldValue) { - if(parseInt(newValue, 10) !== oldValue) { - refreshGroups($scope.groupSelector.searchCriteria); - } - }); - - $scope.clearSearch = function() { - $scope.groupSelector.searchCriteria = ''; - if (parseInt($scope.groupSelector.currentPage, 10) === 1) { - refreshGroups(); - } else { - $scope.groupSelector.currentPage = 1; - } - }; - - $scope.searchGroup = function() { - if (parseInt($scope.groupSelector.currentPage, 10) === 1) { - refreshGroups($scope.groupSelector.searchCriteria); - } else { - $scope.groupSelector.currentPage = 1; - } - }; - - $scope.selectGroup = function(selected) { - if(!selected || selected.id === "realm") return; - - config[configName] = selected.path; - $modalInstance.close(); - } - - $scope.edit = $scope.selectGroup; - - $scope.cancel = function() { - $modalInstance.dismiss(); - } - - var isLeaf = function(node) { - return node.id !== "realm" && (!node.subGroups || node.subGroups.length === 0); - }; - - $scope.getGroupClass = function(node) { - if (node.id === "realm") { - return 'pficon pficon-users'; - } - if (isLeaf(node)) { - return 'normal'; - } - if (node.subGroups.length && node.collapsed) return 'collapsed'; - if (node.subGroups.length && !node.collapsed) return 'expanded'; - return 'collapsed'; - - }; - - $scope.getSelectedClass = function(node) { - if (node.selected) { - return 'selected'; - } - return undefined; - } -}); - - -module.controller('ProviderConfigCtrl', function ($modal, $scope, $route, ComponentUtils, Client) { - clientSelectControl($scope, $route.current.params.realm, Client); - $scope.fileNames = {}; - $scope.newMapEntries = {}; - var cachedMaps = {}; - var cachedParsedMaps = {}; - var focusMapValueId = null; - - // KEYCLOAK-4463 - $scope.initEditor = function(editor){ - editor.$blockScrolling = Infinity; // suppress warning message - }; - - $scope.initSelectedClient = function(configName, config) { - if(config[configName]) { - $scope.selectedClient = null; - Client.query({realm: $route.current.params.realm, search: false, clientId: config[configName], max: 1}, function(data) { - if(data.length > 0) { - $scope.selectedClient = angular.copy(data[0]); - $scope.selectedClient.text = $scope.selectedClient.clientId; - } - }); - } - } - - $scope.openRoleSelector = function (configName, config) { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/role-selector.html', - controller: 'RoleSelectorModalCtrl', - resolve: { - realm: function () { - return $scope.realm; - }, - config: function () { - return config; - }, - configName: function () { - return configName; - } - } - }) - } - - $scope.openGroupSelector = function (configName, config) { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/group-selector.html', - controller: 'GroupSelectorModalCtrl', - resolve: { - realm: function () { - return $scope.realm; - }, - config: function () { - return config; - }, - configName: function () { - return configName; - } - } - }) - } - - $scope.changeClient = function(configName, config, client, multivalued) { - if (!client || !client.id) { - config[configName] = null; - $scope.selectedClient = null; - return; - } - $scope.selectedClient = client; - if (multivalued) { - config[configName][0] = client.clientId; - } else { - config[configName] = client.clientId; - } - }; - - ComponentUtils.convertAllMultivaluedStringValuesToList($scope.properties, $scope.config); - - ComponentUtils.addLastEmptyValueToMultivaluedLists($scope.properties, $scope.config); - - $scope.addValueToMultivalued = function(optionName) { - var configProperty = $scope.config[optionName]; - var lastIndex = configProperty.length - 1; - var lastValue = configProperty[lastIndex]; - console.log("Option=" + optionName + ", lastIndex=" + lastIndex + ", lastValue=" + lastValue); - - if (lastValue.length > 0) { - configProperty.push(''); - } - } - - $scope.deleteValueFromMultivalued = function(optionName, index) { - $scope.config[optionName].splice(index, 1); - } - - $scope.uploadFile = function($files, optionName, config) { - var reader = new FileReader(); - reader.onload = function(e) { - $scope.$apply(function() { - config[optionName][0] = e.target.result; - }); - }; - reader.readAsText($files[0]); - $scope.fileNames[optionName] = $files[0].name; - } - - $scope.addMapEntry = function(optionName) { - $scope.removeMapEntry(optionName, $scope.newMapEntries[optionName].key) - - var parsedMap = JSON.parse($scope.config[optionName]); - parsedMap.push($scope.newMapEntries[optionName]); - $scope.config[optionName] = JSON.stringify(parsedMap); - - delete $scope.newMapEntries[optionName]; - } - - $scope.removeMapEntry = function(optionName, key) { - var parsedMap = JSON.parse($scope.config[optionName]); - - for(var i = parsedMap.length - 1; i >= 0; i--) { - if(parsedMap[i]['key'] === key) { - parsedMap.splice(i, 1); - } - } - - $scope.config[optionName] = JSON.stringify(parsedMap); - } - - $scope.updateMapEntry = function(optionName, key, value) { - var parsedMap = JSON.parse($scope.config[optionName]); - - for(var i = parsedMap.length - 1; i >= 0; i--) { - if(parsedMap[i]['key'] === key) { - parsedMap[i]['value'] = value; - } - } - $scope.config[optionName] = JSON.stringify(parsedMap); - - focusMapValueId = "mapValue-" + optionName + "-" + key; - } - - $scope.jsonParseMap = function(optionName) { - - if(cachedParsedMaps[optionName] === undefined) { - cachedMaps[optionName] = "[]"; - cachedParsedMaps[optionName] = []; - - if(!$scope.config.hasOwnProperty(optionName)){ - $scope.config[optionName]=cachedMaps[optionName]; - } else { - cachedMaps[optionName] = $scope.config[optionName]; - cachedParsedMaps[optionName] = JSON.parse(cachedMaps[optionName]); - } - } - - var mapChanged = $scope.config[optionName] !== cachedMaps[optionName]; - - if(mapChanged){ - cachedMaps[optionName] = $scope.config[optionName]; - cachedParsedMaps[optionName] = JSON.parse(cachedMaps[optionName]); - } - - if(!mapChanged && focusMapValueId !== null){ - document.getElementById(focusMapValueId).focus(); - focusMapValueId = null; - } - - return cachedParsedMaps[optionName]; - } -}); - -module.directive('kcProviderConfig', function ($modal) { - return { - scope: { - config: '=', - properties: '=', - realm: '=', - clients: '=', - configName: '=' - }, - restrict: 'E', - replace: true, - controller: 'ProviderConfigCtrl', - templateUrl: resourceUrl + '/templates/kc-provider-config.html' - } -}); - -module.controller('ComponentRoleSelectorModalCtrl', function($scope, realm, config, configName, RealmRoles, Client, ClientRole, $modalInstance) { - $scope.selectedRealmRole = { - role: undefined - }; - $scope.selectedClientRole = { - role: undefined - }; - $scope.client = { - selected: undefined - }; - - $scope.selectRealmRole = function() { - config[configName][0] = $scope.selectedRealmRole.role.name; - $modalInstance.close(); - } - - $scope.selectClientRole = function() { - config[configName][0] = $scope.client.selected.clientId + "." + $scope.selectedClientRole.role.name; - $modalInstance.close(); - } - - $scope.cancel = function() { - $modalInstance.dismiss(); - } - - $scope.changeClient = function() { - if ($scope.client.selected) { - ClientRole.query({realm: realm.realm, client: $scope.client.selected.id}, function (data) { - $scope.clientRoles = data; - }); - } else { - console.log('selected client was null'); - $scope.clientRoles = null; - } - - } - RealmRoles.query({realm: realm.realm}, function(data) { - $scope.realmRoles = data; - }) - Client.query({realm: realm.realm}, function(data) { - $scope.clients = data; - if (data.length > 0) { - $scope.client.selected = data[0]; - $scope.changeClient(); - } - }) -}); - -module.controller('ComponentConfigCtrl', function ($modal, $scope, $route, Client) { - - $scope.initSelectedClient = function(configName, config) { - if(config[configName]) { - $scope.selectedClient = null; - Client.query({realm: $route.current.params.realm, search: false, clientId: config[configName], max: 1}, function(data) { - if(data.length > 0) { - $scope.selectedClient = angular.copy(data[0]); - $scope.selectedClient.text = $scope.selectedClient.clientId; - } - }); - } - } - - $scope.changeClient = function(configName, config, client) { - if (!client || !client.id) { - config[configName] = null; - $scope.selectedClient = null; - return; - } - $scope.selectedClient = client; - config[configName] = client.clientId; - }; - - - $scope.openRoleSelector = function (configName, config) { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/component-role-selector.html', - controller: 'ComponentRoleSelectorModalCtrl', - resolve: { - realm: function () { - return $scope.realm; - }, - config: function () { - return config; - }, - configName: function () { - return configName; - } - } - }) - } -}); -module.directive('kcComponentConfig', function ($modal) { - return { - scope: { - config: '=', - properties: '=', - realm: '=', - clients: '=', - configName: '=' - }, - restrict: 'E', - replace: true, - controller: 'ComponentConfigCtrl', - templateUrl: resourceUrl + '/templates/kc-component-config.html' - } -}); - -/* -* Used to select the element (invoke $(elem).select()) on specified action list. -* Usages kc-select-action="click mouseover" -* When used in the textarea element, this will select/highlight the textarea content on specified action (i.e. click). -*/ -module.directive('kcSelectAction', function ($compile, Notifications) { - return { - restrict: 'A', - compile: function (elem, attrs) { - - var events = attrs.kcSelectAction.split(" "); - - for(var i=0; i < events.length; i++){ - - elem.bind(events[i], function(){ - elem.select(); - }); - } - } - } -}); - -module.filter('remove', function() { - return function(input, remove, attribute) { - if (!input || !remove) { - return input; - } - - var out = []; - for ( var i = 0; i < input.length; i++) { - var e = input[i]; - - if (Array.isArray(remove)) { - for (var j = 0; j < remove.length; j++) { - if (attribute) { - if (remove[j][attribute] == e[attribute]) { - e = null; - break; - } - } else { - if (remove[j] == e) { - e = null; - break; - } - } - } - } else { - if (attribute) { - if (remove[attribute] == e[attribute]) { - e = null; - } - } else { - if (remove == e) { - e = null; - } - } - } - - if (e != null) { - out.push(e); - } - } - - return out; - }; -}); - -module.filter('capitalize', function() { - return function(input) { - if (!input) { - return; - } - var splittedWords = input.split(/\s+/); - for (var i=0; i'); - - $compile(label)(scope); - } - }; -}); - -module.directive( 'kcOpen', function ( $location ) { - return function ( scope, element, attrs ) { - var path; - - attrs.$observe( 'kcOpen', function (val) { - path = val; - }); - - element.bind( 'click', function () { - scope.$apply( function () { - $location.path(path); - }); - }); - }; -}); - -module.directive('kcOnReadFile', function ($parse) { - console.debug('kcOnReadFile'); - return { - restrict: 'A', - scope: false, - link: function(scope, element, attrs) { - var fn = $parse(attrs.kcOnReadFile); - - element.on('change', function(onChangeEvent) { - var reader = new FileReader(); - - reader.onload = function(onLoadEvent) { - scope.$apply(function() { - fn(scope, {$fileContent:onLoadEvent.target.result}); - }); - }; - - reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]); - }); - } - }; -}); - -module.controller('PagingCtrl', function ($scope) { - $scope.currentPageInput = 1; - - $scope.firstPage = function() { - if (!$scope.hasPrevious()) return; - $scope.currentPage = 1; - $scope.currentPageInput = 1; - }; - - $scope.lastPage = function() { - if (!$scope.hasNext()) return; - $scope.currentPage = $scope.numberOfPages; - $scope.currentPageInput = $scope.numberOfPages; - }; - - $scope.previousPage = function() { - if (!$scope.hasPrevious()) return; - $scope.currentPage--; - $scope.currentPageInput = $scope.currentPage; - }; - - $scope.nextPage = function() { - if (!$scope.hasNext()) return; - $scope.currentPage++; - $scope.currentPageInput = $scope.currentPage; - }; - - $scope.hasNext = function() { - return $scope.currentPage < $scope.numberOfPages; - }; - - $scope.hasPrevious = function() { - return $scope.currentPage > 1; - }; -}); - -// Provides a component for injection with utility methods for manipulating strings -module.factory('KcStrings', function () { - var instance = {}; - - // some IE versions do not support string.endsWith method, this method should be used as an alternative for cross-browser compatibility - instance.endsWith = function(source, suffix) { - return source.indexOf(suffix, source.length - suffix.length) !== -1; - }; - - return instance; -}); - -module.directive('kcPaging', function () { - return { - scope: { - currentPage: '=', - currentPageInput: '=', - numberOfPages: '=' - }, - restrict: 'E', - replace: true, - controller: 'PagingCtrl', - templateUrl: resourceUrl + '/templates/kc-paging.html' - } -}); - -// Tests the page number input from currentPageInput to see -// if it represents a valid page. If so, the current page is changed. -module.directive('kcValidPage', function() { - return { - require: 'ngModel', - link: function(scope, element, attrs, ctrl) { - ctrl.$validators.inRange = function(modelValue, viewValue) { - if (viewValue >= 1 && viewValue <= scope.numberOfPages) { - scope.currentPage = viewValue; - } - - return true; - } - } - } -}); - -// Directive to parse/format strings into numbers -module.directive('stringToNumber', function() { - return { - require: 'ngModel', - link: function(scope, element, attrs, ngModel) { - ngModel.$parsers.push(function(value) { - return (typeof value === 'undefined' || value === null)? '' : '' + value; - }); - ngModel.$formatters.push(function(value) { - return parseFloat(value); - }); - } - }; -}); - -// filter used for paged tables -module.filter('startFrom', function () { - return function (input, start) { - if (input) { - start = +start; - return input.slice(start); - } - return []; - }; -}); - - -module.directive('kcPassword', function ($compile, Notifications) { - return { - restrict: 'A', - link: function ($scope, elem, attr, ctrl) { - function toggleMask(evt) { - if(elem.hasClass('password-conceal')) { - view(); - } else { - conceal(); - } - } - - function view() { - elem.removeClass('password-conceal'); - - var t = elem.next().children().first(); - t.addClass('fa-eye-slash'); - t.removeClass('fa-eye'); - } - - function conceal() { - elem.addClass('password-conceal'); - - var t = elem.next().children().first(); - t.removeClass('fa-eye-slash'); - t.addClass('fa-eye'); - } - - elem.addClass("password-conceal"); - elem.attr("type","text"); - elem.attr("autocomplete", "off"); - - var p = elem.parent(); - - var inputGroup = $('
'); - var eye = $('') - .on('click', toggleMask); - - $scope.$watch(attr.ngModel, function(v) { - if (v && v == '**********') { - elem.next().addClass('disabled') - } else if (v && v.indexOf('${v') == 0) { - elem.next().addClass('disabled') - view(); - } else { - elem.next().removeClass('disabled') - } - }) - - elem.detach().appendTo(inputGroup); - inputGroup.append(eye); - p.append(inputGroup); - } - } -}); - - -module.filter('resolveClientRootUrl', function() { - return function(input) { - if (!input) { - return; - } - return input.replace("${authBaseUrl}", authServerUrl).replace("${authAdminUrl}", authUrl); - }; -}); diff --git a/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-app.js b/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-app.js deleted file mode 100644 index 2d18049718..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-app.js +++ /dev/null @@ -1,569 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2016 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module.config(['$routeProvider', function ($routeProvider) { - $routeProvider - .when('/realms/:realm/authz', { - templateUrl: resourceUrl + '/partials/authz/resource-server-list.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - } - }, - controller: 'ResourceServerCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/create', { - templateUrl: resourceUrl + '/partials/authz/resource-server-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - clients: function (ClientListLoader) { - return ClientListLoader(); - } - }, - controller: 'ResourceServerDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server', { - templateUrl: resourceUrl + '/partials/authz/resource-server-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - clients: function (ClientListLoader) { - return ClientListLoader(); - }, - serverInfo: function (ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller: 'ResourceServerDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/export-settings', { - templateUrl: resourceUrl + '/partials/authz/resource-server-export-settings.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - clients: function (ClientListLoader) { - return ClientListLoader(); - }, - serverInfo: function (ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller: 'ResourceServerDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/evaluate', { - templateUrl: resourceUrl + '/partials/authz/policy/resource-server-policy-evaluate.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - clients: function (ClientListLoader) { - return ClientListLoader(); - }, - roles: function (RoleListLoader) { - return new RoleListLoader(); - } - }, - controller: 'PolicyEvaluateCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/evaluate/result', { - templateUrl: resourceUrl + '/partials/authz/policy/resource-server-policy-evaluate-result.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - }, - controller: 'PolicyEvaluateCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/resource', { - templateUrl: resourceUrl + '/partials/authz/resource-server-resource-list.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerResourceCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/resource/create', { - templateUrl: resourceUrl + '/partials/authz/resource-server-resource-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerResourceDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/resource/:rsrid', { - templateUrl: resourceUrl + '/partials/authz/resource-server-resource-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerResourceDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/scope', { - templateUrl: resourceUrl + '/partials/authz/resource-server-scope-list.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerScopeCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/scope/create', { - templateUrl: resourceUrl + '/partials/authz/resource-server-scope-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerScopeDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/scope/:id', { - templateUrl: resourceUrl + '/partials/authz/resource-server-scope-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerScopeDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/permission', { - templateUrl: resourceUrl + '/partials/authz/permission/resource-server-permission-list.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPermissionCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy', { - templateUrl: resourceUrl + '/partials/authz/policy/resource-server-policy-list.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/permission/resource/create', { - templateUrl: resourceUrl + '/partials/authz/permission/provider/resource-server-policy-resource-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyResourceDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/permission/resource/:id', { - templateUrl: resourceUrl + '/partials/authz/permission/provider/resource-server-policy-resource-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyResourceDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/permission/scope/create', { - templateUrl: resourceUrl + '/partials/authz/permission/provider/resource-server-policy-scope-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyScopeDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/permission/scope/:id', { - templateUrl: resourceUrl + '/partials/authz/permission/provider/resource-server-policy-scope-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyScopeDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/user/create', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-user-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyUserDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/user/:id', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-user-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyUserDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/client/create', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-client-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyClientDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/client/:id', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-client-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyClientDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/role/create', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-role-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyRoleDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/role/:id', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-role-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyRoleDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/group/create', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-group-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyGroupDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/group/:id', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-group-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyGroupDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/js/create', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-js-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller: 'ResourceServerPolicyJSDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/js/:id', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-js-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); - } - }, - controller: 'ResourceServerPolicyJSDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/time/create', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-time-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyTimeDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/time/:id', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-time-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyTimeDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/aggregate/create', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyAggregateDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/aggregate/:id', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyAggregateDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/client-scope/create', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-client-scope-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyClientScopeDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/client-scope/:id', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-client-scope-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyClientScopeDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/regex/create', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-regex-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyRegexDetailCtrl' - }).when('/realms/:realm/clients/:client/authz/resource-server/policy/regex/:id', { - templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-regex-detail.html', - resolve: { - realm: function (RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller: 'ResourceServerPolicyRegexDetailCtrl' - }).when('/realms/:realm/roles/:role/permissions', { - templateUrl : resourceUrl + '/partials/authz/mgmt/realm-role-permissions.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - role : function(RoleLoader) { - return RoleLoader(); - } - }, - controller : 'RealmRolePermissionsCtrl' - }).when('/realms/:realm/clients/:client/roles/:role/permissions', { - templateUrl : resourceUrl + '/partials/authz/mgmt/client-role-permissions.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - }, - role : function(RoleLoader) { - return RoleLoader(); - } - }, - controller : 'ClientRolePermissionsCtrl' - }).when('/realms/:realm/users-permissions', { - templateUrl : resourceUrl + '/partials/authz/mgmt/users-permissions.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - } - }, - controller : 'UsersPermissionsCtrl' - }) - .when('/realms/:realm/clients/:client/permissions', { - templateUrl : resourceUrl + '/partials/authz/mgmt/client-permissions.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - client : function(ClientLoader) { - return ClientLoader(); - } - }, - controller : 'ClientPermissionsCtrl' - }) - .when('/realms/:realm/groups/:group/permissions', { - templateUrl : resourceUrl + '/partials/authz/mgmt/group-permissions.html', - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - group : function(GroupLoader) { - return GroupLoader(); - } - }, - controller : 'GroupPermissionsCtrl' - }) - .when('/realms/:realm/identity-provider-settings/provider/:provider_id/:alias/permissions', { - templateUrl : function(params){ return resourceUrl + '/partials/authz/mgmt/broker-permissions.html'; }, - resolve : { - realm : function(RealmLoader) { - return RealmLoader(); - }, - identityProvider : function(IdentityProviderLoader) { - return IdentityProviderLoader(); - } - }, - controller : 'IdentityProviderPermissionCtrl' - }) - ; -}]); - -module.directive('kcTabsResourceServer', function () { - return { - scope: true, - restrict: 'E', - replace: true, - templateUrl: resourceUrl + '/templates/authz/kc-tabs-resource-server.html' - } -}); - -module.filter('unique', function () { - - return function (items, filterOn) { - - if (filterOn === false) { - return items; - } - - if ((filterOn || angular.isUndefined(filterOn)) && angular.isArray(items)) { - var hashCheck = {}, newItems = []; - - var extractValueToCompare = function (item) { - if (angular.isObject(item) && angular.isString(filterOn)) { - return item[filterOn]; - } else { - return item; - } - }; - - angular.forEach(items, function (item) { - var valueToCheck, isDuplicate = false; - - for (var i = 0; i < newItems.length; i++) { - if (angular.equals(extractValueToCompare(newItems[i]), extractValueToCompare(item))) { - isDuplicate = true; - break; - } - } - if (!isDuplicate) { - newItems.push(item); - } - - }); - items = newItems; - } - return items; - }; -}); - -module.filter('toCamelCase', function () { - return function (input) { - input = input || ''; - return input.replace(/\w\S*/g, function (txt) { - return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); - }); - }; -}) \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js b/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js deleted file mode 100644 index 1e6da614d9..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js +++ /dev/null @@ -1,2833 +0,0 @@ -module.controller('ResourceServerCtrl', function($scope, realm, ResourceServer) { - $scope.realm = realm; - - ResourceServer.query({realm : realm.realm}, function (data) { - $scope.servers = data; - }); -}); - -module.controller('ResourceServerDetailCtrl', function($scope, $http, $route, $location, $upload, $modal, realm, ResourceServer, client, AuthzDialog, Notifications) { - $scope.realm = realm; - $scope.client = client; - - ResourceServer.get({ - realm : $route.current.params.realm, - client : client.id - }, function(data) { - $scope.server = angular.copy(data); - $scope.changed = false; - - $scope.$watch('server', function() { - if (!angular.equals($scope.server, data)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - ResourceServer.update({realm : realm.realm, client : $scope.server.clientId}, $scope.server, function() { - $route.reload(); - Notifications.success("The resource server has been created."); - }); - } - - $scope.reset = function() { - $route.reload(); - } - - $scope.export = function() { - $scope.exportSettings = true; - ResourceServer.settings({ - realm : $route.current.params.realm, - client : client.id - }, function(data) { - var tmp = angular.fromJson(data); - $scope.settings = angular.toJson(tmp, true); - }) - } - - $scope.downloadSettings = function() { - saveAs(new Blob([$scope.settings], { type: 'application/json' }), $scope.server.name + "-authz-config.json"); - } - - $scope.cancelExport = function() { - delete $scope.settings - } - - $scope.onFileSelect = function($fileContent) { - $scope.server = angular.copy(JSON.parse($fileContent)); - $scope.importing = true; - }; - - $scope.viewImportDetails = function() { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/view-object.html', - controller: 'ObjectModalCtrl', - resolve: { - object: function () { - return $scope.server; - } - } - }) - }; - - $scope.import = function () { - ResourceServer.import({realm : realm.realm, client : client.id}, $scope.server, function() { - $route.reload(); - Notifications.success("The resource server has been updated."); - }); - } - }); -}); - -var Resources = { - delete: function(ResourceServerResource, realm, client, $scope, AuthzDialog, $location, Notifications, $route) { - ResourceServerResource.permissions({ - realm : realm, - client : client.id, - rsrid : $scope.resource._id - }, function (permissions) { - var msg = ""; - - if (permissions.length > 0 && !$scope.deleteConsent) { - msg = "

This resource is referenced in some permissions:

"; - msg += "
    "; - for (i = 0; i < permissions.length; i++) { - msg+= "
  • " + permissions[i].name + "
  • "; - } - msg += "
"; - msg += "

If you remove this resource, the permissions above will be affected and will not be associated with this resource anymore.

"; - } - - AuthzDialog.confirmDeleteWithMsg($scope.resource.name, "Resource", msg, function() { - ResourceServerResource.delete({realm : realm, client : $scope.client.id, rsrid : $scope.resource._id}, null, function() { - $location.url("/realms/" + realm + "/clients/" + $scope.client.id + "/authz/resource-server/resource"); - $route.reload(); - Notifications.success("The resource has been deleted."); - }); - }); - }); - } -} - -var Policies = { - delete: function(service, realm, client, $scope, AuthzDialog, $location, Notifications, $route, isPermission) { - var msg = ""; - - service.dependentPolicies({ - realm : realm, - client : client.id, - id : $scope.policy.id - }, function (dependentPolicies) { - if (dependentPolicies.length > 0 && !$scope.deleteConsent) { - msg = "

This policy is being used by other policies:

"; - msg += "
    "; - for (i = 0; i < dependentPolicies.length; i++) { - msg+= "
  • " + dependentPolicies[i].name + "
  • "; - } - msg += "
"; - msg += "

If you remove this policy, the policies above will be affected and will not be associated with this policy anymore.

"; - } - - AuthzDialog.confirmDeleteWithMsg($scope.policy.name, isPermission ? "Permission" : "Policy", msg, function() { - service.delete({realm : realm, client : $scope.client.id, id : $scope.policy.id}, null, function() { - if (isPermission) { - $location.url("/realms/" + realm + "/clients/" + $scope.client.id + "/authz/resource-server/permission"); - Notifications.success("The permission has been deleted."); - } else { - $location.url("/realms/" + realm + "/clients/" + $scope.client.id + "/authz/resource-server/policy"); - Notifications.success("The policy has been deleted."); - } - $route.reload(); - }); - }); - }); - } -} - -module.controller('ResourceServerResourceCtrl', function($scope, $http, $route, $location, realm, ResourceServer, ResourceServerResource, client, AuthzDialog, Notifications, viewState) { - $scope.realm = realm; - $scope.client = client; - - $scope.query = { - realm: realm.realm, - client : client.id, - deep: false, - max : 20, - first : 0 - }; - - $scope.listSizes = [5, 10, 20]; - - ResourceServer.get({ - realm : $route.current.params.realm, - client : client.id - }, function(data) { - $scope.server = data; - - $scope.createPolicy = function(resource) { - viewState.state = {}; - viewState.state.previousUrl = '/realms/' + $route.current.params.realm + '/clients/' + client.id + '/authz/resource-server/resource'; - $location.path('/realms/' + $route.current.params.realm + '/clients/' + client.id + '/authz/resource-server/permission/resource/create').search({rsrid: resource._id}); - } - - $scope.searchQuery(); - }); - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.searchQuery(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.searchQuery(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.searchQuery(); - } - - $scope.searchQuery = function() { - $scope.searchLoaded = false; - - ResourceServerResource.query($scope.query, function(response) { - $scope.searchLoaded = true; - $scope.lastSearch = $scope.query.search; - $scope.resources = response; - if ($scope.detailsFilter) { - $scope.showDetails(); - } - }); - }; - - $scope.loadDetails = function (resource) { - if (resource.details) { - resource.details.loaded = !resource.details.loaded; - return; - } - - resource.details = {loaded: false}; - - ResourceServerResource.scopes({ - realm : $route.current.params.realm, - client : client.id, - rsrid : resource._id - }, function(response) { - resource.scopes = response; - ResourceServerResource.permissions({ - realm : $route.current.params.realm, - client : client.id, - rsrid : resource._id - }, function(response) { - resource.policies = response; - resource.details.loaded = true; - }); - }); - } - - $scope.showDetails = function(item, event) { - if (event.target.localName == 'a' || event.target.localName == 'button') { - return; - } - - if (item) { - $scope.loadDetails(item); - } else { - for (i = 0; i < $scope.resources.length; i++) { - $scope.loadDetails($scope.resources[i]); - } - } - }; - - $scope.delete = function(resource) { - $scope.resource = resource; - Resources.delete(ResourceServerResource, $route.current.params.realm, client, $scope, AuthzDialog, $location, Notifications, $route); - }; -}); - -module.controller('ResourceServerResourceDetailCtrl', function($scope, $http, $route, $location, realm, ResourceServer, client, ResourceServerResource, ResourceServerScope, AuthzDialog, Notifications) { - $scope.realm = realm; - $scope.client = client; - - $scope.scopesUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - if ('' == query.term.trim()) { - query.callback({ results: [] }); - return; - } - $scope.query = { - realm: realm.realm, - client : client.id, - name: query.term.trim(), - deep: false, - max : 20, - first : 0 - }; - ResourceServerScope.query($scope.query, function (response) { - query.callback({ - results: response.map(function (resource) { - resource.text = resource.name; - return resource; - }) - }); - }); - } - }; - - var $instance = this; - - ResourceServer.get({ - realm : $route.current.params.realm, - client : client.id - }, function(data) { - $scope.server = data; - - var resourceId = $route.current.params.rsrid; - - if (!resourceId) { - $scope.create = true; - $scope.changed = false; - - var resource = {}; - resource.scopes = []; - resource.attributes = {}; - resource.uris = []; - - $scope.resource = angular.copy(resource); - - $scope.$watch('resource', function() { - if (!angular.equals($scope.resource, resource)) { - $scope.changed = true; - } - }, true); - - $scope.$watch('newUri', function() { - if ($scope.newUri && $scope.newUri.length > 0) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - if ($scope.newUri && $scope.newUri.length > 0) { - $scope.addUri(); - } - - for (i = 0; i < $scope.resource.scopes.length; i++) { - delete $scope.resource.scopes[i].text; - } - $instance.checkNameAvailability(function () { - ResourceServerResource.save({realm : realm.realm, client : $scope.client.id}, $scope.resource, function(data) { - $location.url("/realms/" + realm.realm + "/clients/" + $scope.client.id + "/authz/resource-server/resource/" + data._id); - Notifications.success("The resource has been created."); - }); - }); - } - - $scope.reset = function() { - $location.url("/realms/" + realm.realm + "/clients/" + $scope.client.id + "/authz/resource-server/resource/"); - } - } else { - ResourceServerResource.get({ - realm : $route.current.params.realm, - client : client.id, - rsrid : $route.current.params.rsrid, - }, function(data) { - if (!data.scopes) { - data.scopes = []; - } - - if (!data.attributes) { - data.attributes = {}; - } - - $scope.resource = angular.copy(data); - $scope.changed = false; - - $scope.originalResource = angular.copy($scope.resource); - - $scope.$watch('resource', function() { - if (!angular.equals($scope.resource, data)) { - $scope.changed = true; - } - }, true); - - $scope.$watch('newUri', function() { - if ($scope.newUri && $scope.newUri.length > 0) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - if ($scope.newUri && $scope.newUri.length > 0) { - $scope.addUri(); - } - - for (i = 0; i < $scope.resource.scopes.length; i++) { - delete $scope.resource.scopes[i].text; - } - - var keys = Object.keys($scope.resource.attributes); - - for (var k = 0; k < keys.length; k++) { - var key = keys[k]; - var value = $scope.resource.attributes[key]; - var values = value.toString().split(','); - - $scope.resource.attributes[key] = []; - - for (j = 0; j < values.length; j++) { - $scope.resource.attributes[key].push(values[j]); - } - } - $instance.checkNameAvailability(function () { - ResourceServerResource.update({realm : realm.realm, client : $scope.client.id, rsrid : $scope.resource._id}, $scope.resource, function() { - $route.reload(); - Notifications.success("The resource has been updated."); - }); - }); - } - - $scope.remove = function() { - Resources.delete(ResourceServerResource, $route.current.params.realm, client, $scope, AuthzDialog, $location, Notifications, $route); - } - - $scope.reset = function() { - $route.reload(); - } - }); - } - }); - - $scope.checkNewNameAvailability = function () { - $instance.checkNameAvailability(function () {}); - } - - this.checkNameAvailability = function (onSuccess) { - if (!$scope.resource.name || $scope.resource.name.trim().length == 0) { - return; - } - ResourceServerResource.search({ - realm : $route.current.params.realm, - client : client.id, - rsrid : $route.current.params.rsrid, - name: $scope.resource.name - }, function(data) { - if (data && data._id && data._id != $scope.resource._id) { - Notifications.error("Name already in use by another resource, please choose another one."); - } else { - onSuccess(); - } - }); - } - - $scope.addAttribute = function() { - $scope.resource.attributes[$scope.newAttribute.key] = $scope.newAttribute.value; - delete $scope.newAttribute; - } - - $scope.removeAttribute = function(key) { - delete $scope.resource.attributes[key]; - } - - $scope.addUri = function() { - $scope.resource.uris.push($scope.newUri); - $scope.newUri = ""; - } - - $scope.deleteUri = function(index) { - $scope.resource.uris.splice(index, 1); - } -}); - -var Scopes = { - delete: function(ResourceServerScope, realm, client, $scope, AuthzDialog, $location, Notifications, $route) { - ResourceServerScope.permissions({ - realm : realm, - client : client.id, - id : $scope.scope.id - }, function (permissions) { - var msg = ""; - - if (permissions.length > 0 && !$scope.deleteConsent) { - msg = "

This scope is referenced in some permissions:

"; - msg += "
    "; - for (i = 0; i < permissions.length; i++) { - msg+= "
  • " + permissions[i].name + "
  • "; - } - msg += "
"; - msg += "

If you remove this scope, the permissions above will be affected and will not be associated with this scope anymore.

"; - } - - AuthzDialog.confirmDeleteWithMsg($scope.scope.name, "Scope", msg, function() { - ResourceServerScope.delete({realm : realm, client : $scope.client.id, id : $scope.scope.id}, null, function() { - $location.url("/realms/" + realm + "/clients/" + $scope.client.id + "/authz/resource-server/scope"); - $route.reload(); - Notifications.success("The scope has been deleted."); - }); - }); - }); - } -} - -module.controller('ResourceServerScopeCtrl', function($scope, $http, $route, $location, realm, ResourceServer, ResourceServerScope,client, AuthzDialog, Notifications, viewState) { - $scope.realm = realm; - $scope.client = client; - - $scope.query = { - realm: realm.realm, - client : client.id, - deep: false, - max : 20, - first : 0 - }; - - $scope.listSizes = [5, 10, 20]; - - ResourceServer.get({ - realm : $route.current.params.realm, - client : client.id - }, function(data) { - $scope.server = data; - - $scope.createPolicy = function(scope) { - viewState.state = {}; - viewState.state.previousUrl = '/realms/' + $route.current.params.realm + '/clients/' + client.id + '/authz/resource-server/scope'; - $location.path('/realms/' + $route.current.params.realm + '/clients/' + client.id + '/authz/resource-server/permission/scope/create').search({scpid: scope.id}); - } - - $scope.searchQuery(); - }); - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.searchQuery(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.searchQuery(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.searchQuery(); - } - - $scope.searchQuery = function(detailsFilter) { - $scope.searchLoaded = false; - - ResourceServerScope.query($scope.query, function(response) { - $scope.scopes = response; - $scope.searchLoaded = true; - $scope.lastSearch = $scope.query.search; - if ($scope.detailsFilter) { - $scope.showDetails(); - } - }); - }; - - $scope.loadDetails = function (scope) { - if (scope.details) { - scope.details.loaded = !scope.details.loaded; - return; - } - - scope.details = {loaded: false}; - - ResourceServerScope.resources({ - realm : $route.current.params.realm, - client : client.id, - id : scope.id - }, function(response) { - scope.resources = response; - ResourceServerScope.permissions({ - realm : $route.current.params.realm, - client : client.id, - id : scope.id - }, function(response) { - scope.policies = response; - scope.details.loaded = true; - }); - }); - } - - $scope.showDetails = function(item, event) { - if (event.target.localName == 'a' || event.target.localName == 'button') { - return; - } - if (item) { - $scope.loadDetails(item); - } else { - for (i = 0; i < $scope.scopes.length; i++) { - $scope.loadDetails($scope.scopes[i]); - } - } - }; - - $scope.delete = function(scope) { - $scope.scope = scope; - Scopes.delete(ResourceServerScope, $route.current.params.realm, client, $scope, AuthzDialog, $location, Notifications, $route); - }; -}); - -module.controller('ResourceServerScopeDetailCtrl', function($scope, $http, $route, $location, realm, ResourceServer, client, ResourceServerScope, AuthzDialog, Notifications) { - $scope.realm = realm; - $scope.client = client; - - var $instance = this; - - ResourceServer.get({ - realm : $route.current.params.realm, - client : client.id - }, function(data) { - $scope.server = data; - - var scopeId = $route.current.params.id; - - if (!scopeId) { - $scope.create = true; - $scope.changed = false; - - var scope = {}; - - $scope.scope = angular.copy(scope); - - $scope.$watch('scope', function() { - if (!angular.equals($scope.scope, scope)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - $instance.checkNameAvailability(function () { - ResourceServerScope.save({realm : realm.realm, client : $scope.client.id}, $scope.scope, function(data) { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/scope/" + data.id); - Notifications.success("The scope has been created."); - }); - }); - } - - $scope.reset = function() { - $location.url("/realms/" + realm.realm + "/clients/" + $scope.client.id + "/authz/resource-server/scope/"); - } - } else { - ResourceServerScope.get({ - realm : $route.current.params.realm, - client : client.id, - id : $route.current.params.id, - }, function(data) { - $scope.scope = angular.copy(data); - $scope.changed = false; - - $scope.$watch('scope', function() { - if (!angular.equals($scope.scope, data)) { - $scope.changed = true; - } - }, true); - - $scope.originalScope = angular.copy($scope.scope); - - $scope.save = function() { - $instance.checkNameAvailability(function () { - ResourceServerScope.update({realm : realm.realm, client : $scope.client.id, id : $scope.scope.id}, $scope.scope, function() { - $scope.changed = false; - Notifications.success("The scope has been updated."); - }); - }); - } - - $scope.remove = function() { - Scopes.delete(ResourceServerScope, $route.current.params.realm, client, $scope, AuthzDialog, $location, Notifications, $route); - } - - $scope.reset = function() { - $route.reload(); - } - }); - } - }); - - $scope.checkNewNameAvailability = function () { - $instance.checkNameAvailability(function () {}); - } - - this.checkNameAvailability = function (onSuccess) { - if (!$scope.scope.name || $scope.scope.name.trim().length == 0) { - return; - } - ResourceServerScope.search({ - realm : $route.current.params.realm, - client : client.id, - name: $scope.scope.name - }, function(data) { - if (data && data.id && data.id != $scope.scope.id) { - Notifications.error("Name already in use by another scope, please choose another one."); - } else { - onSuccess(); - } - }); - } -}); - -module.controller('ResourceServerPolicyCtrl', function($scope, $http, $route, $location, realm, ResourceServer, ResourceServerPolicy, PolicyProvider, client, AuthzDialog, Notifications, KcStrings) { - $scope.realm = realm; - $scope.client = client; - $scope.policyProviders = []; - - $scope.query = { - realm: realm.realm, - client : client.id, - permission: false, - max: 20, - first : 0 - }; - - $scope.listSizes = [5, 10, 20]; - - PolicyProvider.query({ - realm : $route.current.params.realm, - client : client.id - }, function (data) { - for (i = 0; i < data.length; i++) { - if (data[i].type != 'resource' && data[i].type != 'scope') { - $scope.policyProviders.push(data[i]); - } - } - }); - - ResourceServer.get({ - realm : $route.current.params.realm, - client : client.id - }, function(data) { - $scope.server = data; - $scope.searchQuery(); - }); - - $scope.addPolicy = function(policyType) { - if (KcStrings.endsWith(policyType.type, '.js')) { - ResourceServerPolicy.save({realm : realm.realm, client : client.id, type: policyType.type}, {name: policyType.name, type: policyType.type}, function(data) { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/policy/"); - Notifications.success("The policy has been created."); - }); - } else { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/policy/" + policyType.type + "/create"); - } - } - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.searchQuery(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.searchQuery(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.searchQuery(); - } - - $scope.searchQuery = function() { - $scope.searchLoaded = false; - - ResourceServerPolicy.query($scope.query, function(data) { - $scope.policies = data; - $scope.searchLoaded = true; - $scope.lastSearch = $scope.query.search; - if ($scope.detailsFilter) { - $scope.showDetails(); - } - }); - }; - - $scope.loadDetails = function (policy) { - if (policy.details) { - policy.details.loaded = !policy.details.loaded; - return; - } - - policy.details = {loaded: false}; - - ResourceServerPolicy.dependentPolicies({ - realm : $route.current.params.realm, - client : client.id, - id : policy.id - }, function(response) { - policy.dependentPolicies = response; - policy.details.loaded = true; - }); - } - - $scope.showDetails = function(item, event) { - if (event.target.localName == 'a' || event.target.localName == 'button') { - return; - } - if (item) { - $scope.loadDetails(item); - } else { - for (i = 0; i < $scope.policies.length; i++) { - $scope.loadDetails($scope.policies[i]); - } - } - }; - - $scope.delete = function(policy) { - $scope.policy = policy; - Policies.delete(ResourceServerPolicy, $route.current.params.realm, client, $scope, AuthzDialog, $location, Notifications, $route, false); - }; -}); - -module.controller('ResourceServerPermissionCtrl', function($scope, $http, $route, $location, realm, ResourceServer, ResourceServerPermission, PolicyProvider, client, AuthzDialog, Notifications) { - $scope.realm = realm; - $scope.client = client; - $scope.policyProviders = []; - - $scope.query = { - realm: realm.realm, - client : client.id, - max : 20, - first : 0 - }; - - $scope.listSizes = [5, 10, 20]; - - PolicyProvider.query({ - realm : $route.current.params.realm, - client : client.id - }, function (data) { - for (i = 0; i < data.length; i++) { - if (data[i].type == 'resource' || data[i].type == 'scope') { - $scope.policyProviders.push(data[i]); - } - } - }); - - ResourceServer.get({ - realm : $route.current.params.realm, - client : client.id - }, function(data) { - $scope.server = data; - $scope.searchQuery(); - }); - - $scope.addPolicy = function(policyType) { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/permission/" + policyType.type + "/create"); - } - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.searchQuery(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.searchQuery(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.searchQuery(); - } - - $scope.searchQuery = function() { - $scope.searchLoaded = false; - - ResourceServerPermission.query($scope.query, function(data) { - $scope.policies = data; - $scope.searchLoaded = true; - $scope.lastSearch = $scope.query.search; - if ($scope.detailsFilter) { - $scope.showDetails(); - } - }); - }; - - $scope.loadDetails = function (policy) { - if (policy.details) { - policy.details.loaded = !policy.details.loaded; - return; - } - - policy.details = {loaded: false}; - - ResourceServerPermission.associatedPolicies({ - realm : $route.current.params.realm, - client : client.id, - id : policy.id - }, function(response) { - policy.associatedPolicies = response; - policy.details.loaded = true; - }); - } - - $scope.showDetails = function(item, event) { - if (event.target.localName == 'a' || event.target.localName == 'button') { - return; - } - if (item) { - $scope.loadDetails(item); - } else { - for (i = 0; i < $scope.policies.length; i++) { - $scope.loadDetails($scope.policies[i]); - } - } - }; - - $scope.delete = function(policy) { - $scope.policy = policy; - Policies.delete(ResourceServerPermission, $route.current.params.realm, client, $scope, AuthzDialog, $location, Notifications, $route, true); - }; -}); - -module.controller('ResourceServerPolicyResourceDetailCtrl', function($scope, $route, $location, realm, client, PolicyController, ResourceServerPermission, ResourceServerResource, policyViewState) { - // call common handler method with ResourceServerScope as null. - ResourceServerPolicyCommonHandler($scope, $route, $location, realm, client, PolicyController, ResourceServerPermission, ResourceServerResource, null, policyViewState); -}); - - -module.controller('ResourceServerPolicyScopeDetailCtrl', function($scope, $route, $location, realm, client, PolicyController, ResourceServerPermission, ResourceServerResource, ResourceServerScope, policyViewState) { - ResourceServerPolicyCommonHandler($scope, $route, $location, realm, client, PolicyController, ResourceServerPermission, ResourceServerResource, ResourceServerScope, policyViewState); -}); - - -function ResourceServerPolicyCommonHandler($scope, $route, $location, realm, client, PolicyController, ResourceServerPermission, ResourceServerResource, ResourceServerScope, policyViewState) { - // if ResourceServerScope will be avaialble, scope handling will happen else ignored. - PolicyController.onInit({ - getPolicyType : function() { - if (ResourceServerScope == null) { - return "resource"; - } else { - return "scope"; - } - }, - - isPermission : function() { - return true; - }, - - onInit : function() { - if (ResourceServerScope != null) { - $scope.scopesUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - if ($scope.selectedResource && $scope.selectedResource._id) { - // if resource is selected, provide result based on resourceScopes - var filteredScopes = $scope.resourceScopes.filter( - resourceScope => resourceScope.name.toLowerCase().includes( - query.term.trim().toLowerCase()) - ); - query.callback({ results: filteredScopes }); - } else { - // if no resource is selected, all the scopes are allowed. - if ('' == query.term.trim()) { - query.callback({results: []}); - return; - } - $scope.query = { - realm: realm.realm, - client : client.id, - name: query.term.trim(), - deep: false, - max : 20, - first : 0 - }; - ResourceServerScope.query($scope.query, function (response) { - query.callback({ - result: response.map(function (scope) { - scope.text = scope.name; - return scope; - }) - }); - }); - } - } - }; - } - - $scope.resourcesUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - id: function(resource){ return resource._id; }, - query: function (query) { - if ('' == query.term.trim()) { - query.callback({results: []}); - return; - } - $scope.query = { - realm: realm.realm, - client : client.id, - name: query.term.trim(), - deep: false, - max : 20, - first : 0 - }; - ResourceServerResource.query($scope.query, function (response) { - query.callback({ - result: response.map(function (resource) { - resource.text = resource.name; - return resource; - }) - }); - }); - } - }; - - $scope.policiesUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - if ('' == query.term.trim()) { - query.callback({ results: [] }); - return; - } - $scope.query = { - realm: realm.realm, - client : client.id, - permission: false, - name: query.term.trim(), - max : 20, - first : 0 - }; - ResourceServerPermission.searchPolicies($scope.query, function (response) { - query.callback({ - results: response.map(function (policy) { - policy.text = policy.name; - return policy; - }) - }); - }); - } - }; - - if (ResourceServerScope != null) { - $scope.selectResource = function() { - $scope.selectedScopes = []; - if ($scope.selectedResource) { - ResourceServerResource.scopes({ - realm: $route.current.params.realm, - client: client.id, - rsrid: $scope.selectedResource._id - }, function (data) { - $scope.resourceScopes = data; - }); - } - } - } - $scope.applyToResourceType = function() { - // if previously apply to resource type flag is selected, - // assume that it will be disabled now and accordingly, - // set values for selectedResource or resourceType - const prevApplyToResourceTypeFlag = $scope.applyToResourceTypeFlag; - if (!prevApplyToResourceTypeFlag) { - $scope.selectedResource = null; - } else { - $scope.policy.resourceType = null; - } - if (ResourceServerScope != null) { - $scope.selectedScopes = []; - $scope.changed = true; - } - } - }, - - onInitUpdate : function(policy) { - if (!policy.resourceType) { - ResourceServerPermission.resources({ - realm: $route.current.params.realm, - client: client.id, - id: policy.id - }, function (resources) { - $scope.resourceScopes = []; - if (resources.length > 0) { - resources[0].text = resources[0].name; - $scope.selectedResource = resources[0]; - if (ResourceServerScope != null) { - ResourceServerResource.scopes({ - realm: $route.current.params.realm, - client: client.id, - rsrid: resources[0]._id - }, function (data) { - $scope.resourceScopes = data; - }); - } - } else { - $scope.selectedResource = null; - } - }); - $scope.applyToResourceTypeFlag = false; - } else { - $scope.selectedResource = null; - $scope.resourceScopes = []; - $scope.applyToResourceTypeFlag = true; - } - - var copy = angular.copy($scope.selectedResource); - $scope.$watch('selectedResource', function() { - if (!angular.equals($scope.selectedResource, copy)) { - $scope.changed = true; - } - }, true); - - if (ResourceServerScope != null) { - ResourceServerPermission.scopes({ - realm : $route.current.params.realm, - client : client.id, - id : policy.id - }, function(scopes) { - $scope.selectedScopes = []; - - for (i = 0; i < scopes.length; i++) { - scopes[i].text = scopes[i].name; - $scope.selectedScopes.push(scopes[i]); - } - - var copy = angular.copy($scope.selectedScopes); - $scope.$watch('selectedScopes', function() { - if (!angular.equals($scope.selectedScopes, copy)) { - $scope.changed = true; - } - }, true); - }); - } - - ResourceServerPermission.associatedPolicies({ - realm : $route.current.params.realm, - client : client.id, - id : policy.id - }, function(policies) { - $scope.selectedPolicies = []; - for (i = 0; i < policies.length; i++) { - policies[i].text = policies[i].name; - $scope.selectedPolicies.push(policies[i]); - } - var copy = angular.copy($scope.selectedPolicies); - $scope.$watch('selectedPolicies', function() { - if (!angular.equals($scope.selectedPolicies, copy)) { - $scope.changed = true; - } - }, true); - }); - }, - - onUpdate : function() { - if ($scope.selectedResource != null && $scope.selectedResource._id) { - $scope.policy.resources = [$scope.selectedResource._id]; - } else { - $scope.policy.resources = []; - } - - if (ResourceServerScope != null) { - var scopes = []; - for (i = 0; i < $scope.selectedScopes.length; i++) { - scopes.push($scope.selectedScopes[i].id); - } - $scope.policy.scopes = scopes; - } - - var policies = []; - if ($scope.selectedPolicies) { - for (i = 0; i < $scope.selectedPolicies.length; i++) { - policies.push($scope.selectedPolicies[i].id); - } - } - - $scope.policy.policies = policies; - delete $scope.policy.config; - }, - - onInitCreate : function(newPolicy) { - if (ResourceServerScope == null) { - policyViewState.state.previousPage.name = 'authz-add-resource-permission'; - } else { - policyViewState.state.previousPage.name = 'authz-add-scope-permission'; - } - }, - - onCreate : function() { - if ($scope.selectedResource != null && $scope.selectedResource._id) { - $scope.policy.resources = [$scope.selectedResource._id]; - } - - if (ResourceServerScope != null) { - var scopes = []; - for (i = 0; i < $scope.selectedScopes.length; i++) { - scopes.push($scope.selectedScopes[i].id); - } - $scope.policy.scopes = scopes; - } - - var policies = []; - if ($scope.selectedPolicies) { - for (i = 0; i < $scope.selectedPolicies.length; i++) { - policies.push($scope.selectedPolicies[i].id); - } - } - - $scope.policy.policies = policies; - delete $scope.policy.config; - }, - - onSaveState : function(policy) { - if (ResourceServerScope != null) { - policyViewState.state.selectedScopes = $scope.selectedScopes; - policyViewState.state.resourceScopes = $scope.resourceScopes; - } - policyViewState.state.selectedResource = $scope.selectedResource; - policyViewState.state.applyToResourceTypeFlag = $scope.applyToResourceTypeFlag; - }, - - onRestoreState : function(policy) { - if (ResourceServerScope != null) { - $scope.selectedScopes = policyViewState.state.selectedScopes; - $scope.resourceScopes = policyViewState.state.resourceScopes; - } - $scope.selectedResource = policyViewState.state.selectedResource; - $scope.applyToResourceTypeFlag = policyViewState.state.applyToResourceTypeFlag; - policy.resourceType = policyViewState.state.policy.resourceType; - } - }, realm, client, $scope); - -}; - - - -module.controller('ResourceServerPolicyUserDetailCtrl', function($scope, $route, realm, client, PolicyController, User) { - PolicyController.onInit({ - getPolicyType : function() { - return "user"; - }, - - onInit : function() { - $scope.usersUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - if ('' == query.term.trim()) { - query.callback({ results: [] }); - return; - } - User.query({ realm: $route.current.params.realm, search: query.term.trim(), max: 20 }, function (response) { - query.callback({ - results: response.map(function (user) { - user.text = user.username; - return user; - }) - }); - }); - } - }; - - $scope.selectedUsers = []; - - $scope.selectUser = function(user) { - if (!user || !user.id) { - return; - } - - $scope.selectedUser = null; - - for (i = 0; i < $scope.selectedUsers.length; i++) { - if ($scope.selectedUsers[i].id == user.id) { - return; - } - } - - $scope.selectedUsers.push(user); - } - - $scope.removeFromList = function(list, user) { - for (i = 0; i < angular.copy(list).length; i++) { - if (user == list[i]) { - list.splice(i, 1); - } - } - } - }, - - onInitUpdate : function(policy) { - var selectedUsers = []; - - if (policy.users) { - var users = policy.users; - - for (i = 0; i < users.length; i++) { - User.get({realm: $route.current.params.realm, userId: users[i]}, function(data) { - selectedUsers.push(data); - $scope.selectedUsers = angular.copy(selectedUsers); - }); - } - } - - $scope.$watch('selectedUsers', function() { - if (!angular.equals($scope.selectedUsers, selectedUsers)) { - $scope.changed = true; - } else { - $scope.changed = false; - } - }, true); - }, - - onUpdate : function() { - var users = []; - - for (i = 0; i < $scope.selectedUsers.length; i++) { - users.push($scope.selectedUsers[i].id); - } - - $scope.policy.users = users; - delete $scope.policy.config; - }, - - onCreate : function() { - var users = []; - - for (i = 0; i < $scope.selectedUsers.length; i++) { - users.push($scope.selectedUsers[i].id); - } - - $scope.policy.users = users; - delete $scope.policy.config; - } - }, realm, client, $scope); -}); - -module.controller('ResourceServerPolicyClientDetailCtrl', function($scope, $route, realm, client, PolicyController, Client) { - PolicyController.onInit({ - getPolicyType : function() { - return "client"; - }, - - onInit : function() { - clientSelectControl($scope, $route.current.params.realm, Client); - - $scope.selectedClients = []; - - $scope.selectClient = function(client) { - if (!client || !client.id) { - return; - } - - $scope.selectedClient = null; - - for (var i = 0; i < $scope.selectedClients.length; i++) { - if ($scope.selectedClients[i].id == client.id) { - return; - } - } - - $scope.selectedClients.push(client); - } - - $scope.removeFromList = function(client) { - var index = $scope.selectedClients.indexOf(client); - if (index != -1) { - $scope.selectedClients.splice(index, 1); - } - } - }, - - onInitUpdate : function(policy) { - var selectedClients = []; - - if (policy.clients) { - var clients = policy.clients; - - for (var i = 0; i < clients.length; i++) { - Client.get({realm: $route.current.params.realm, client: clients[i]}, function(data) { - selectedClients.push(data); - $scope.selectedClients = angular.copy(selectedClients); - }); - } - } - - $scope.$watch('selectedClients', function() { - if (!angular.equals($scope.selectedClients, selectedClients)) { - $scope.changed = true; - } else { - $scope.changed = false; - } - }, true); - }, - - onUpdate : function() { - var clients = []; - - for (var i = 0; i < $scope.selectedClients.length; i++) { - clients.push($scope.selectedClients[i].id); - } - - $scope.policy.clients = clients; - delete $scope.policy.config; - }, - - onInitCreate : function() { - var selectedClients = []; - - $scope.$watch('selectedClients', function() { - if (!angular.equals($scope.selectedClients, selectedClients)) { - $scope.changed = true; - } - }, true); - }, - - onCreate : function() { - var clients = []; - - for (var i = 0; i < $scope.selectedClients.length; i++) { - clients.push($scope.selectedClients[i].id); - } - - $scope.policy.clients = clients; - delete $scope.policy.config; - } - }, realm, client, $scope); -}); - -module.controller('ResourceServerPolicyRoleDetailCtrl', function($scope, $route, realm, client, Client, ClientRole, PolicyController, Role, RoleById) { - PolicyController.onInit({ - getPolicyType : function() { - return "role"; - }, - - onInit : function() { - Role.query({realm: $route.current.params.realm}, function(data) { - $scope.roles = data; - }); - - Client.query({realm: $route.current.params.realm}, function (data) { - $scope.clients = data; - }); - - $scope.selectedRoles = []; - - $scope.selectRole = function(role) { - if (!role || !role.id) { - return; - } - - $scope.selectedRole = null; - - for (i = 0; i < $scope.selectedRoles.length; i++) { - if ($scope.selectedRoles[i].id == role.id) { - return; - } - } - - $scope.selectedRoles.push(role); - - var clientRoles = []; - - if ($scope.clientRoles) { - for (i = 0; i < $scope.clientRoles.length; i++) { - if ($scope.clientRoles[i].id != role.id) { - clientRoles.push($scope.clientRoles[i]); - } - } - $scope.clientRoles = clientRoles; - } - } - - $scope.removeFromList = function(role) { - if ($scope.clientRoles && $scope.selectedClient && $scope.selectedClient.id == role.containerId) { - $scope.clientRoles.push(role); - } - var index = $scope.selectedRoles.indexOf(role); - if (index != -1) { - $scope.selectedRoles.splice(index, 1); - } - } - - $scope.selectClient = function() { - if (!$scope.selectedClient) { - $scope.clientRoles = []; - return; - } - ClientRole.query({realm: $route.current.params.realm, client: $scope.selectedClient.id}, function(data) { - var roles = []; - - for (j = 0; j < data.length; j++) { - var defined = false; - - for (i = 0; i < $scope.selectedRoles.length; i++) { - if ($scope.selectedRoles[i].id == data[j].id) { - defined = true; - break; - } - } - - if (!defined) { - data[j].container = {}; - data[j].container.name = $scope.selectedClient.clientId; - roles.push(data[j]); - } - } - $scope.clientRoles = roles; - }); - } - }, - - onInitUpdate : function(policy) { - var selectedRoles = []; - - if (policy.roles) { - var roles = policy.roles; - - for (i = 0; i < roles.length; i++) { - RoleById.get({realm: $route.current.params.realm, role: roles[i].id}, function(data) { - for (i = 0; i < roles.length; i++) { - if (roles[i].id == data.id) { - data.required = roles[i].required ? true : false; - } - } - for (i = 0; i < $scope.clients.length; i++) { - if ($scope.clients[i].id == data.containerId) { - data.container = {}; - data.container.name = $scope.clients[i].clientId; - } - } - selectedRoles.push(data); - $scope.selectedRoles = angular.copy(selectedRoles); - }); - } - } - - $scope.$watch('selectedRoles', function() { - if (!angular.equals($scope.selectedRoles, selectedRoles)) { - $scope.changed = true; - } else { - $scope.changed = false; - } - }, true); - }, - - onUpdate : function() { - var roles = []; - - for (i = 0; i < $scope.selectedRoles.length; i++) { - var role = {}; - role.id = $scope.selectedRoles[i].id; - if ($scope.selectedRoles[i].required) { - role.required = $scope.selectedRoles[i].required; - } - roles.push(role); - } - - $scope.policy.roles = roles; - delete $scope.policy.config; - }, - - onCreate : function() { - var roles = []; - - for (i = 0; i < $scope.selectedRoles.length; i++) { - var role = {}; - role.id = $scope.selectedRoles[i].id; - if ($scope.selectedRoles[i].required) { - role.required = $scope.selectedRoles[i].required; - } - roles.push(role); - } - - $scope.policy.roles = roles; - delete $scope.policy.config; - } - }, realm, client, $scope); - - $scope.hasRealmRole = function () { - for (i = 0; i < $scope.selectedRoles.length; i++) { - if (!$scope.selectedRoles[i].clientRole) { - return true; - } - } - return false; - } - - $scope.hasClientRole = function () { - for (i = 0; i < $scope.selectedRoles.length; i++) { - if ($scope.selectedRoles[i].clientRole) { - return true; - } - } - return false; - } -}); - -module.controller('ResourceServerPolicyGroupDetailCtrl', function($scope, $route, realm, client, Client, Groups, Group, PolicyController, Notifications, $translate) { - PolicyController.onInit({ - getPolicyType : function() { - return "group"; - }, - - onInit : function() { - $scope.tree = []; - - Groups.query({realm: $route.current.params.realm}, function(groups) { - $scope.groups = groups; - $scope.groupList = [ - {"id" : "realm", "name": $translate.instant('groups'), - "subGroups" : groups} - ]; - }); - - var isLeaf = function(node) { - return node.id != "realm" && (!node.subGroups || node.subGroups.length == 0); - } - - $scope.getGroupClass = function(node) { - if (node.id == "realm") { - return 'pficon pficon-users'; - } - if (isLeaf(node)) { - return 'normal'; - } - if (node.subGroups.length && node.collapsed) return 'collapsed'; - if (node.subGroups.length && !node.collapsed) return 'expanded'; - return 'collapsed'; - - } - - $scope.getSelectedClass = function(node) { - if (node.selected) { - return 'selected'; - } else if ($scope.cutNode && $scope.cutNode.id == node.id) { - return 'cut'; - } - return undefined; - } - - $scope.selectGroup = function(group) { - for (i = 0; i < $scope.selectedGroups.length; i++) { - if ($scope.selectedGroups[i].id == group.id) { - return - } - } - if (group.id == "realm") { - Notifications.error("You must choose a group"); - return; - } - $scope.selectedGroups.push({id: group.id, path: group.path}); - $scope.changed = true; - } - - $scope.extendChildren = function(group) { - $scope.changed = true; - } - - $scope.removeFromList = function(group) { - var index = $scope.selectedGroups.indexOf(group); - if (index != -1) { - $scope.selectedGroups.splice(index, 1); - $scope.changed = true; - } - } - }, - - onInitCreate : function(policy) { - var selectedGroups = []; - - $scope.selectedGroups = angular.copy(selectedGroups); - - $scope.$watch('selectedGroups', function() { - if (!angular.equals($scope.selectedGroups, selectedGroups)) { - $scope.changed = true; - } else { - $scope.changed = PolicyController.isNewAssociatedPolicy(); - } - }, true); - }, - - onInitUpdate : function(policy) { - $scope.selectedGroups = policy.groups; - - angular.forEach($scope.selectedGroups, function(group, index){ - Group.get({realm: $route.current.params.realm, groupId: group.id}, function (existing) { - group.path = existing.path; - }); - }); - - $scope.$watch('selectedGroups', function() { - if (!$scope.changed) { - return; - } - if (!angular.equals($scope.selectedGroups, selectedGroups)) { - $scope.changed = true; - } else { - $scope.changed = false; - } - }, true); - }, - - onUpdate : function() { - $scope.policy.groups = $scope.selectedGroups; - delete $scope.policy.config; - }, - - onCreate : function() { - $scope.policy.groups = $scope.selectedGroups; - delete $scope.policy.config; - } - }, realm, client, $scope); -}); - -module.controller('ResourceServerPolicyJSDetailCtrl', function($scope, $route, $location, realm, PolicyController, client, serverInfo) { - PolicyController.onInit({ - getPolicyType : function() { - return "js"; - }, - - onInit : function() { - }, - - onInitUpdate : function(policy) { - - }, - - onUpdate : function() { - delete $scope.policy.config; - }, - - onInitCreate : function(newPolicy) { - }, - - onCreate : function() { - delete $scope.policy.config; - } - }, realm, client, $scope); -}); - -module.controller('ResourceServerPolicyTimeDetailCtrl', function($scope, $route, $location, realm, PolicyController, client) { - - function clearEmptyStrings() { - if ($scope.policy.notBefore != undefined && $scope.policy.notBefore.trim() == '') { - $scope.policy.notBefore = null; - } - if ($scope.policy.notOnOrAfter != undefined && $scope.policy.notOnOrAfter.trim() == '') { - $scope.policy.notOnOrAfter = null; - } - } - - PolicyController.onInit({ - getPolicyType : function() { - return "time"; - }, - - onInit : function() { - - }, - - onInitUpdate : function(policy) { - if (policy.dayMonth) { - policy.dayMonth = parseInt(policy.dayMonth); - } - if (policy.dayMonthEnd) { - policy.dayMonthEnd = parseInt(policy.dayMonthEnd); - } - if (policy.month) { - policy.month = parseInt(policy.month); - } - if (policy.monthEnd) { - policy.monthEnd = parseInt(policy.monthEnd); - } - if (policy.year) { - policy.year = parseInt(policy.year); - } - if (policy.yearEnd) { - policy.yearEnd = parseInt(policy.yearEnd); - } - if (policy.hour) { - policy.hour = parseInt(policy.hour); - } - if (policy.hourEnd) { - policy.hourEnd = parseInt(policy.hourEnd); - } - if (policy.minute) { - policy.minute = parseInt(policy.minute); - } - if (policy.minuteEnd) { - policy.minuteEnd = parseInt(policy.minuteEnd); - } - }, - - onUpdate : function() { - clearEmptyStrings(); - delete $scope.policy.config; - }, - - onInitCreate : function(newPolicy) { - }, - - onCreate : function() { - clearEmptyStrings(); - delete $scope.policy.config; - } - }, realm, client, $scope); - - $scope.isRequired = function () { - var policy = $scope.policy; - - if (!policy) { - return true; - } - - if (policy.notOnOrAfter || policy.notBefore - || policy.dayMonth - || policy.month - || policy.year - || policy.hour - || policy.minute) { - return false; - } - return true; - } -}); - -module.controller('ResourceServerPolicyAggregateDetailCtrl', function($scope, $route, $location, realm, PolicyController, ResourceServerPolicy, client, PolicyProvider, policyViewState) { - PolicyController.onInit({ - getPolicyType : function() { - return "aggregate"; - }, - - onInit : function() { - $scope.policiesUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - if ('' == query.term.trim()) { - query.callback({ results: [] }); - return; - } - $scope.query = { - realm: realm.realm, - client : client.id, - permission: false, - name: query.term.trim(), - max : 20, - first : 0 - }; - ResourceServerPolicy.query($scope.query, function (response) { - query.callback({ - results: response.map(function (policy) { - policy.text = policy.name; - return policy; - }) - }); - }); - } - }; - }, - - onInitUpdate : function(policy) { - ResourceServerPolicy.associatedPolicies({ - realm : $route.current.params.realm, - client : client.id, - id : policy.id - }, function(policies) { - $scope.selectedPolicies = []; - for (i = 0; i < policies.length; i++) { - policies[i].text = policies[i].name; - $scope.selectedPolicies.push(policies[i]); - } - var copy = angular.copy($scope.selectedPolicies); - $scope.$watch('selectedPolicies', function() { - if (!angular.equals($scope.selectedPolicies, copy)) { - $scope.changed = true; - } - }, true); - }); - }, - - onUpdate : function() { - var policies = []; - - for (i = 0; i < $scope.selectedPolicies.length; i++) { - policies.push($scope.selectedPolicies[i].id); - } - - $scope.policy.policies = policies; - delete $scope.policy.config; - }, - - onInitCreate : function(newPolicy) { - policyViewState.state.previousPage.name = 'authz-add-aggregated-policy'; - }, - - onCreate : function() { - var policies = []; - - for (i = 0; i < $scope.selectedPolicies.length; i++) { - policies.push($scope.selectedPolicies[i].id); - } - - $scope.policy.policies = policies; - delete $scope.policy.config; - } - }, realm, client, $scope); -}); - -module.controller('ResourceServerPolicyClientScopeDetailCtrl', function($scope, $route, realm, client, ClientScope, PolicyController) { - PolicyController.onInit({ - getPolicyType : function() { - return "client-scope"; - }, - - onInit : function() { - ClientScope.query({realm: $route.current.params.realm}, function(data) { - $scope.clientScopes = data; - }); - - $scope.selectedClientScopes = []; - - $scope.selectClientScope = function(clientScope) { - if (!clientScope || !clientScope.id) { - return; - } - - $scope.selectedClientScope = null; - - for (i = 0; i < $scope.selectedClientScopes.length; i++) { - if ($scope.selectedClientScopes[i].id == clientScope.id) { - return; - } - } - - $scope.selectedClientScopes.push(clientScope); - } - - $scope.removeFromList = function(clientScope) { - var index = $scope.selectedClientScopes.indexOf(clientScope); - if (index != -1) { - $scope.selectedClientScopes.splice(index, 1); - } - } - }, - - onInitUpdate : function(policy) { - var selectedClientScopes = []; - - if (policy.clientScopes) { - var clientScopes = policy.clientScopes; - - for (i = 0; i < clientScopes.length; i++) { - ClientScope.get({realm: $route.current.params.realm, clientScope: clientScopes[i].id}, function(data) { - for (i = 0; i < clientScopes.length; i++) { - if (clientScopes[i].id == data.id) { - data.required = clientScopes[i].required ? true : false; - } - } - selectedClientScopes.push(data); - $scope.selectedClientScopes = angular.copy(selectedClientScopes); - }); - } - } - - $scope.$watch('selectedClientScopes', function() { - if (!angular.equals($scope.selectedClientScopes, selectedClientScopes)) { - $scope.changed = true; - } else { - $scope.changed = false; - } - }, true); - }, - - onUpdate : function() { - var clientScopes = []; - - for (i = 0; i < $scope.selectedClientScopes.length; i++) { - var clientScope = {}; - clientScope.id = $scope.selectedClientScopes[i].id; - if ($scope.selectedClientScopes[i].required) { - clientScope.required = $scope.selectedClientScopes[i].required; - } - clientScopes.push(clientScope); - } - - $scope.policy.clientScopes = clientScopes; - delete $scope.policy.config; - }, - - onCreate : function() { - var clientScopes = []; - - for (i = 0; i < $scope.selectedClientScopes.length; i++) { - var clientScope = {}; - clientScope.id = $scope.selectedClientScopes[i].id; - if ($scope.selectedClientScopes[i].required) { - clientScope.required = $scope.selectedClientScopes[i].required; - } - clientScopes.push(clientScope); - } - - $scope.policy.clientScopes = clientScopes; - delete $scope.policy.config; - } - }, realm, client, $scope); -}); - -module.controller('ResourceServerPolicyRegexDetailCtrl', function($scope, realm, client, PolicyController) { - PolicyController.onInit({ - getPolicyType : function() { - return "regex"; - }, - - onInit : function() { - }, - - onInitUpdate : function(policy) { - }, - - onUpdate : function() { - delete $scope.policy.config; - }, - - onCreate : function() { - delete $scope.policy.config; - } - }, realm, client, $scope); -}); - -module.service("PolicyController", function($http, $route, $location, ResourceServer, ResourceServerPolicy, ResourceServerPermission, AuthzDialog, Notifications, policyViewState, PolicyProvider, viewState) { - - var PolicyController = {}; - - PolicyController.isNewAssociatedPolicy = function() { - return $route.current.params['new_policy'] != null; - } - - PolicyController.isBackNewAssociatedPolicy = function() { - return $route.current.params['back'] != null; - } - - PolicyController.onInit = function(delegate, realm, client, $scope) { - $scope.policyProviders = []; - - PolicyProvider.query({ - realm : $route.current.params.realm, - client : client.id - }, function (data) { - for (i = 0; i < data.length; i++) { - if (data[i].type != 'resource' && data[i].type != 'scope') { - $scope.policyProviders.push(data[i]); - } - } - }); - - if ((!policyViewState.state || !PolicyController.isBackNewAssociatedPolicy()) && !PolicyController.isNewAssociatedPolicy()) { - policyViewState.state = {}; - } - - if (!policyViewState.state.previousPage) { - policyViewState.state.previousPage = {}; - } - - $scope.policyViewState = policyViewState; - - $scope.addPolicy = function(policyType) { - policyViewState.state.policy = $scope.policy; - - if (delegate.onSaveState) { - delegate.onSaveState($scope.policy); - } - - if ($scope.selectedPolicies) { - policyViewState.state.selectedPolicies = $scope.selectedPolicies; - } - var previousUrl = window.location.href.substring(window.location.href.indexOf('/realms')); - - if (previousUrl.indexOf('back=true') == -1) { - previousUrl = previousUrl + (previousUrl.indexOf('?') == -1 ? '?' : '&') + 'back=true'; - } - policyViewState.state.previousUrl = previousUrl; - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/policy/" + policyType.type + "/create?new_policy=true"); - } - - $scope.detailPolicy = function(policy) { - policyViewState.state.policy = $scope.policy; - if (delegate.onSaveState) { - delegate.onSaveState($scope.policy); - } - if ($scope.selectedPolicies) { - policyViewState.state.selectedPolicies = $scope.selectedPolicies; - } - var previousUrl = window.location.href.substring(window.location.href.indexOf('/realms')); - - if (previousUrl.indexOf('back=true') == -1) { - previousUrl = previousUrl + (previousUrl.indexOf('?') == -1 ? '?' : '&') + 'back=true'; - } - policyViewState.state.previousUrl = previousUrl; - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/policy/" + policy.type + "/" + policy.id + "?new_policy=true"); - } - - $scope.removePolicy = function(list, policy) { - for (i = 0; i < angular.copy(list).length; i++) { - if (policy.id == list[i].id) { - list.splice(i, 1); - } - } - } - - $scope.selectPolicy = function(policy) { - if (!policy || !policy.id) { - return; - } - - if (!$scope.selectedPolicies) { - $scope.selectedPolicies = []; - } - - $scope.selectedPolicy = null; - - for (i = 0; i < $scope.selectedPolicies.length; i++) { - if ($scope.selectedPolicies[i].id == policy.id) { - return; - } - } - - $scope.selectedPolicies.push(policy); - } - - $scope.createNewPolicy = function() { - $scope.showNewPolicy = true; - } - - $scope.cancelCreateNewPolicy = function() { - $scope.showNewPolicy = false; - } - - $scope.historyBackOnSaveOrCancel = PolicyController.isNewAssociatedPolicy(); - - if (!delegate.isPermission) { - delegate.isPermission = function () { - return false; - } - } - - var service = ResourceServerPolicy; - - if (delegate.isPermission()) { - service = ResourceServerPermission; - } - - $scope.realm = realm; - $scope.client = client; - - $scope.decisionStrategies = ['AFFIRMATIVE', 'UNANIMOUS', 'CONSENSUS']; - $scope.logics = ['POSITIVE', 'NEGATIVE']; - - delegate.onInit(); - - var $instance = this; - - ResourceServer.get({ - realm : $route.current.params.realm, - client : client.id - }, function(data) { - $scope.server = data; - - var policyId = $route.current.params.id; - - if (!policyId) { - $scope.create = true; - - var policy = {}; - - policy.type = delegate.getPolicyType(); - policy.config = {}; - policy.logic = 'POSITIVE'; - policy.decisionStrategy = 'UNANIMOUS'; - - $scope.changed = $scope.historyBackOnSaveOrCancel || PolicyController.isBackNewAssociatedPolicy(); - - if (viewState.state != null && viewState.state.previousUrl != null) { - $scope.previousUrl = viewState.state.previousUrl; - policyViewState.state.rootUrl = $scope.previousUrl; - viewState.state = {}; - } - - $scope.policy = angular.copy(policy); - - $scope.$watch('policy', function() { - if (!angular.equals($scope.policy, policy)) { - $scope.changed = true; - } - }, true); - - if (PolicyController.isBackNewAssociatedPolicy()) { - if (delegate.onRestoreState) { - delegate.onRestoreState($scope.policy); - } - $instance.restoreState($scope); - } else if (delegate.onInitCreate) { - delegate.onInitCreate(policy); - } - - $scope.save = function() { - $instance.checkNameAvailability(function () { - if (delegate.onCreate) { - delegate.onCreate(); - } - - let policyType = $scope.policy.type.endsWith('.js') ? 'js': $scope.policy.type; - - service.save({realm : realm.realm, client : client.id, type: $scope.policy.type}, $scope.policy, function(data) { - if (delegate.isPermission()) { - if ($scope.historyBackOnSaveOrCancel || policyViewState.state.rootUrl != null) { - if (policyViewState.state.rootUrl != null) { - $location.url(policyViewState.state.rootUrl); - } else { - policyViewState.state.newPolicyName = $scope.policy.name; - $location.url(policyViewState.state.previousUrl); - } - } else { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/permission/" + policyType + "/" + data.id); - } - Notifications.success("The permission has been created."); - } else { - if ($scope.historyBackOnSaveOrCancel) { - policyViewState.state.newPolicyName = $scope.policy.name; - $location.url(policyViewState.state.previousUrl); - } else { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/policy/" + policyType + "/" + data.id); - } - Notifications.success("The policy has been created."); - } - }); - }); - } - - $scope.reset = function() { - if (delegate.isPermission()) { - if ($scope.historyBackOnSaveOrCancel || policyViewState.state.rootUrl != null) { - if (policyViewState.state.rootUrl != null) { - $location.url(policyViewState.state.rootUrl); - } else { - $location.url(policyViewState.state.previousUrl); - } - } else { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/permission/"); - } - } else { - if ($scope.historyBackOnSaveOrCancel) { - $location.url(policyViewState.state.previousUrl); - } else { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/policy/"); - } - } - } - } else { - service.get({ - realm: realm.realm, - client : client.id, - type: delegate.getPolicyType(), - id: $route.current.params.id - }, function(data) { - $scope.originalPolicy = data; - var policy = angular.copy(data); - - $scope.changed = $scope.historyBackOnSaveOrCancel || PolicyController.isBackNewAssociatedPolicy(); - $scope.policy = angular.copy(policy); - - if (PolicyController.isBackNewAssociatedPolicy()) { - if (delegate.onRestoreState) { - delegate.onRestoreState($scope.policy); - } - $instance.restoreState($scope); - } else if (delegate.onInitUpdate) { - delegate.onInitUpdate($scope.policy); - } - - $scope.$watch('policy', function() { - if (!angular.equals($scope.policy, policy)) { - $scope.changed = true; - } - }, true); - - - $scope.save = function() { - $instance.checkNameAvailability(function () { - if (delegate.onUpdate) { - delegate.onUpdate(); - } - - let policyType = $scope.policy.type.endsWith('.js') ? 'js': $scope.policy.type; - - service.update({realm : realm.realm, client : client.id, type: $scope.policy.type, id : $scope.policy.id}, $scope.policy, function() { - if (delegate.isPermission()) { - if ($scope.historyBackOnSaveOrCancel) { - $location.url(policyViewState.state.previousUrl); - } else { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/permission/" + policyType + "/" + $scope.policy.id); - } - $route.reload(); - Notifications.success("The permission has been updated."); - } else { - if ($scope.historyBackOnSaveOrCancel) { - $location.url(policyViewState.state.previousUrl); - } else { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/policy/" + policyType + "/" + $scope.policy.id); - } - $route.reload(); - Notifications.success("The policy has been updated."); - } - }); - }); - } - - $scope.reset = function() { - if ($scope.historyBackOnSaveOrCancel) { - $location.url(policyViewState.state.previousUrl); - } else { - var freshPolicy = angular.copy(data); - - if (delegate.onInitUpdate) { - delegate.onInitUpdate(freshPolicy); - } - - $scope.policy = angular.copy(freshPolicy); - $scope.changed = false; - } - } - }); - - $scope.remove = function() { - Policies.delete(ResourceServerPolicy, $route.current.params.realm, client, $scope, AuthzDialog, $location, Notifications, $route, delegate.isPermission()); - } - } - }); - - $scope.checkNewNameAvailability = function () { - $instance.checkNameAvailability(function () {}); - } - - this.checkNameAvailability = function (onSuccess) { - if (!$scope.policy.name || $scope.policy.name.trim().length == 0) { - return; - } - ResourceServerPolicy.search({ - realm: $route.current.params.realm, - client: client.id, - name: $scope.policy.name - }, function(data) { - if (data && data.id && data.id != $scope.policy.id) { - Notifications.error("Name already in use by another policy or permission, please choose another one."); - } else { - onSuccess(); - } - }); - } - - this.restoreState = function($scope) { - $scope.policy.name = policyViewState.state.policy.name; - $scope.policy.description = policyViewState.state.policy.description; - $scope.policy.decisionStrategy = policyViewState.state.policy.decisionStrategy; - $scope.policy.logic = policyViewState.state.policy.logic; - $scope.selectedPolicies = policyViewState.state.selectedPolicies; - - if (!$scope.selectedPolicies) { - $scope.selectedPolicies = []; - } - - $scope.changed = true; - var previousPage = policyViewState.state.previousPage; - - if (policyViewState.state.newPolicyName) { - ResourceServerPolicy.query({ - realm: realm.realm, - client : client.id, - permission: false, - name: policyViewState.state.newPolicyName, - max : 20, - first : 0 - }, function(response) { - for (i = 0; i < response.length; i++) { - if (response[i].name == policyViewState.state.newPolicyName) { - response[i].text = response[i].name; - $scope.selectedPolicies.push(response[i]); - } - } - - var rootUrl = policyViewState.state.rootUrl; - policyViewState.state = {}; - policyViewState.state.previousPage = previousPage; - policyViewState.state.rootUrl = rootUrl; - }); - } else { - var rootUrl = policyViewState.state.rootUrl; - policyViewState.state = {}; - policyViewState.state.previousPage = previousPage; - policyViewState.state.rootUrl = rootUrl; - } - } - } - - return PolicyController; -}); - -module.controller('PolicyEvaluateCtrl', function($scope, $http, $route, $location, realm, clients, roles, ResourceServer, client, ResourceServerResource, ResourceServerScope, User, Notifications) { - $scope.realm = realm; - $scope.client = client; - $scope.clients = clients; - $scope.roles = roles; - $scope.authzRequest = {}; - $scope.authzRequest.resources = []; - $scope.authzRequest.context = {}; - $scope.authzRequest.context.attributes = {}; - $scope.authzRequest.roleIds = []; - $scope.resultUrl = resourceUrl + '/partials/authz/policy/resource-server-policy-evaluate-result.html'; - - $scope.addContextAttribute = function() { - if (!$scope.newContextAttribute.value || $scope.newContextAttribute.value == '') { - Notifications.error("You must provide a value to a context attribute."); - return; - } - - $scope.authzRequest.context.attributes[$scope.newContextAttribute.key] = $scope.newContextAttribute.value; - delete $scope.newContextAttribute; - } - - $scope.removeContextAttribute = function(key) { - delete $scope.authzRequest.context.attributes[key]; - } - - $scope.getContextAttribute = function(key) { - for (i = 0; i < $scope.defaultContextAttributes.length; i++) { - if ($scope.defaultContextAttributes[i].key == key) { - return $scope.defaultContextAttributes[i]; - } - } - - return $scope.authzRequest.context.attributes[key]; - } - - $scope.getContextAttributeName = function(key) { - var attribute = $scope.getContextAttribute(key); - - if (!attribute.name) { - return key; - } - - return attribute.name; - } - - $scope.defaultContextAttributes = [ - { - key : "custom", - name : "Custom Attribute...", - custom: true - }, - { - key : "kc.identity.authc.method", - name : "Authentication Method", - values: [ - { - key : "pwd", - name : "Password" - }, - { - key : "otp", - name : "One-Time Password" - }, - { - key : "kbr", - name : "Kerberos" - } - ] - }, - { - key : "kc.realm.name", - name : "Realm" - }, - { - key : "kc.time.date_time", - name : "Date/Time (MM/dd/yyyy hh:mm:ss)" - }, - { - key : "kc.client.network.ip_address", - name : "Client IPv4 Address" - }, - { - key : "kc.client.network.host", - name : "Client Host" - }, - { - key : "kc.client.user_agent", - name : "Client/User Agent" - } - ]; - - $scope.isDefaultContextAttribute = function() { - if (!$scope.newContextAttribute) { - return true; - } - - if ($scope.newContextAttribute.custom) { - return false; - } - - if (!$scope.getContextAttribute($scope.newContextAttribute.key).custom) { - return true; - } - - return false; - } - - $scope.selectDefaultContextAttribute = function() { - $scope.newContextAttribute = angular.copy($scope.newContextAttribute); - } - - $scope.setApplyToResourceType = function() { - delete $scope.newResource; - $scope.authzRequest.resources = []; - } - - $scope.addResource = function() { - var resource = angular.copy($scope.newResource); - - if (!resource) { - resource = {}; - } - - delete resource.text; - - if (!$scope.newScopes || (resource._id != null && $scope.newScopes.length > 0 && $scope.newScopes[0].id)) { - $scope.newScopes = []; - } - - var scopes = []; - - for (i = 0; i < $scope.newScopes.length; i++) { - if ($scope.newScopes[i].name) { - scopes.push($scope.newScopes[i].name); - } else { - scopes.push($scope.newScopes[i]); - } - } - - resource.scopes = scopes; - - $scope.authzRequest.resources.push(resource); - - delete $scope.newResource; - delete $scope.newScopes; - } - - $scope.removeResource = function(index) { - $scope.authzRequest.resources.splice(index, 1); - } - - $scope.resolveScopes = function() { - if ($scope.newResource._id) { - $scope.newResource.scopes = []; - $scope.scopes = []; - ResourceServerResource.scopes({ - realm: $route.current.params.realm, - client: client.id, - rsrid: $scope.newResource._id - }, function (data) { - $scope.scopes = data; - }); - } - } - - $scope.reevaluate = function() { - if ($scope.authzRequest.entitlements) { - $scope.entitlements(); - } else { - $scope.save(); - } - } - - $scope.showAuthzData = function() { - $scope.showRpt = true; - } - - $scope.save = function() { - $scope.authzRequest.entitlements = false; - if ($scope.applyResourceType) { - if (!$scope.newResource) { - $scope.newResource = {}; - } - if (!$scope.newScopes || ($scope.newResource._id != null && $scope.newScopes.length > 0 && $scope.newScopes[0].id)) { - $scope.newScopes = []; - } - - var scopes = angular.copy($scope.newScopes); - - for (i = 0; i < scopes.length; i++) { - delete scopes[i].text; - } - - $scope.authzRequest.resources[0].scopes = scopes; - } - - $http.post(authUrl + '/admin/realms/'+ $route.current.params.realm + '/clients/' + client.id + '/authz/resource-server/policy/evaluate' - , $scope.authzRequest).then(function(response) { - $scope.evaluationResult = response.data; - $scope.showResultTab(); - }); - } - - $scope.entitlements = function() { - $scope.authzRequest.entitlements = true; - $http.post(authUrl + '/admin/realms/'+ $route.current.params.realm + '/clients/' + client.id + '/authz/resource-server/policy/evaluate' - , $scope.authzRequest).then(function(response) { - $scope.evaluationResult = response.data; - $scope.showResultTab(); - }); - } - - $scope.showResultTab = function() { - $scope.showResult = true; - $scope.showRpt = false; - } - - $scope.showRequestTab = function() { - $scope.showResult = false; - $scope.showRpt = false; - } - - $scope.usersUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - if ('' == query.term.trim()) { - query.callback({ results: [] }); - return; - } - User.query({ realm: $route.current.params.realm, search: query.term.trim(), max: 20 }, function (response) { - query.callback({ - results: response.map(function (user) { - user.text = user.username; - return user; - }) - }); - }); - } - }; - - $scope.resourcesUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - id: function(resource){ return resource._id; }, - query: function (query) { - if ('' == query.term.trim()) { - query.callback({ results: [] }); - return; - } - $scope.query = { - realm: realm.realm, - client : client.id, - name: query.term.trim(), - deep: false, - max : 20, - first : 0 - }; - ResourceServerResource.query($scope.query, function (response) { - query.callback({ - results: response.map(function (resource) { - resource.text = resource.name; - return resource; - }) - }); - }); - } - }; - - $scope.scopesUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - if ('' == query.term.trim()) { - query.callback({ results: [] }); - return; - } - $scope.query = { - realm: realm.realm, - client : client.id, - name: query.term.trim(), - deep: false, - max : 20, - first : 0 - }; - ResourceServerScope.query($scope.query, function (response) { - query.callback({ - result: response.map(function (scope) { - scope.text = scope.name; - return scope; - }) - }); - }); - } - }; - - ResourceServer.get({ - realm : $route.current.params.realm, - client : client.id - }, function(data) { - $scope.server = data; - }); - - $scope.selectUser = function(user) { - if (!user || !user.id) { - $scope.selectedUser = null; - $scope.authzRequest.userId = ''; - return; - } - - $scope.authzRequest.userId = user.id; - } - - $scope.reset = function() { - $scope.authzRequest = angular.copy(authzRequest); - $scope.changed = false; - } -}); - -getManageClientId = function(realm) { - if (realm.realm == masterRealm) { - return 'master-realm'; - } else { - return 'realm-management'; - } -} - -module.controller('RealmRolePermissionsCtrl', function($scope, $http, $route, $location, realm, role, RoleManagementPermissions, Client, Notifications, Dialog, RealmRoleRemover) { - console.log('RealmRolePermissionsCtrl'); - $scope.role = role; - $scope.realm = realm; - - $scope.remove = function() { - RealmRoleRemover.remove($scope.role, realm, Dialog, $location, Notifications); - }; - - RoleManagementPermissions.get({realm: realm.realm, role: role.id}, function(data) { - $scope.permissions = data; - $scope.$watch('permissions.enabled', function(newVal, oldVal) { - if (newVal != oldVal) { - var param = {enabled: $scope.permissions.enabled}; - $scope.permissions= RoleManagementPermissions.update({realm: realm.realm, role:role.id}, param); - } - }, true); - }); - Client.query({realm: realm.realm, clientId: getManageClientId(realm)}, function(data) { - $scope.realmManagementClientId = data[0].id; - }); -}); -module.controller('ClientRolePermissionsCtrl', function($scope, $http, $route, $location, realm, client, role, Client, RoleManagementPermissions, Client, Notifications) { - console.log('RealmRolePermissionsCtrl'); - $scope.client = client; - $scope.role = role; - $scope.realm = realm; - RoleManagementPermissions.get({realm: realm.realm, role: role.id}, function(data) { - $scope.permissions = data; - $scope.$watch('permissions.enabled', function(newVal, oldVal) { - if (newVal != oldVal) { - var param = {enabled: $scope.permissions.enabled}; - $scope.permissions = RoleManagementPermissions.update({realm: realm.realm, role:role.id}, param); - } - }, true); - }); - Client.query({realm: realm.realm, clientId: getManageClientId(realm)}, function(data) { - $scope.realmManagementClientId = data[0].id; - }); -}); - -module.controller('UsersPermissionsCtrl', function($scope, $http, $route, $location, realm, UsersManagementPermissions, Client, Notifications) { - console.log('UsersPermissionsCtrl'); - $scope.realm = realm; - var first = true; - UsersManagementPermissions.get({realm: realm.realm}, function(data) { - $scope.permissions = data; - $scope.$watch('permissions.enabled', function(newVal, oldVal) { - if (newVal != oldVal) { - var param = {enabled: $scope.permissions.enabled}; - $scope.permissions = UsersManagementPermissions.update({realm: realm.realm}, param); - - } - }, true); - }); - Client.query({realm: realm.realm, clientId: getManageClientId(realm)}, function(data) { - $scope.realmManagementClientId = data[0].id; - }); - - - - -}); - -module.controller('ClientPermissionsCtrl', function($scope, $http, $route, $location, realm, client, Client, ClientManagementPermissions, Notifications) { - $scope.client = client; - $scope.realm = realm; - ClientManagementPermissions.get({realm: realm.realm, client: client.id}, function(data) { - $scope.permissions = data; - $scope.$watch('permissions.enabled', function(newVal, oldVal) { - if (newVal != oldVal) { - var param = {enabled: $scope.permissions.enabled}; - $scope.permissions = ClientManagementPermissions.update({realm: realm.realm, client: client.id}, param); - } - }, true); - }); - Client.query({realm: realm.realm, clientId: getManageClientId(realm)}, function(data) { - $scope.realmManagementClientId = data[0].id; - }); -}); - -module.controller('IdentityProviderPermissionCtrl', function($scope, $http, $route, $location, realm, identityProvider, Client, IdentityProviderManagementPermissions, Notifications) { - $scope.identityProvider = identityProvider; - $scope.realm = realm; - IdentityProviderManagementPermissions.get({realm: realm.realm, alias: identityProvider.alias}, function(data) { - $scope.permissions = data; - $scope.$watch('permissions.enabled', function(newVal, oldVal) { - if (newVal != oldVal) { - var param = {enabled: $scope.permissions.enabled}; - $scope.permissions = IdentityProviderManagementPermissions.update({realm: realm.realm, alias: identityProvider.alias}, param); - } - }, true); - }); - Client.query({realm: realm.realm, clientId: getManageClientId(realm)}, function(data) { - $scope.realmManagementClientId = data[0].id; - }); -}); - -module.controller('GroupPermissionsCtrl', function($scope, $http, $route, $location, realm, group, GroupManagementPermissions, Client, Notifications) { - $scope.group = group; - $scope.realm = realm; - Client.query({realm: realm.realm, clientId: getManageClientId(realm)}, function(data) { - $scope.realmManagementClientId = data[0].id; - }); - GroupManagementPermissions.get({realm: realm.realm, group: group.id}, function(data) { - $scope.permissions = data; - $scope.$watch('permissions.enabled', function(newVal, oldVal) { - if (newVal != oldVal) { - var param = {enabled: $scope.permissions.enabled}; - $scope.permissions = GroupManagementPermissions.update({realm: realm.realm, group: group.id}, param); - } - }, true); - }); -}); \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-services.js b/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-services.js deleted file mode 100644 index 5e20472233..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-services.js +++ /dev/null @@ -1,218 +0,0 @@ -module.factory('ResourceServer', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server', { - realm : '@realm', - client: '@client' - }, { - 'update' : {method : 'PUT'}, - 'import' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/import', method : 'POST'}, - 'settings' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/settings', method : 'GET'} - }); -}); - -module.factory('ResourceServerResource', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/resource/:rsrid', { - realm : '@realm', - client: '@client', - rsrid : '@rsrid' - }, { - 'update' : {method : 'PUT'}, - 'search' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/resource/search', method : 'GET'}, - 'scopes' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/resource/:rsrid/scopes', method : 'GET', isArray: true}, - 'permissions' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/resource/:rsrid/permissions', method : 'GET', isArray: true} - }); -}); - -module.factory('ResourceServerScope', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/scope/:id', { - realm : '@realm', - client: '@client', - id : '@id' - }, { - 'update' : {method : 'PUT'}, - 'search' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/scope/search', method : 'GET'}, - 'resources' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/scope/:id/resources', method : 'GET', isArray: true}, - 'permissions' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/scope/:id/permissions', method : 'GET', isArray: true}, - }); -}); - -module.factory('ResourceServerPolicy', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/policy/:type/:id', { - realm : '@realm', - client: '@client', - id : '@id', - type: '@type' - }, { - 'update' : {method : 'PUT'}, - 'search' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/policy/search', method : 'GET'}, - 'associatedPolicies' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/policy/:id/associatedPolicies', method : 'GET', isArray: true}, - 'dependentPolicies' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/policy/:id/dependentPolicies', method : 'GET', isArray: true}, - 'scopes' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/policy/:id/scopes', method : 'GET', isArray: true}, - 'resources' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/policy/:id/resources', method : 'GET', isArray: true} - }); -}); - -module.factory('ResourceServerPermission', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/permission/:type/:id', { - realm : '@realm', - client: '@client', - type: '@type', - id : '@id' - }, { - 'update' : {method : 'PUT'}, - 'search' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/permission/search', method : 'GET'}, - 'searchPolicies' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/policy', method : 'GET', isArray: true}, - 'associatedPolicies' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/policy/:id/associatedPolicies', method : 'GET', isArray: true}, - 'dependentPolicies' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/policy/:id/dependentPolicies', method : 'GET', isArray: true}, - 'scopes' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/permission/:id/scopes', method : 'GET', isArray: true}, - 'resources' : {url: authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/permission/:id/resources', method : 'GET', isArray: true} - }); -}); - -module.factory('PolicyProvider', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/authz/resource-server/policy/providers', { - realm : '@realm', - client: '@client' - }); -}); - -module.service('AuthzDialog', function($modal) { - var dialog = {}; - - var openDialog = function(title, message, btns, template) { - var controller = function($scope, $modalInstance, $sce, title, message, btns) { - $scope.title = title; - $scope.message = $sce.trustAsHtml(message); - $scope.btns = btns; - - $scope.ok = function () { - $modalInstance.close(); - }; - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - }; - - return $modal.open({ - templateUrl: resourceUrl + template, - controller: controller, - resolve: { - title: function() { - return title; - }, - message: function() { - return message; - }, - btns: function() { - return btns; - } - } - }).result; - } - - dialog.confirmDeleteWithMsg = function(name, type, msg, success) { - var title = 'Delete ' + type; - msg += 'Are you sure you want to permanently delete the ' + type + ' ' + name + ' ?'; - var btns = { - ok: { - label: 'Delete', - cssClass: 'btn btn-danger' - }, - cancel: { - label: 'Cancel', - cssClass: 'btn btn-default' - } - } - - openDialog(title, msg, btns, '/templates/authz/kc-authz-modal.html').then(success); - }; - - dialog.confirmDelete = function(name, type, success) { - var title = 'Delete ' + type; - var msg = 'Are you sure you want to permanently delete the ' + type + ' ' + name + ' ?'; - var btns = { - ok: { - label: 'Delete', - cssClass: 'btn btn-danger' - }, - cancel: { - label: 'Cancel', - cssClass: 'btn btn-default' - } - } - - openDialog(title, msg, btns, '/templates/authz/kc-authz-modal.html').then(success); - } - - return dialog; -}); - -module.factory('RoleManagementPermissions', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/roles-by-id/:role/management/permissions', { - realm : '@realm', - role : '@role' - }, { - update: { - method: 'PUT' - } - }); -}); - -module.factory('UsersManagementPermissions', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users-management-permissions', { - realm : '@realm' - }, { - update: { - method: 'PUT' - } - }); -}); - -module.factory('ClientManagementPermissions', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/management/permissions', { - realm : '@realm', - client : '@client' - }, { - update: { - method: 'PUT' - } - }); -}); - -module.factory('IdentityProviderManagementPermissions', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/identity-provider/instances/:alias/management/permissions', { - realm : '@realm', - alias : '@alias' - }, { - update: { - method: 'PUT' - } - }); -}); - -module.factory('GroupManagementPermissions', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/:group/management/permissions', { - realm : '@realm', - group : '@group' - }, { - update: { - method: 'PUT' - } - }); -}); - -module.factory('policyViewState', [function () { - return { - model: { - state: {} - } - }; -}]); - -module.factory('viewState', [function () { - return { - model: { - state: {} - } - }; -}]); - diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js deleted file mode 100755 index 93583e3f56..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js +++ /dev/null @@ -1,4054 +0,0 @@ -Array.prototype.remove = function(from, to) { - var rest = this.slice((to || from) + 1 || this.length); - this.length = from < 0 ? this.length + from : from; - return this.push.apply(this, rest); -}; - -module.controller('ClientTabCtrl', function(Dialog, $scope, Current, Notifications, $location) { - $scope.removeClient = function() { - Dialog.confirmDelete($scope.client.clientId, 'client', function() { - $scope.client.$remove({ - realm : Current.realm.realm, - client : $scope.client.id - }, function() { - $location.url("/realms/" + Current.realm.realm + "/clients"); - Notifications.success("The client has been deleted."); - }); - }); - }; -}); - -module.controller('ClientRoleListCtrl', function($scope, $route, realm, client, ClientRoleList, RoleById, Notifications, Dialog) { - $scope.realm = realm; - $scope.roles = []; - $scope.client = client; - - $scope.query = { - realm: realm.realm, - client: $scope.client.id, - search : null, - max : 20, - first : 0 - } - - $scope.$watch('query.search', function (newVal, oldVal) { - if($scope.query.search && $scope.query.search.length >= 3) { - $scope.firstPage(); - } - }, true); - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.searchQuery(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.searchQuery(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.searchQuery(); - } - - $scope.searchQuery = function() { - $scope.searchLoaded = false; - - $scope.roles = ClientRoleList.query($scope.query, function() { - $scope.searchLoaded = true; - $scope.lastSearch = $scope.query.search; - }); - }; - - $scope.searchQuery(); - - $scope.removeRole = function(role) { - Dialog.confirmDelete(role.name, 'role', function() { - RoleById.remove({ - realm: realm.realm, - role: role.id - }, function () { - $route.reload(); - Notifications.success("The role has been deleted."); - }); - }); - }; -}); - -module.controller('ClientCredentialsCtrl', function($scope, $location, realm, client, clientAuthenticatorProviders, clientConfigProperties, Client, ClientRegistrationAccessToken, Notifications) { - $scope.realm = realm; - $scope.client = angular.copy(client); - $scope.clientAuthenticatorProviders = clientAuthenticatorProviders; - - var updateCurrentPartial = 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; - case 'client-secret-jwt': - $scope.clientAuthenticatorConfigPartial = 'client-credentials-secret-jwt.html'; - break; - case 'client-x509': - $scope.clientAuthenticatorConfigPartial = 'client-credentials-x509.html'; - break; - default: - $scope.currentAuthenticatorConfigProperties = clientConfigProperties[val]; - $scope.clientAuthenticatorConfigPartial = 'client-credentials-generic.html'; - break; - } - }; - - updateCurrentPartial(client.clientAuthenticatorType); - - $scope.$watch('client.clientAuthenticatorType', function() { - if (!angular.equals($scope.client.clientAuthenticatorType, client.clientAuthenticatorType)) { - - Client.update({ - realm : realm.realm, - client : client.id - }, $scope.client, function() { - $scope.changed = false; - client = angular.copy($scope.client); - updateCurrentPartial(client.clientAuthenticatorType) - }); - - } - }, true); - - $scope.regenerateRegistrationAccessToken = function() { - var secret = ClientRegistrationAccessToken.update({ realm : $scope.realm.realm, client : $scope.client.id }, - function(data) { - Notifications.success('The registration access token has been updated.'); - $scope.client['registrationAccessToken'] = data.registrationAccessToken; - }, - function() { - Notifications.error('Failed to update the registration access token'); - } - ); - }; -}); - -module.controller('ClientSecretCtrl', function($scope, $location, Client, ClientSecret, Notifications, $route) { - - 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 : $scope.realm.realm, client : $scope.client.id }, - function() { - $route.reload(); - Notifications.success('The secret has been changed.'); - }, - function() { - Notifications.error("The secret was not changed due to a problem."); - $scope.secret = "error"; - } - ); - }; - - $scope.removeRotatedSecret = function(){ - ClientSecret.invalidate({realm: $scope.realm.realm, client: $scope.client.id }, - function(){ - $route.reload(); - Notifications.success('The rotated secret has been invalidated.'); - }, - function(){ - Notifications.error("The rotated secret was not invalidated due to a problem."); - } - ); - }; - - $scope.tokenEndpointAuthSigningAlg = $scope.client.attributes['token.endpoint.auth.signing.alg']; - - if ($scope.client.attributes['client.secret.expiration.time']){ - $scope.secret_expiration_time = $scope.client.attributes['client.secret.expiration.time'] * 1000; - } - - if ($scope.client.attributes["client.secret.rotated"]) { - $scope.secretRotated = $scope.client.attributes["client.secret.rotated"]; - } - - if ($scope.client.attributes['client.secret.rotated.expiration.time']){ - $scope.rotated_secret_expiration_time = $scope.client.attributes['client.secret.rotated.expiration.time'] * 1000; - } - - $scope.switchChange = function() { - $scope.changed = true; - } - - $scope.save = function() { - $scope.client.attributes['token.endpoint.auth.signing.alg'] = $scope.tokenEndpointAuthSigningAlg; - - Client.update({ - realm : $scope.realm.realm, - client : $scope.client.id - }, $scope.client, function() { - $scope.changed = false; - $scope.clientCopy = angular.copy($scope.client); - Notifications.success("Client authentication configuration has been saved to the client."); - }); - }; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.cancel = function() { - $location.url("/realms/" + $scope.realm.realm + "/clients/" + $scope.client.id + "/credentials"); - $route.reload(); - }; - -}); - -module.controller('ClientX509Ctrl', function($scope, $location, Client, Notifications) { - console.log('ClientX509Ctrl invoked'); - - $scope.clientCopy = angular.copy($scope.client); - $scope.changed = false; - - $scope.$watch('client', function() { - if (!angular.equals($scope.client, $scope.clientCopy)) { - $scope.changed = true; - } - }, true); - - function updateProperties() { - if ($scope.client.attributes["x509.allow.regex.pattern.comparison"]) { - if ($scope.client.attributes["x509.allow.regex.pattern.comparison"] == "true") { - $scope.allowRegexPatternComparison = true; - } else { - $scope.allowRegexPatternComparison = false; - } - } - } - - updateProperties(); - - $scope.switchChange = function() { - $scope.changed = true; - } - - $scope.save = function() { - if ($scope.allowRegexPatternComparison == true) { - $scope.client.attributes["x509.allow.regex.pattern.comparison"] = "true"; - } else { - $scope.client.attributes["x509.allow.regex.pattern.comparison"] = "false"; - } - - if (!$scope.client.attributes["x509.subjectdn"]) { - Notifications.error("The SubjectDN must not be empty."); - } else { - Client.update({ - realm : $scope.realm.realm, - client : $scope.client.id - }, $scope.client, function() { - $scope.changed = false; - $scope.clientCopy = angular.copy($scope.client); - Notifications.success("Client authentication configuration has been saved to the client."); - }, function() { - Notifications.error("The SubjectDN was not changed due to a problem."); - $scope.subjectdn = "error"; - }); - } - }; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.reset = function() { - $scope.client.attributes["x509.subjectdn"] = $scope.clientCopy.attributes["x509.subjectdn"]; - $scope.client.attributes["x509.allow.regex.pattern.comparison"] = $scope.clientCopy.attributes["x509.allow.regex.pattern.comparison"]; - updateProperties(); - $location.url("/realms/" + $scope.realm.realm + "/clients/" + $scope.client.id + "/credentials"); - }; -}); - -module.controller('ClientSignedJWTCtrl', function($scope, Client, Notifications) { - console.log('ClientSignedJWTCtrl invoked'); - - $scope.tokenEndpointAuthSigningAlg = $scope.client.attributes['token.endpoint.auth.signing.alg']; - - $scope.$watch('tokenEndpointAuthSigningAlg', function() { - if (!angular.equals($scope.client.attributes['token.endpoint.auth.signing.alg'], $scope.tokenEndpointAuthSigningAlg)) { - $scope.client.attributes['token.endpoint.auth.signing.alg'] = $scope.tokenEndpointAuthSigningAlg; - - Client.update({ - realm : $scope.realm.realm, - client : $scope.client.id - }, $scope.client, function() { - Notifications.success("Signature algorithm has been saved to the client."); - }); - } - }, true); - -}); - -module.controller('ClientGenericCredentialsCtrl', function($scope, $location, Client, Notifications) { - - console.log('ClientGenericCredentialsCtrl invoked'); - - $scope.clientCopy = angular.copy($scope.client); - $scope.changed = false; - - $scope.$watch('client', function() { - if (!angular.equals($scope.client, $scope.clientCopy)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - - Client.update({ - realm : $scope.realm.realm, - client : $scope.client.id - }, $scope.client, function() { - $scope.changed = false; - $scope.clientCopy = angular.copy($scope.client); - Notifications.success("Client authentication configuration has been saved to the client."); - }); - }; - - $scope.reset = function() { - $scope.client = angular.copy($scope.clientCopy); - $scope.changed = false; - }; -}); - -module.controller('ClientIdentityProviderCtrl', function($scope, $location, $route, realm, client, Client, $location, Notifications) { - $scope.realm = realm; - $scope.client = angular.copy(client); - var length = 0; - - if ($scope.client.identityProviders) { - length = $scope.client.identityProviders.length; - - for (i = 0; i < $scope.client.identityProviders.length; i++) { - var clientProvider = $scope.client.identityProviders[i]; - if (clientProvider.retrieveToken) { - clientProvider.retrieveToken = clientProvider.retrieveToken.toString(); - } - } - - } else { - $scope.client.identityProviders = []; - } - - $scope.identityProviders = []; - var providersMissingInClient = []; - - for (j = 0; j < realm.identityProviders.length; j++) { - var identityProvider = realm.identityProviders[j]; - var clientProvider = null; - - for (i = 0; i < $scope.client.identityProviders.length; i++) { - clientProvider = $scope.client.identityProviders[i]; - - if (clientProvider) { - - if (clientProvider.id == identityProvider.id) { - $scope.identityProviders[i] = {}; - $scope.identityProviders[i].identityProvider = identityProvider; - $scope.identityProviders[i].retrieveToken = clientProvider.retrieveToken; - break; - } - - clientProvider = null; - } - } - - if (clientProvider == null) { - providersMissingInClient.push(identityProvider); - } - } - - for (j = 0; j < providersMissingInClient.length; j++) { - var identityProvider = providersMissingInClient[j]; - - var currentProvider = {}; - currentProvider.identityProvider = identityProvider; - currentProvider.retrieveToken = "false"; - $scope.identityProviders.push(currentProvider); - - var currentClientProvider = {}; - currentClientProvider.id = identityProvider.id; - currentClientProvider.retrieveToken = "false"; - $scope.client.identityProviders.push(currentClientProvider); - } - - var oldCopy = angular.copy($scope.client); - - $scope.save = function() { - - Client.update({ - realm : realm.realm, - client : client.id - }, $scope.client, function() { - $scope.changed = false; - $route.reload(); - Notifications.success("Your changes have been saved to the client."); - }); - }; - - $scope.reset = function() { - $scope.client = angular.copy(oldCopy); - $scope.changed = false; - }; - - $scope.$watch('client', function() { - if (!angular.equals($scope.client, oldCopy)) { - $scope.changed = true; - } - }, true); -}); - -module.controller('ClientSamlKeyCtrl', function($scope, $location, $http, $upload, realm, client, - ClientCertificate, ClientCertificateGenerate, - ClientCertificateDownload, Notifications) { - $scope.realm = realm; - $scope.client = client; - - var signingKeyInfo = ClientCertificate.get({ realm : realm.realm, client : client.id, attribute: 'saml.signing' }, - function() { - $scope.signingKeyInfo = signingKeyInfo; - } - ); - - $scope.generateSigningKey = function() { - var keyInfo = ClientCertificateGenerate.generate({ realm : realm.realm, client : client.id, attribute: 'saml.signing' }, - function() { - Notifications.success('Signing key has been regenerated.'); - $scope.signingKeyInfo = keyInfo; - }, - function() { - Notifications.error("Signing key was not regenerated."); - } - ); - }; - - $scope.importSigningKey = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/saml/Signing/import/saml.signing"); - }; - - $scope.exportSigningKey = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/saml/Signing/export/saml.signing"); - }; - - var encryptionKeyInfo = ClientCertificate.get({ realm : realm.realm, client : client.id, attribute: 'saml.encryption' }, - function() { - $scope.encryptionKeyInfo = encryptionKeyInfo; - } - ); - - $scope.generateEncryptionKey = function() { - var keyInfo = ClientCertificateGenerate.generate({ realm : realm.realm, client : client.id, attribute: 'saml.encryption' }, - function() { - Notifications.success('Encryption key has been regenerated.'); - $scope.encryptionKeyInfo = keyInfo; - }, - function() { - Notifications.error("Encryption key was not regenerated."); - } - ); - }; - - $scope.importEncryptionKey = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/saml/Encryption/import/saml.encryption"); - }; - - $scope.exportEncryptionKey = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/saml/Encryption/export/saml.encryption"); - }; - - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); -}); - -module.controller('ClientCertificateImportCtrl', function($scope, $location, $http, $upload, realm, client, callingContext, $routeParams, - ClientCertificate, ClientCertificateGenerate, - ClientCertificateDownload, Notifications) { - - console.log("callingContext: " + callingContext); - - var keyType = $routeParams.keyType; - var attribute = $routeParams.attribute; - $scope.realm = realm; - $scope.client = client; - $scope.keyType = keyType; - - if (callingContext == 'saml') { - var uploadUrl = authUrl + '/admin/realms/' + realm.realm + '/clients/' + client.id + '/certificates/' + attribute + '/upload'; - var redirectLocation = "/realms/" + realm.realm + "/clients/" + client.id + "/saml/keys"; - } else if (callingContext == 'oidc') { - var uploadUrl = authUrl + '/admin/realms/' + realm.realm + '/clients/' + client.id + '/certificates/' + attribute + '/upload-certificate'; - var redirectLocation = "/realms/" + realm.realm + "/clients/" + client.id + "/oidc/keys"; - } - - $scope.files = []; - - $scope.onFileSelect = function($files) { - $scope.files = $files; - }; - - $scope.cancel = function() { - $location.url(redirectLocation); - } - - $scope.keyFormats = [ - "JKS", - "PKCS12", - "Certificate PEM" - ]; - - if (callingContext == 'oidc') { - $scope.keyFormats.push('Public Key PEM'); - $scope.keyFormats.push('JSON Web Key Set'); - } - - $scope.hideKeystoreSettings = function() { - return $scope.uploadKeyFormat == 'Certificate PEM' || $scope.uploadKeyFormat == 'Public Key PEM' || $scope.uploadKeyFormat == 'JSON Web Key Set'; - } - - $scope.uploadKeyFormat = $scope.keyFormats[0]; - - $scope.uploadFile = function() { - //$files: an array of files selected, each file has name, size, and type. - for (var i = 0; i < $scope.files.length; i++) { - var $file = $scope.files[i]; - $scope.upload = $upload.upload({ - url: uploadUrl, - // method: POST or PUT, - // headers: {'headerKey': 'headerValue'}, withCredential: true, - data: {keystoreFormat: $scope.uploadKeyFormat, - keyAlias: $scope.uploadKeyAlias, - keyPassword: $scope.uploadKeyPassword, - storePassword: $scope.uploadStorePassword - }, - file: $file - /* set file formData name for 'Content-Desposition' header. Default: 'file' */ - //fileFormDataName: myFile, - /* customize how data is added to formData. See #40#issuecomment-28612000 for example */ - //formDataAppender: function(formData, key, val){} - }).then(function(data, status, headers) { - Notifications.success("Keystore uploaded successfully."); - $location.url(redirectLocation); - }) - //.then(success, error, progress); - } - }; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); -}); - -module.controller('ClientCertificateExportCtrl', function($scope, $location, $http, $upload, realm, client, callingContext, $routeParams, - ClientCertificate, ClientCertificateGenerate, - ClientCertificateDownload, Notifications) { - var keyType = $routeParams.keyType; - var attribute = $routeParams.attribute; - $scope.realm = realm; - $scope.client = client; - $scope.keyType = keyType; - - if (callingContext == 'saml') { - var downloadUrl = authUrl + '/admin/realms/' + realm.realm + '/clients/' + client.id + '/certificates/' + attribute + '/download'; - var realmCertificate = true; - } else if (callingContext == 'oidc') { - var downloadUrl = authUrl + '/admin/realms/' + realm.realm + '/clients/' + client.id + '/certificates/' + attribute + '/generate-and-download' - var realmCertificate = false; - } - - var jks = { - keyAlias: client.clientId, - realmAlias: realm.realm, - realmCertificate: realmCertificate - }; - - $scope.keyFormats = [ - "JKS", - "PKCS12" - ]; - - var keyInfo = ClientCertificate.get({ realm : realm.realm, client : client.id, attribute: attribute }, - function() { - $scope.keyInfo = keyInfo; - } - ); - $scope.jks = jks; - $scope.jks.format = $scope.keyFormats[0]; - - $scope.download = function() { - $http({ - url: downloadUrl, - method: 'POST', - responseType: 'arraybuffer', - data: $scope.jks, - headers: { - 'Content-Type': 'application/json', - 'Accept': 'application/octet-stream' - } - }).then(function(response){ - var blob = new Blob([response.data], { - type: 'application/octet-stream' - }); - var ext = ".jks"; - if ($scope.jks.format == 'PKCS12') ext = ".p12"; - - if (callingContext == 'oidc') { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/oidc/keys"); - Notifications.success("New keypair and certificate generated successfully. Download keystore file") - } - - saveAs(blob, 'keystore' + ext); - }).catch(function(response) { - var errorMsg = 'Error downloading'; - try { - var error = JSON.parse(String.fromCharCode.apply(null, new Uint8Array(response.data))); - errorMsg = error['error_description'] ? error['error_description'] : errorMsg; - } catch (err) { - } - Notifications.error(errorMsg); - }); - } - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/oidc/keys"); - } -}); - -module.controller('ClientOidcKeyCtrl', function($scope, $location, realm, client, Client, ClientCertificate, Notifications, $route) { - $scope.realm = realm; - $scope.client = angular.copy(client); - - var signingKeyInfo = ClientCertificate.get({ realm : realm.realm, client : client.id, attribute: 'jwt.credential' }, - function() { - $scope.signingKeyInfo = signingKeyInfo; - } - ); - - $scope.changed = false; - - $scope.$watch('client', function() { - if (!angular.equals($scope.client, client)) { - $scope.changed = true; - } - }, true); - - if ($scope.client.attributes["use.jwks.url"]) { - if ($scope.client.attributes["use.jwks.url"] == "true") { - $scope.useJwksUrl = true; - } else { - $scope.useJwksUrl = false; - } - } - - if ($scope.client.attributes["use.jwks.string"]) { - if ($scope.client.attributes["use.jwks.string"] == "true") { - $scope.useJwksString = true; - } else { - $scope.useJwksString = false; - } - } - - $scope.jwksUrlSwitchChange = function() { - $scope.changed = true; - if ($scope.useJwksUrl == false) { - $scope.useJwksString = false; - } - } - - $scope.jwksStringSwitchChange = function() { - $scope.changed = true; - if ($scope.useJwksString == false) { - $scope.useJwksUrl = false; - } - } - - $scope.save = function() { - - if ($scope.useJwksUrl == true) { - $scope.client.attributes["use.jwks.url"] = "true"; - } else { - $scope.client.attributes["use.jwks.url"] = "false"; - } - - if ($scope.useJwksString == true) { - $scope.client.attributes["use.jwks.string"] = "true"; - } else { - $scope.client.attributes["use.jwks.string"] = "false"; - } - - Client.update({ - realm : realm.realm, - client : client.id - }, $scope.client, function() { - $scope.changed = false; - client = angular.copy($scope.client); - Notifications.success("OIDC key has been saved to the client."); - }); - }; - - $scope.importCertificate = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/oidc/Signing/import/jwt.credential"); - }; - - $scope.generateSigningKey = function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/oidc/Signing/export/jwt.credential"); - }; - - $scope.reset = function() { - $route.reload(); - }; -}); - -module.controller('ClientSessionsCtrl', function($scope, realm, sessionCount, client, - ClientUserSessions) { - $scope.realm = realm; - $scope.count = sessionCount.count; - $scope.sessions = []; - $scope.client = client; - - $scope.page = 0; - - $scope.query = { - realm : realm.realm, - client: $scope.client.id, - max : 5, - first : 0 - } - - $scope.firstPage = function() { - $scope.query.first = 0; - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.loadUsers(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.loadUsers(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.loadUsers(); - } - - $scope.toDate = function(val) { - return new Date(val); - }; - - $scope.loadUsers = function() { - ClientUserSessions.query($scope.query, function(updated) { - $scope.sessions = updated; - }) - }; -}); - -module.controller('ClientOfflineSessionsCtrl', function($scope, realm, offlineSessionCount, client, - ClientOfflineSessions) { - $scope.realm = realm; - $scope.count = offlineSessionCount.count; - $scope.sessions = []; - $scope.client = client; - - $scope.page = 0; - - $scope.query = { - realm : realm.realm, - client: $scope.client.id, - max : 5, - first : 0 - } - - $scope.firstPage = function() { - $scope.query.first = 0; - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.loadUsers(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.loadUsers(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.loadUsers(); - } - - $scope.toDate = function(val) { - return new Date(val); - }; - - $scope.loadUsers = function() { - ClientOfflineSessions.query($scope.query, function(updated) { - $scope.sessions = updated; - }) - }; -}); - -module.controller('ClientRoleDetailCtrl', function($scope, $route, realm, client, role, roles, Client, - Role, ClientRole, RoleById, RoleRealmComposites, RoleClientComposites, - $http, $location, Dialog, Notifications, ComponentUtils) { - $scope.realm = realm; - $scope.client = client; - $scope.role = angular.copy(role); - $scope.create = !role.name; - - $scope.changed = $scope.create; - - $scope.save = function() { - convertAttributeValuesToLists(); - if ($scope.create) { - ClientRole.save({ - realm: realm.realm, - client : client.id - }, $scope.role, function (data, headers) { - $scope.changed = false; - convertAttributeValuesToString($scope.role); - role = angular.copy($scope.role); - - ClientRole.get({ realm: realm.realm, client : client.id, role: role.name }, function(role) { - var id = role.id; - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/roles/" + id); - Notifications.success("The role has been created."); - }); - }); - } else { - $scope.update(); - } - }; - - $scope.remove = function() { - Dialog.confirmDelete($scope.role.name, 'role', function() { - $scope.role.$remove({ - realm : realm.realm, - client : client.id, - role : $scope.role.id - }, function() { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/roles"); - Notifications.success("The role has been deleted."); - }); - }); - }; - - $scope.cancel = function () { - $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/roles"); - }; - - $scope.addAttribute = function() { - $scope.role.attributes[$scope.newAttribute.key] = $scope.newAttribute.value; - delete $scope.newAttribute; - } - - $scope.removeAttribute = function(key) { - delete $scope.role.attributes[key]; - } - - function convertAttributeValuesToLists() { - var attrs = $scope.role.attributes; - for (var attribute in attrs) { - if (typeof attrs[attribute] === "string") { - var attrVals = attrs[attribute].split("##"); - attrs[attribute] = attrVals; - } - } - } - - function convertAttributeValuesToString(role) { - var attrs = role.attributes; - for (var attribute in attrs) { - if (typeof attrs[attribute] === "object") { - var attrVals = attrs[attribute].join("##"); - attrs[attribute] = attrVals; - } - } - } - - roleControl($scope, $route, realm, role, roles, Client, - ClientRole, RoleById, RoleRealmComposites, RoleClientComposites, - $http, $location, Notifications, Dialog, ComponentUtils); - -}); - -module.controller('ClientRoleMembersCtrl', function($scope, realm, client, role, ClientRoleMembership, Dialog, Notifications, $location) { - $scope.realm = realm; - $scope.page = 0; - $scope.role = role; - $scope.client = client; - - $scope.query = { - realm: realm.realm, - role: role.name, - client: client.id, - max : 5, - first : 0 - } - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.searchQuery(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.searchQuery(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.searchQuery(); - } - - $scope.searchQuery = function() { - $scope.searchLoaded = false; - - $scope.users = ClientRoleMembership.query($scope.query, function() { - console.log('search loaded'); - $scope.searchLoaded = true; - $scope.lastSearch = $scope.query.search; - }); - }; - - $scope.searchQuery(); -}); - -module.controller('ClientImportCtrl', function($scope, $location, $upload, realm, serverInfo, Notifications) { - - $scope.realm = realm; - - $scope.files = []; - - $scope.onFileSelect = function($files) { - $scope.files = $files; - }; - - $scope.clearFileSelect = function() { - $scope.files = null; - } - - $scope.uploadFile = function() { - //$files: an array of files selected, each file has name, size, and type. - for (var i = 0; i < $scope.files.length; i++) { - var $file = $scope.files[i]; - $scope.upload = $upload.upload({ - url: authUrl + '/admin/realms/' + realm.realm + '/client-importers/' + $scope.configFormat.id + '/upload', - // method: POST or PUT, - // headers: {'headerKey': 'headerValue'}, withCredential: true, - data: {myObj: ""}, - file: $file - /* set file formData name for 'Content-Desposition' header. Default: 'file' */ - //fileFormDataName: myFile, - /* customize how data is added to formData. See #40#issuecomment-28612000 for example */ - //formDataAppender: function(formData, key, val){} - }).success(function(data, status, headers) { - Notifications.success("Uploaded successfully."); - $location.url("/realms/" + realm.realm + "/clients"); - }) - .error(function() { - Notifications.error("The file can not be uploaded. Please verify the file."); - - }); - //.then(success, error, progress); - } - }; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); -}); - - -module.controller('ClientListCtrl', function($scope, realm, Client, ClientListSearchState, $route, Dialog, Notifications) { - $scope.init = function() { - $scope.realm = realm; - $scope.searchLoaded = true; - - ClientListSearchState.query.realm = realm.realm; - $scope.query = ClientListSearchState.query; - - if (!ClientListSearchState.isFirstSearch) { - $scope.searchQuery(); - } else { - $scope.query.clientId = null; - $scope.firstPage(); - } - }; - - $scope.searchQuery = function() { - console.log("query.search: ", $scope.query); - $scope.searchLoaded = false; - - $scope.clients = Client.query($scope.query, function() { - $scope.searchLoaded = true; - $scope.lastSearch = $scope.query.search; - ClientListSearchState.isFirstSearch = false; - }); - }; - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.searchQuery(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.searchQuery(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.searchQuery(); - } - - $scope.removeClient = function(client) { - Dialog.confirmDelete(client.clientId, 'client', function() { - Client.remove({ - realm : realm.realm, - client : client.id - }, function() { - $route.reload(); - Notifications.success("The client has been deleted."); - }); - }); - }; - - $scope.exportClient = function(client) { - var clientCopy = angular.copy(client); - delete clientCopy.id; - - if (clientCopy.protocolMappers) { - 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'); - } -}); - -module.controller('ClientInstallationCtrl', function($scope, realm, client, serverInfo, ClientInstallation,$http, $routeParams) { - $scope.realm = realm; - $scope.client = client; - $scope.installation = null; - $scope.download = null; - $scope.configFormat = null; - $scope.filename = null; - - var protocol = client.protocol; - if (!protocol) protocol = 'openid-connect'; - $scope.configFormats = serverInfo.clientInstallations[protocol]; - console.log('configFormats.length: ' + $scope.configFormats.length); - - $scope.changeFormat = function() { - var url = ClientInstallation.url({ realm: $routeParams.realm, client: $routeParams.client, provider: $scope.configFormat.id }); - if ($scope.configFormat.mediaType == 'application/zip') { - $http({ - url: url, - method: 'GET', - responseType: 'arraybuffer', - cache: false - }).then(function(response) { - var installation = response.data; - $scope.installation = installation; - } - ); - } else { - $http.get(url).then(function (response) { - var installation = response.data; - if ($scope.configFormat.mediaType == 'application/json') { - installation = angular.fromJson(response.data); - installation = angular.toJson(installation, true); - } - $scope.installation = installation; - }); - } - - }; - $scope.download = function() { - saveAs(new Blob([$scope.installation], { type: $scope.configFormat.mediaType }), $scope.configFormat.filename); - } -}); - - -module.controller('ClientDetailCtrl', function($scope, realm, client, flows, $route, serverInfo, Client, ClientDescriptionConverter, Components, ClientStorageOperations, $location, $modal, Dialog, Notifications, TimeUnit2) { - $scope.serverInfo = serverInfo; - $scope.flows = []; - $scope.clientFlows = []; - var emptyFlow = { - id: "", - alias: "" - } - for (var i=0 ; i 0) { - $scope.client.requestUris = $scope.client.attributes["request.uris"].split("##"); - } else { - $scope.client.requestUris = []; - } - - if ($scope.client.attributes["post.logout.redirect.uris"] && $scope.client.attributes["post.logout.redirect.uris"].length > 0) { - $scope.postLogoutRedirectUris = $scope.client.attributes["post.logout.redirect.uris"].split("##"); - } else { - $scope.postLogoutRedirectUris = []; - } - - if ($scope.client.attributes["default.acr.values"] && $scope.client.attributes["default.acr.values"].length > 0) { - $scope.defaultAcrValues = $scope.client.attributes["default.acr.values"].split("##"); - } else { - $scope.defaultAcrValues = []; - } - deletedSomeDefaultAcrValue = false; - - try { - $scope.acrLoaMap = JSON.parse($scope.client.attributes["acr.loa.map"] || "{}"); - } catch (e) { - $scope.acrLoaMap = {}; - } - } - - if (!$scope.create) { - $scope.client = client; - updateProperties(); - - $scope.clientEdit = angular.copy(client); - } - - - $scope.samlIdpInitiatedUrl = function(ssoName) { - return encodeURI($location.absUrl().replace(/\/admin.*/, "/realms/") + realm.realm + "/protocol/saml/clients/") + encodeURIComponent(ssoName) - } - - $scope.importFile = function(fileContent){ - console.debug(fileContent); - ClientDescriptionConverter.save({ - realm: realm.realm - }, fileContent, function (data) { - $scope.client = data; - updateProperties(); - $scope.importing = true; - - $scope.clientEdit = angular.copy(client); - }); - }; - - $scope.viewImportDetails = function() { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/view-object.html', - controller: 'ObjectModalCtrl', - resolve: { - object: function () { - return $scope.client; - } - } - }) - }; - - $scope.switchChange = function() { - $scope.changed = true; - } - - $scope.changeAccessType = function() { - if ($scope.accessType == "confidential") { - $scope.clientEdit.bearerOnly = false; - $scope.clientEdit.publicClient = false; - } else if ($scope.accessType == "public") { - $scope.clientEdit.bearerOnly = false; - $scope.clientEdit.publicClient = true; - } else if ($scope.accessType == "bearer-only") { - $scope.clientEdit.bearerOnly = true; - $scope.clientEdit.publicClient = false; - $scope.clientEdit.alwaysDisplayInConsole = false; - } - }; - - $scope.changeProtocol = function() { - if ($scope.protocol == "openid-connect") { - $scope.clientEdit.protocol = "openid-connect"; - } else if ($scope.protocol == "saml") { - $scope.clientEdit.protocol = "saml"; - } - }; - - $scope.changeAlgorithm = function() { - $scope.clientEdit.attributes['saml.signature.algorithm'] = $scope.signatureAlgorithm; - }; - - $scope.changeNameIdFormat = function() { - $scope.clientEdit.attributes['saml_name_id_format'] = $scope.nameIdFormat; - }; - - $scope.changeSamlSigKeyNameTranformer = function() { - $scope.clientEdit.attributes['saml.server.signature.keyinfo.xmlSigKeyInfoKeyNameTransformer'] = $scope.samlXmlKeyNameTranformer; - }; - - $scope.changeAccessTokenSignedResponseAlg = function() { - $scope.clientEdit.attributes['access.token.signed.response.alg'] = $scope.accessTokenSignedResponseAlg; - }; - - $scope.changeIdTokenSignedResponseAlg = function() { - $scope.clientEdit.attributes['id.token.signed.response.alg'] = $scope.idTokenSignedResponseAlg; - }; - - $scope.changeIdTokenEncryptedResponseAlg = function() { - $scope.clientEdit.attributes['id.token.encrypted.response.alg'] = $scope.idTokenEncryptedResponseAlg; - }; - - $scope.changeIdTokenEncryptedResponseEnc = function() { - $scope.clientEdit.attributes['id.token.encrypted.response.enc'] = $scope.idTokenEncryptedResponseEnc; - }; - - $scope.changeUserInfoSignedResponseAlg = function() { - if ($scope.userInfoSignedResponseAlg === 'unsigned') { - $scope.clientEdit.attributes['user.info.response.signature.alg'] = null; - } else { - $scope.clientEdit.attributes['user.info.response.signature.alg'] = $scope.userInfoSignedResponseAlg; - } - }; - - $scope.changeRequestObjectSignatureAlg = function() { - if ($scope.requestObjectSignatureAlg === 'any') { - $scope.clientEdit.attributes['request.object.signature.alg'] = null; - } else { - $scope.clientEdit.attributes['request.object.signature.alg'] = $scope.requestObjectSignatureAlg; - } - }; - - $scope.changeRequestObjectRequired = function() { - if ($scope.requestObjectRequired === 'not required') { - $scope.clientEdit.attributes['request.object.required'] = null; - } else { - $scope.clientEdit.attributes['request.object.required'] = $scope.requestObjectRequired; - } - }; - - $scope.changeRequestObjectEncryptionAlg = function() { - if ($scope.requestObjectEncryptionAlg === 'any') { - $scope.clientEdit.attributes['request.object.encryption.alg'] = null; - } else { - $scope.clientEdit.attributes['request.object.encryption.alg'] = $scope.requestObjectEncryptionAlg; - } - }; - - $scope.changeRequestObjectEncryptionEnc = function() { - if ($scope.requestObjectEncryptionEnc === 'any') { - $scope.clientEdit.attributes['request.object.encryption.enc'] = null; - } else { - $scope.clientEdit.attributes['request.object.encryption.enc'] = $scope.requestObjectEncryptionEnc; - } - }; - - $scope.changeUserInfoEncryptedResponseAlg = function() { - $scope.clientEdit.attributes['user.info.encrypted.response.alg'] = $scope.userInfoEncryptedResponseAlg; - }; - - $scope.changeUserInfoEncryptedResponseEnc = function() { - $scope.clientEdit.attributes['user.info.encrypted.response.enc'] = $scope.userInfoEncryptedResponseEnc; - }; - - $scope.changePkceCodeChallengeMethod = function() { - $scope.clientEdit.attributes['pkce.code.challenge.method'] = $scope.pkceCodeChallengeMethod; - }; - - $scope.$watch('newAcr', function() { - $scope.changed = isChanged(); - }, true); - $scope.$watch('newLoa', function() { - $scope.changed = isChanged(); - }, true); - $scope.deleteAcrLoaMapping = function(acr) { - delete $scope.acrLoaMap[acr]; - $scope.changed = true; - } - $scope.addAcrLoaMapping = function() { - if ($scope.newLoa.match(/^[0-9]+$/)) { - $scope.acrLoaMap[$scope.newAcr] = $scope.newLoa; - $scope.newAcr = $scope.newLoa = ""; - $scope.changed = true; - } - } - - $scope.changeCibaBackchannelAuthRequestSigningAlg = function() { - if ($scope.cibaBackchannelAuthRequestSigningAlg === 'any') { - $scope.clientEdit.attributes['ciba.backchannel.auth.request.signing.alg'] = null; - } else { - $scope.clientEdit.attributes['ciba.backchannel.auth.request.signing.alg'] = $scope.cibaBackchannelAuthRequestSigningAlg; - } - }; - - $scope.changeCibaBackchannelTokenDeliveryMode = function() { - $scope.clientEdit.attributes['ciba.backchannel.token.delivery.mode'] = $scope.cibaBackchannelTokenDeliveryMode; - }; - - $scope.changeAuthorizationSignedResponseAlg = function() { - $scope.clientEdit.attributes['authorization.signed.response.alg'] = $scope.authorizationSignedResponseAlg; - }; - - $scope.changeAuthorizationEncryptedResponseAlg = function() { - $scope.clientEdit.attributes['authorization.encrypted.response.alg'] = $scope.authorizationEncryptedResponseAlg; - }; - - $scope.changeAuthorizationEncryptedResponseEnc = function() { - $scope.clientEdit.attributes['authorization.encrypted.response.enc'] = $scope.authorizationEncryptedResponseEnc; - }; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - function isChanged() { - if (!angular.equals($scope.client, $scope.clientEdit)) { - return true; - } - if ($scope.newRedirectUri && $scope.newRedirectUri.length > 0) { - return true; - } - if ($scope.newPostLogoutRedirectUri && $scope.newPostLogoutRedirectUri.length > 0) { - return true; - } - if ($scope.newWebOrigin && $scope.newWebOrigin.length > 0) { - return true; - } - if ($scope.newRequestUri && $scope.newRequestUri.length > 0) { - return true; - } - if ($scope.newDefaultAcrValue && $scope.newDefaultAcrValue.length > 0) { - return true; - } - if (deletedSomeDefaultAcrValue) return true; - if ($scope.newAcr && $scope.newAcr.length > 0 && $scope.newLoa && $scope.newLoa.length > 0) { - return true; - } - return false; - } - - $scope.updateTimeouts = function() { - if ($scope.accessTokenLifespan.time) { - if ($scope.accessTokenLifespan.time === -1) { - $scope.clientEdit.attributes['access.token.lifespan'] = -1; - } else { - $scope.clientEdit.attributes['access.token.lifespan'] = $scope.accessTokenLifespan.toSeconds(); - } - } else { - $scope.clientEdit.attributes['access.token.lifespan'] = null; - } - } - - $scope.updateAssertionLifespan = function() { - if ($scope.samlAssertionLifespan.time) { - $scope.clientEdit.attributes['saml.assertion.lifespan'] = $scope.samlAssertionLifespan.toSeconds(); - } else { - $scope.clientEdit.attributes['saml.assertion.lifespan'] = null; - } - } - - $scope.updateClientSessionIdleTimeout = function() { - if ($scope.clientSessionIdleTimeout.time) { - $scope.clientEdit.attributes['client.session.idle.timeout'] = $scope.clientSessionIdleTimeout.toSeconds(); - } else { - $scope.clientEdit.attributes['client.session.idle.timeout'] = null; - } - } - - $scope.updateClientSessionMaxLifespan = function() { - if ($scope.clientSessionMaxLifespan.time) { - $scope.clientEdit.attributes['client.session.max.lifespan'] = $scope.clientSessionMaxLifespan.toSeconds(); - } else { - $scope.clientEdit.attributes['client.session.max.lifespan'] = null; - } - } - - $scope.updateClientOfflineSessionIdleTimeout = function() { - if ($scope.clientOfflineSessionIdleTimeout.time) { - $scope.clientEdit.attributes['client.offline.session.idle.timeout'] = $scope.clientOfflineSessionIdleTimeout.toSeconds(); - } else { - $scope.clientEdit.attributes['client.offline.session.idle.timeout'] = null; - } - } - - $scope.updateClientOfflineSessionMaxLifespan = function() { - if ($scope.clientOfflineSessionMaxLifespan.time) { - $scope.clientEdit.attributes['client.offline.session.max.lifespan'] = $scope.clientOfflineSessionMaxLifespan.toSeconds(); - } else { - $scope.clientEdit.attributes['client.offline.session.max.lifespan'] = null; - } - } - - $scope.updateOauth2DeviceCodeLifespan = function() { - if ($scope.oauth2DeviceCodeLifespan.time) { - $scope.clientEdit.attributes['oauth2.device.code.lifespan'] = $scope.oauth2DeviceCodeLifespan.toSeconds(); - } else { - $scope.clientEdit.attributes['oauth2.device.code.lifespan'] = null; - } - } - - $scope.updateOauth2DevicePollingInterval = function() { - if ($scope.oauth2DevicePollingInterval) { - $scope.clientEdit.attributes['oauth2.device.polling.interval'] = $scope.oauth2DevicePollingInterval; - } else { - $scope.clientEdit.attributes['oauth2.device.polling.interval'] = null; - } - } - - $scope.confirmChangeAuthzSettings = function($event) { - if ($scope.client.authorizationServicesEnabled && $scope.clientEdit.authorizationServicesEnabled) { - $event.preventDefault(); - Dialog.confirm("Disable Authorization Settings", "Are you sure you want to disable authorization ? Once you save your changes, all authorization settings associated with this client will be removed. This operation can not be reverted.", function () { - $scope.clientEdit.authorizationServicesEnabled = false; - }, function () { - $scope.clientEdit.authorizationServicesEnabled = true; - }); - } - } - - function configureAuthorizationServices() { - if ($scope.clientEdit.authorizationServicesEnabled) { - if ($scope.accessType == 'public') { - $scope.accessType = 'confidential'; - } - $scope.clientEdit.publicClient = false; - $scope.clientEdit.serviceAccountsEnabled = true; - } else if ($scope.clientEdit.bearerOnly) { - $scope.clientEdit.serviceAccountsEnabled = false; - } - } - - $scope.$watch('clientEdit', function() { - $scope.changed = isChanged(); - configureAuthorizationServices(); - }, true); - - $scope.$watch('newRedirectUri', function() { - $scope.changed = isChanged(); - }, true); - - $scope.$watch('newPostLogoutRedirectUri', function() { - $scope.changed = isChanged(); - }, true); - - $scope.$watch('newWebOrigin', function() { - $scope.changed = isChanged(); - }, true); - - $scope.$watch('newRequestUri', function() { - $scope.changed = isChanged(); - }, true); - - $scope.$watch('newDefaultAcrValue', function() { - $scope.changed = isChanged(); - }, true); - - $scope.deleteWebOrigin = function(index) { - $scope.clientEdit.webOrigins.splice(index, 1); - } - $scope.addWebOrigin = function() { - $scope.clientEdit.webOrigins.push($scope.newWebOrigin); - $scope.newWebOrigin = ""; - } - $scope.deleteRequestUri = function(index) { - $scope.clientEdit.requestUris.splice(index, 1); - } - $scope.addRequestUri = function() { - $scope.clientEdit.requestUris.push($scope.newRequestUri); - $scope.newRequestUri = ""; - } - $scope.deleteDefaultAcrValue = function(index) { - $scope.defaultAcrValues.splice(index, 1); - deletedSomeDefaultAcrValue = true; - $scope.changed = isChanged(); - } - $scope.addDefaultAcrValue = function() { - $scope.defaultAcrValues.push($scope.newDefaultAcrValue); - $scope.newDefaultAcrValue = ""; - } - $scope.deleteRedirectUri = function(index) { - $scope.clientEdit.redirectUris.splice(index, 1); - } - - $scope.addRedirectUri = function() { - $scope.clientEdit.redirectUris.push($scope.newRedirectUri); - $scope.newRedirectUri = ""; - } - - $scope.deletePostLogoutRedirectUri = function(index) { - $scope.postLogoutRedirectUris.splice(index, 1); - } - - $scope.addPostLogoutRedirectUri = function() { - $scope.postLogoutRedirectUris.push($scope.newPostLogoutRedirectUri); - $scope.newPostLogoutRedirectUri = ""; - } - - $scope.save = function() { - if ($scope.newRedirectUri && $scope.newRedirectUri.length > 0) { - $scope.addRedirectUri(); - } - - if ($scope.newWebOrigin && $scope.newWebOrigin.length > 0) { - $scope.addWebOrigin(); - } - - if ($scope.newRequestUri && $scope.newRequestUri.length > 0) { - $scope.addRequestUri(); - } - if ($scope.clientEdit.requestUris && $scope.clientEdit.requestUris.length > 0) { - $scope.clientEdit.attributes["request.uris"] = $scope.clientEdit.requestUris.join("##"); - } else { - $scope.clientEdit.attributes["request.uris"] = null; - } - - if ($scope.postLogoutRedirectUris && $scope.postLogoutRedirectUris.length > 0) { - $scope.clientEdit.attributes["post.logout.redirect.uris"] = $scope.postLogoutRedirectUris.join("##"); - } else { - $scope.clientEdit.attributes["post.logout.redirect.uris"] = null; - } - - if (!$scope.clientEdit.frontchannelLogout) { - $scope.clientEdit.attributes["frontchannel.logout.url"] = null; - } - delete $scope.clientEdit.requestUris; - - if ($scope.newDefaultAcrValue && $scope.newDefaultAcrValue.length > 0) { - $scope.addDefaultAcrValue(); - } - if ($scope.defaultAcrValues && $scope.defaultAcrValues.length > 0) { - $scope.clientEdit.attributes["default.acr.values"] = $scope.defaultAcrValues.join("##"); - } else { - $scope.clientEdit.attributes["default.acr.values"] = null; - } - - if ($scope.samlArtifactBinding == true) { - $scope.clientEdit.attributes["saml.artifact.binding"] = "true"; - } else { - $scope.clientEdit.attributes["saml.artifact.binding"] = "false"; - } - - if ($scope.newAcr && $scope.newAcr.length > 0 && $scope.newLoa && $scope.newLoa.length > 0) { - $scope.addAcrLoaMapping(); - } - - if ($scope.samlServerSignature == true) { - $scope.clientEdit.attributes["saml.server.signature"] = "true"; - } else { - $scope.clientEdit.attributes["saml.server.signature"] = "false"; - } - if ($scope.samlServerSignatureEnableKeyInfoExtension == true) { - $scope.clientEdit.attributes["saml.server.signature.keyinfo.ext"] = "true"; - } else { - $scope.clientEdit.attributes["saml.server.signature.keyinfo.ext"] = "false"; - } - if ($scope.samlAssertionSignature == true) { - $scope.clientEdit.attributes["saml.assertion.signature"] = "true"; - } else { - $scope.clientEdit.attributes["saml.assertion.signature"] = "false"; - } - if ($scope.samlClientSignature == true) { - $scope.clientEdit.attributes["saml.client.signature"] = "true"; - } else { - $scope.clientEdit.attributes["saml.client.signature"] = "false"; - - } - if ($scope.samlEncrypt == true) { - $scope.clientEdit.attributes["saml.encrypt"] = "true"; - } else { - $scope.clientEdit.attributes["saml.encrypt"] = "false"; - - } - if ($scope.samlAuthnStatement == true) { - $scope.clientEdit.attributes["saml.authnstatement"] = "true"; - } else { - $scope.clientEdit.attributes["saml.authnstatement"] = "false"; - - } - if ($scope.samlOneTimeUseCondition == true) { - $scope.clientEdit.attributes["saml.onetimeuse.condition"] = "true"; - } else { - $scope.clientEdit.attributes["saml.onetimeuse.condition"] = "false"; - - } - if ($scope.samlForceNameIdFormat == true) { - $scope.clientEdit.attributes["saml_force_name_id_format"] = "true"; - } else { - $scope.clientEdit.attributes["saml_force_name_id_format"] = "false"; - - } - if ($scope.samlAllowECPFlow == true) { - $scope.clientEdit.attributes["saml.allow.ecp.flow"] = "true"; - } else { - $scope.clientEdit.attributes["saml.allow.ecp.flow"] = "false"; - - } - if ($scope.samlMultiValuedRoles == true) { - $scope.clientEdit.attributes["saml.multivalued.roles"] = "true"; - } else { - $scope.clientEdit.attributes["saml.multivalued.roles"] = "false"; - - } - if ($scope.samlForcePostBinding == true) { - $scope.clientEdit.attributes["saml.force.post.binding"] = "true"; - } else { - $scope.clientEdit.attributes["saml.force.post.binding"] = "false"; - - } - - if ($scope.excludeSessionStateFromAuthResponse == true) { - $scope.clientEdit.attributes["exclude.session.state.from.auth.response"] = "true"; - } else { - $scope.clientEdit.attributes["exclude.session.state.from.auth.response"] = "false"; - - } - - if ($scope.oauth2DeviceAuthorizationGrantEnabled == true) { - $scope.clientEdit.attributes["oauth2.device.authorization.grant.enabled"] = "true"; - } else { - $scope.clientEdit.attributes["oauth2.device.authorization.grant.enabled"] = "false"; - } - - if ($scope.oidcCibaGrantEnabled == true) { - $scope.clientEdit.attributes["oidc.ciba.grant.enabled"] = "true"; - } else { - $scope.clientEdit.attributes["oidc.ciba.grant.enabled"] = "false"; - } - - if ($scope.useRefreshTokens == true) { - $scope.clientEdit.attributes["use.refresh.tokens"] = "true"; - } else { - $scope.clientEdit.attributes["use.refresh.tokens"] = "false"; - } - - if ($scope.useIdTokenAsDetachedSignature == true) { - $scope.clientEdit.attributes["id.token.as.detached.signature"] = "true"; - } else { - $scope.clientEdit.attributes["id.token.as.detached.signature"] = "false"; - } - - // KEYCLOAK-6771 Certificate Bound Token - // https://tools.ietf.org/html/draft-ietf-oauth-mtls-08#section-3 - if ($scope.tlsClientCertificateBoundAccessTokens == true) { - $scope.clientEdit.attributes["tls.client.certificate.bound.access.tokens"] = "true"; - } else { - $scope.clientEdit.attributes["tls.client.certificate.bound.access.tokens"] = "false"; - } - - // PAR request. - if ($scope.requirePushedAuthorizationRequests == true) { - $scope.clientEdit.attributes["require.pushed.authorization.requests"] = "true"; - } else { - $scope.clientEdit.attributes["require.pushed.authorization.requests"] = "false"; - } - - // KEYCLOAK-9551 Client Credentials Grant generates refresh token - // https://tools.ietf.org/html/rfc6749#section-4.4.3 - if ($scope.useRefreshTokenForClientCredentialsGrant === true) { - $scope.clientEdit.attributes["client_credentials.use_refresh_token"] = "true"; - } else { - $scope.clientEdit.attributes["client_credentials.use_refresh_token"] = "false"; - } - - if ($scope.useLowerCaseBearerTypeInTokenResponse === true) { - $scope.clientEdit.attributes["token.response.type.bearer.lower-case"] = "true"; - } else { - $scope.clientEdit.attributes["token.response.type.bearer.lower-case"] = "false"; - } - - if ($scope.displayOnConsentScreen == true) { - $scope.clientEdit.attributes["display.on.consent.screen"] = "true"; - } else { - $scope.clientEdit.attributes["display.on.consent.screen"] = "false"; - } - - if ($scope.backchannelLogoutSessionRequired == true) { - $scope.clientEdit.attributes["backchannel.logout.session.required"] = "true"; - } else { - $scope.clientEdit.attributes["backchannel.logout.session.required"] = "false"; - } - - if ($scope.backchannelLogoutRevokeOfflineSessions == true) { - $scope.clientEdit.attributes["backchannel.logout.revoke.offline.tokens"] = "true"; - } else { - $scope.clientEdit.attributes["backchannel.logout.revoke.offline.tokens"] = "false"; - } - - if ($scope.frontchannelLogoutSessionRequired == true) { - $scope.clientEdit.attributes["frontchannel.logout.session.required"] = "true"; - } else { - $scope.clientEdit.attributes["frontchannel.logout.session.required"] = "false"; - } - - $scope.clientEdit.attributes["acr.loa.map"] = JSON.stringify($scope.acrLoaMap); - - $scope.clientEdit.protocol = $scope.protocol; - $scope.clientEdit.attributes['saml.signature.algorithm'] = $scope.signatureAlgorithm; - $scope.clientEdit.attributes['saml_name_id_format'] = $scope.nameIdFormat; - - if ($scope.clientEdit.protocol != 'saml' && !$scope.clientEdit.bearerOnly && ($scope.clientEdit.standardFlowEnabled || $scope.clientEdit.implicitFlowEnabled) && (!$scope.clientEdit.redirectUris || $scope.clientEdit.redirectUris.length == 0)) { - Notifications.error("You must specify at least one redirect uri"); - } else { - Client.update({ - realm : realm.realm, - client : client.id - }, $scope.clientEdit, function() { - $route.reload(); - Notifications.success("Your changes have been saved to the client."); - }); - } - }; - - $scope.reset = function() { - $route.reload(); - }; - - $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/clients"); - }; -}); - -module.controller('CreateClientCtrl', function($scope, realm, client, $route, serverInfo, Client, ClientDescriptionConverter, $location, $modal, Dialog, Notifications) { - $scope.protocols = serverInfo.listProviderIds('login-protocol'); - $scope.create = true; - - $scope.realm = realm; - - $scope.client = { - enabled: true, - attributes: {} - }; - $scope.client.redirectUris = []; - $scope.protocol = $scope.protocols[0]; - - - $scope.importFile = function(fileContent){ - console.debug(fileContent); - ClientDescriptionConverter.save({ - realm: realm.realm - }, fileContent, function (data) { - $scope.client = data; - if (data.protocol) { - $scope.protocol = data.protocol; - } - $scope.importing = true; - }); - }; - - $scope.viewImportDetails = function() { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/view-object.html', - controller: 'ObjectModalCtrl', - resolve: { - object: function () { - return $scope.client; - } - } - }) - }; - - $scope.switchChange = function() { - $scope.changed = true; - } - - $scope.changeProtocol = function() { - if ($scope.protocol == "openid-connect") { - $scope.client.protocol = "openid-connect"; - } else if ($scope.protocol == "saml") { - $scope.client.protocol = "saml"; - } - }; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - function isChanged() { - if (!angular.equals($scope.client, client)) { - return true; - } - return false; - } - - $scope.$watch('client', function() { - $scope.changed = isChanged(); - }, true); - - - $scope.save = function() { - $scope.client.protocol = $scope.protocol; - - Client.save({ - realm: realm.realm, - client: '' - }, $scope.client, function (data, headers) { - $scope.changed = false; - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - $location.url("/realms/" + realm.realm + "/clients/" + id); - Notifications.success("The client has been created."); - }); - }; - - $scope.reset = function() { - $route.reload(); - }; - - $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/clients"); - }; -}); - -module.controller('ClientScopeMappingCtrl', function($scope, $http, realm, $route, client, clients, Notifications, - Client, ClientScope, - ClientRealmScopeMapping, ClientClientScopeMapping, ClientRole, - ClientAvailableRealmScopeMapping, ClientAvailableClientScopeMapping, - ClientCompositeRealmScopeMapping, ClientCompositeClientScopeMapping) { - $scope.realm = realm; - $scope.client = angular.copy(client); - $scope.selectedRealmRoles = []; - $scope.selectedRealmMappings = []; - $scope.realmMappings = []; - $scope.clients = clients; - $scope.clientRoles = []; - $scope.clientComposite = []; - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - $scope.clientMappings = []; - $scope.dummymodel = []; - - $scope.hideRoleSelector = function() { - return $scope.client.fullScopeAllowed; - } - - $scope.changeFlag = function(event) { - console.log('changeFlag'); - event.stopPropagation(); - event.preventDefault(); - $scope.client.fullScopeAllowed = !$scope.client.fullScopeAllowed - Client.update({ - realm : realm.realm, - client : client.id - }, $scope.client, function() { - $scope.changed = false; - client = angular.copy($scope.client); - updateRealmRoles(); - Notifications.success("Scope mappings updated."); - }); - } - - - $scope.selectedClient = null; - - $scope.selectClient = function(client) { - if (!client || !client.id) { - $scope.selectedClient = null; - return; - } - - $scope.selectedClient = client; - updateClientRoles(); - } - - function updateRealmRoles() { - $scope.realmRoles = ClientAvailableRealmScopeMapping.query({realm : realm.realm, client : client.id}); - $scope.realmMappings = ClientRealmScopeMapping.query({realm : realm.realm, client : client.id}); - $scope.realmComposite = ClientCompositeRealmScopeMapping.query({realm : realm.realm, client : client.id}); - } - - function updateClientRoles() { - if ($scope.selectedClient) { - $scope.clientRoles = ClientAvailableClientScopeMapping.query({realm : realm.realm, client : client.id, targetClient : $scope.selectedClient.id}); - $scope.clientMappings = ClientClientScopeMapping.query({realm : realm.realm, client : client.id, targetClient : $scope.selectedClient.id}); - $scope.clientComposite = ClientCompositeClientScopeMapping.query({realm : realm.realm, client : client.id, targetClient : $scope.selectedClient.id}); - } else { - $scope.clientRoles = null; - $scope.clientMappings = null; - $scope.clientComposite = null; - } - } - - $scope.addRealmRole = function() { - $scope.selectedRealmRolesToAdd = JSON.parse('[' + $scope.selectedRealmRoles + ']'); - $scope.selectedRealmRoles = []; - $http.post(authUrl + '/admin/realms/' + realm.realm + '/clients/' + client.id + '/scope-mappings/realm', - $scope.selectedRealmRolesToAdd).then(function() { - updateRealmRoles(); - $scope.selectedRealmRolesToAdd = []; - Notifications.success("Scope mappings updated."); - }); - }; - - $scope.deleteRealmRole = function() { - $scope.selectedRealmMappingsToRemove = JSON.parse('[' + $scope.selectedRealmMappings + ']'); - $scope.selectedRealmMappings = []; - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/clients/' + client.id + '/scope-mappings/realm', - {data : $scope.selectedRealmMappingsToRemove, headers : {"content-type" : "application/json"}}).then(function () { - updateRealmRoles(); - $scope.selectedRealmMappingsToRemove = []; - Notifications.success("Scope mappings updated."); - }); - }; - - $scope.addClientRole = function() { - $scope.selectedClientRolesToAdd = JSON.parse('[' + $scope.selectedClientRoles + ']'); - $scope.selectedClientRoles = []; - $http.post(authUrl + '/admin/realms/' + realm.realm + '/clients/' + client.id + '/scope-mappings/clients/' + $scope.selectedClient.id, - $scope.selectedClientRolesToAdd).then(function () { - updateClientRoles(); - $scope.selectedClientRolesToAdd = []; - Notifications.success("Scope mappings updated."); - }); - }; - - $scope.deleteClientRole = function() { - $scope.selectedClientMappingsToRemove = JSON.parse('[' + $scope.selectedClientMappings + ']'); - $scope.selectedClientMappings = []; - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/clients/' + client.id + '/scope-mappings/clients/' + $scope.selectedClient.id, - {data : $scope.selectedClientMappingsToRemove, headers : {"content-type" : "application/json"}}).then(function () { - updateClientRoles(); - $scope.selectedClientMappingsToRemove = []; - Notifications.success("Scope mappings updated."); - }); - }; - - clientSelectControl($scope, $route.current.params.realm, Client); - updateRealmRoles(); -}); - -module.controller('ClientRevocationCtrl', function($scope, realm, client, Client, ClientPushRevocation, $location, Dialog, Notifications) { - $scope.realm = realm; - $scope.client = client; - - var setNotBefore = function() { - if ($scope.client.notBefore == 0) { - $scope.notBefore = "None"; - } else { - $scope.notBefore = new Date($scope.client.notBefore * 1000); - } - }; - - setNotBefore(); - - var refresh = function() { - Client.get({ realm : realm.realm, client: $scope.client.id }, function(updated) { - $scope.client = updated; - setNotBefore(); - }) - - }; - - $scope.clear = function() { - $scope.client.notBefore = 0; - Client.update({ realm : realm.realm, client: client.id}, $scope.client, function () { - $scope.notBefore = "None"; - Notifications.success('Not Before cleared for client.'); - refresh(); - }); - } - $scope.setNotBeforeNow = function() { - $scope.client.notBefore = new Date().getTime()/1000; - Client.update({ realm : realm.realm, client: $scope.client.id}, $scope.client, function () { - Notifications.success('Not Before set for client.'); - refresh(); - }); - } - $scope.pushRevocation = function() { - ClientPushRevocation.save({realm : realm.realm, client: $scope.client.id}, function (globalReqResult) { - var successCount = globalReqResult.successRequests ? globalReqResult.successRequests.length : 0; - var failedCount = globalReqResult.failedRequests ? globalReqResult.failedRequests.length : 0; - - if (successCount==0 && failedCount==0) { - Notifications.warn('No push sent. No admin URI configured or no registered cluster nodes available'); - } else if (failedCount > 0) { - var msgStart = successCount>0 ? 'Successfully push notBefore to: ' + globalReqResult.successRequests + ' . ' : ''; - Notifications.error(msgStart + 'Failed to push notBefore to: ' + globalReqResult.failedRequests + '. Verify availability of failed hosts and try again'); - } else { - Notifications.success('Successfully push notBefore to: ' + globalReqResult.successRequests); - } - }); - } - -}); - -module.controller('ClientClusteringCtrl', function($scope, client, Client, ClientTestNodesAvailable, ClientClusterNode, realm, $location, $route, Dialog, Notifications, TimeUnit) { - $scope.client = client; - $scope.realm = realm; - - var oldCopy = angular.copy($scope.client); - $scope.changed = false; - - $scope.$watch('client', function() { - if (!angular.equals($scope.client, oldCopy)) { - $scope.changed = true; - } - }, true); - - $scope.client.nodeReRegistrationTimeoutUnit = TimeUnit.autoUnit(client.nodeReRegistrationTimeout); - $scope.client.nodeReRegistrationTimeout = TimeUnit.toUnit(client.nodeReRegistrationTimeout, $scope.client.nodeReRegistrationTimeoutUnit); - - $scope.save = function() { - var clientCopy = angular.copy($scope.client); - delete clientCopy['nodeReRegistrationTimeoutUnit']; - clientCopy.nodeReRegistrationTimeout = TimeUnit.toSeconds($scope.client.nodeReRegistrationTimeout, $scope.client.nodeReRegistrationTimeoutUnit) - Client.update({ realm : realm.realm, client : client.id }, clientCopy, function () { - $route.reload(); - Notifications.success('Your changes have been saved to the client.'); - }); - }; - - $scope.reset = function() { - $route.reload(); - }; - - $scope.testNodesAvailable = function() { - ClientTestNodesAvailable.get({ realm : realm.realm, client : client.id }, function(globalReqResult) { - $route.reload(); - - var successCount = globalReqResult.successRequests ? globalReqResult.successRequests.length : 0; - var failedCount = globalReqResult.failedRequests ? globalReqResult.failedRequests.length : 0; - - if (successCount==0 && failedCount==0) { - Notifications.warn('No requests sent. No admin URI configured or no registered cluster nodes available'); - } else if (failedCount > 0) { - var msgStart = successCount>0 ? 'Successfully verify availability for ' + globalReqResult.successRequests + ' . ' : ''; - Notifications.error(msgStart + 'Failed to verify availability for: ' + globalReqResult.failedRequests + '. Fix or unregister failed cluster nodes and try again'); - } else { - Notifications.success('Successfully sent requests to: ' + globalReqResult.successRequests); - } - }); - }; - - if (client.registeredNodes) { - var nodeRegistrations = []; - for (node in client.registeredNodes) { - reg = { - host: node, - lastRegistration: new Date(client.registeredNodes[node] * 1000) - } - nodeRegistrations.push(reg); - } - - $scope.nodeRegistrations = nodeRegistrations; - }; - - $scope.removeNode = function(node) { - Dialog.confirmDelete(node.host, 'node', function() { - ClientClusterNode.remove({ realm : realm.realm, client : client.id , node: node.host }, function() { - Notifications.success('Node ' + node.host + ' unregistered successfully.'); - $route.reload(); - }); - }); - }; -}); - -module.controller('ClientClusteringNodeCtrl', function($scope, client, Client, ClientClusterNode, realm, - $location, $routeParams, Notifications, Dialog) { - $scope.client = client; - $scope.realm = realm; - $scope.create = !$routeParams.node; - - $scope.save = function() { - ClientClusterNode.save({ realm : realm.realm, client : client.id , node: $scope.node.host }, function() { - Notifications.success('Node ' + $scope.node.host + ' registered successfully.'); - $location.url('/realms/' + realm.realm + '/clients/' + client.id + '/clustering'); - }); - } - - $scope.unregisterNode = function() { - Dialog.confirmDelete($scope.node.host, 'node', function() { - ClientClusterNode.remove({ realm : realm.realm, client : client.id , node: $scope.node.host }, function() { - Notifications.success('Node ' + $scope.node.host + ' unregistered successfully.'); - $location.url('/realms/' + realm.realm + '/clients/' + client.id + '/clustering'); - }); - }); - } - - if ($scope.create) { - $scope.node = {} - $scope.registered = false; - } else { - var lastRegTime = client.registeredNodes[$routeParams.node]; - - if (lastRegTime) { - $scope.registered = true; - $scope.node = { - host: $routeParams.node, - lastRegistration: new Date(lastRegTime * 1000) - } - - } else { - $scope.registered = false; - $scope.node = { - host: $routeParams.node - } - } - } -}); - -module.controller('AddBuiltinProtocolMapperCtrl', function($scope, realm, client, serverInfo, - ClientProtocolMappersByProtocol, - $http, $location, Dialog, Notifications) { - $scope.realm = realm; - $scope.client = client; - if (client.protocol == null) { - client.protocol = 'openid-connect'; - } - - var protocolMappers = serverInfo.protocolMapperTypes[client.protocol]; - var mapperTypes = {}; - for (var i = 0; i < protocolMappers.length; i++) { - mapperTypes[protocolMappers[i].id] = protocolMappers[i]; - } - $scope.mapperTypes = mapperTypes; - - - - - var updateMappers = function() { - var clientMappers = ClientProtocolMappersByProtocol.query({realm : realm.realm, client : client.id, protocol : client.protocol}, function() { - var builtinMappers = serverInfo.builtinProtocolMappers[client.protocol]; - for (var i = 0; i < clientMappers.length; i++) { - for (var j = 0; j < builtinMappers.length; j++) { - if (builtinMappers[j].name == clientMappers[i].name - && builtinMappers[j].protocolMapper == clientMappers[i].protocolMapper) { - builtinMappers.splice(j, 1); - break; - } - } - } - $scope.mappers = builtinMappers; - for (var i = 0; i < $scope.mappers.length; i++) { - $scope.mappers[i].isChecked = false; - } - - - }); - }; - - updateMappers(); - - $scope.add = function() { - var toAdd = []; - for (var i = 0; i < $scope.mappers.length; i++) { - if ($scope.mappers[i].isChecked) { - delete $scope.mappers[i].isChecked; - toAdd.push($scope.mappers[i]); - } - } - $http.post(authUrl + '/admin/realms/' + realm.realm + '/clients/' + client.id + '/protocol-mappers/add-models', - toAdd).then(function() { - Notifications.success("Mappers added"); - $location.url('/realms/' + realm.realm + '/clients/' + client.id + '/mappers'); - }).catch(function() { - Notifications.error("Error adding mappers"); - $location.url('/realms/' + realm.realm + '/clients/' + client.id + '/mappers'); - }); - }; - -}); - -module.controller('ClientProtocolMapperListCtrl', function($scope, realm, client, serverInfo, - Client, - ClientProtocolMappersByProtocol, ClientProtocolMapper, - $route, Dialog, Notifications) { - $scope.realm = realm; - $scope.client = client; - if (client.protocol == null) { - client.protocol = 'openid-connect'; - } - - $scope.changeFlag = function() { - Client.update({ - realm : realm.realm, - client : client.id - }, $scope.client, function() { - $scope.changed = false; - client = angular.copy($scope.client); - Notifications.success("Client updated."); - }); - } - - var protocolMappers = serverInfo.protocolMapperTypes[client.protocol]; - var mapperTypes = {}; - for (var i = 0; i < protocolMappers.length; i++) { - mapperTypes[protocolMappers[i].id] = protocolMappers[i]; - } - $scope.mapperTypes = mapperTypes; - - $scope.removeMapper = function(mapper) { - console.debug(mapper); - Dialog.confirmDelete(mapper.name, 'mapper', function() { - ClientProtocolMapper.remove({ realm: realm.realm, client: client.id, id : mapper.id }, function() { - Notifications.success("The mapper has been deleted."); - $route.reload(); - }); - }); - }; - - $scope.sortMappersByPriority = function(mapper) { - return $scope.mapperTypes[mapper.protocolMapper].priority; - } - - var updateMappers = function() { - $scope.mappers = ClientProtocolMappersByProtocol.query({realm : realm.realm, client : client.id, protocol : client.protocol}); - }; - - updateMappers(); -}); - -module.controller('ClientProtocolMapperCtrl', function($scope, realm, serverInfo, client, clients, mapper, ClientProtocolMapper, Notifications, Dialog, $location) { - $scope.realm = realm; - $scope.clients = clients; - - /* - $scope.client = client; - $scope.create = false; - $scope.protocol = client.protocol; - $scope.mapper = angular.copy(mapper); - $scope.changed = false; - */ - - if (client.protocol == null) { - client.protocol = 'openid-connect'; - } - - $scope.model = { - realm: realm, - client: client, - create: false, - protocol: client.protocol, - mapper: angular.copy(mapper), - changed: false - }; - - var protocolMappers = serverInfo.protocolMapperTypes[client.protocol]; - for (var i = 0; i < protocolMappers.length; i++) { - if (protocolMappers[i].id === mapper.protocolMapper) { - $scope.model.mapperType = protocolMappers[i]; - } - } - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.$watch('model.mapper', function() { - if (!angular.equals($scope.model.mapper, mapper)) { - $scope.model.changed = true; - } - }, true); - - $scope.save = function() { - ClientProtocolMapper.update({ - realm : realm.realm, - client: client.id, - id : $scope.model.mapper.id - }, $scope.model.mapper, function() { - $scope.model.changed = false; - mapper = angular.copy($scope.mapper); - $location.url("/realms/" + realm.realm + '/clients/' + client.id + "/mappers/" + $scope.model.mapper.id); - Notifications.success("Your changes have been saved."); - }); - }; - - $scope.reset = function() { - $scope.model.mapper = angular.copy(mapper); - $scope.model.changed = false; - }; - - $scope.cancel = function() { - //$location.url("/realms"); - window.history.back(); - }; - - $scope.remove = function() { - Dialog.confirmDelete($scope.model.mapper.name, 'mapper', function() { - ClientProtocolMapper.remove({ realm: realm.realm, client: client.id, id : $scope.model.mapper.id }, function() { - Notifications.success("The mapper has been deleted."); - $location.url("/realms/" + realm.realm + '/clients/' + client.id + "/mappers"); - }); - }); - }; - -}); - -module.controller('ClientProtocolMapperCreateCtrl', function($scope, realm, serverInfo, client, clients, ClientProtocolMapper, Notifications, Dialog, $location) { - $scope.realm = realm; - $scope.clients = clients; - - if (client.protocol == null) { - client.protocol = 'openid-connect'; - } - var protocol = client.protocol; - /* - $scope.client = client; - $scope.create = true; - $scope.protocol = protocol; - $scope.mapper = { protocol : client.protocol, config: {}}; - $scope.mapperTypes = serverInfo.protocolMapperTypes[protocol]; - */ - $scope.model = { - realm: realm, - client: client, - create: true, - protocol: client.protocol, - mapper: { protocol : client.protocol, config: {}}, - changed: false, - mapperTypes: serverInfo.protocolMapperTypes[protocol] - }; - console.log("mapper types: ", $scope.model.mapperTypes); - - // apply default configurations on change for selected protocolmapper type. - $scope.$watch('model.mapperType', function() { - var currentMapperType = $scope.model.mapperType; - var defaultConfig = {}; - - if (currentMapperType && Array.isArray(currentMapperType.properties)) { - for (var i = 0; i < currentMapperType.properties.length; i++) { - var property = currentMapperType.properties[i]; - if (property && property.name && property.defaultValue) { - defaultConfig[property.name] = property.defaultValue; - } - } - } - - $scope.model.mapper.config = defaultConfig; - }, true); - - $scope.model.mapperType = $scope.model.mapperTypes[0]; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.save = function() { - $scope.model.mapper.protocolMapper = $scope.model.mapperType.id; - ClientProtocolMapper.save({ - realm : realm.realm, client: client.id - }, $scope.model.mapper, function(data, headers) { - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - $location.url("/realms/" + realm.realm + '/clients/' + client.id + "/mappers/" + id); - Notifications.success("Mapper has been created."); - }); - }; - - $scope.cancel = function() { - //$location.url("/realms"); - window.history.back(); - }; - - -}); - - -module.controller('ClientClientScopesSetupCtrl', function($scope, realm, Realm, client, clientScopes, serverInfo, - clientDefaultClientScopes, ClientDefaultClientScopes, clientOptionalClientScopes, ClientOptionalClientScopes, $route, Notifications, $location) { - console.log('ClientClientScopesSetupCtrl'); - - $scope.realm = realm; - $scope.client = client; - - $scope.clientDefaultClientScopes = clientDefaultClientScopes; - $scope.clientOptionalClientScopes = clientOptionalClientScopes; - - $scope.availableClientScopes = []; - $scope.selectedDefaultClientScopes = []; - $scope.selectedDefDefaultClientScopes = []; - - $scope.selectedOptionalClientScopes = []; - $scope.selectedDefOptionalClientScopes = []; - - // Populate available client scopes. Available client scopes are neither already assigned to 'default' or 'optional' - for (var i = 0; i < clientScopes.length; i++) { - var clientScope = clientScopes[i]; - var scopeName = clientScopes[i].name; - - var available = true; - if (clientScope.protocol != client.protocol) { - available = false; - } - - for (var j = 0; j < $scope.clientDefaultClientScopes.length; j++) { - if (scopeName === $scope.clientDefaultClientScopes[j].name) { - available = false; - } - } - for (var j = 0; j < $scope.clientOptionalClientScopes.length; j++) { - if (scopeName === $scope.clientOptionalClientScopes[j].name) { - available = false; - } - } - - if (available) { - $scope.availableClientScopes.push(clientScope); - } - } - - $scope.addDefaultClientScope = function () { - $scope.selectedDefaultClientScopesToAdd = JSON.parse('[' + $scope.selectedDefaultClientScopes + ']'); - toAdd = $scope.selectedDefaultClientScopesToAdd.length; - - for (var i = 0; i < $scope.selectedDefaultClientScopesToAdd.length; i++) { - var currentScope = $scope.selectedDefaultClientScopesToAdd[i]; - - ClientDefaultClientScopes.update({ - realm : realm.realm, - client : client.id, - clientScopeId : currentScope.id - }, function () { - toAdd = toAdd - 1; - if (toAdd === 0) { - $route.reload(); - Notifications.success("Default scopes updated."); - } - }); - } - $scope.selectedDefaultClientScopesToAdd = []; - }; - - $scope.deleteDefaultClientScope = function () { - $scope.selectedDefDefaultClientScopesToRemove = JSON.parse('[' + $scope.selectedDefDefaultClientScopes + ']'); - toRemove = $scope.selectedDefDefaultClientScopesToRemove.length; - - for (var i = 0; i < $scope.selectedDefDefaultClientScopesToRemove.length; i++) { - var currentScope = $scope.selectedDefDefaultClientScopesToRemove[i]; - - ClientDefaultClientScopes.remove({ - realm : realm.realm, - client : client.id, - clientScopeId : currentScope.id - }, function () { - toRemove = toRemove - 1; - if (toRemove === 0) { - $route.reload(); - Notifications.success("Default scopes updated."); - } - }); - } - $scope.selectedDefDefaultClientScopesToRemove = []; - }; - - $scope.addOptionalClientScope = function () { - $scope.selectedOptionalClientScopesToAdd = JSON.parse('[' + $scope.selectedOptionalClientScopes + ']'); - toAdd = $scope.selectedOptionalClientScopesToAdd.length; - - for (var i = 0; i < $scope.selectedOptionalClientScopesToAdd.length; i++) { - var currentScope = $scope.selectedOptionalClientScopesToAdd[i]; - - ClientOptionalClientScopes.update({ - realm : realm.realm, - client : client.id, - clientScopeId : currentScope.id - }, function () { - toAdd = toAdd - 1; - if (toAdd === 0) { - $route.reload(); - Notifications.success("Optional scopes updated."); - } - }); - } - }; - - $scope.deleteOptionalClientScope = function () { - $scope.selectedDefOptionalClientScopesToRemove = JSON.parse('[' + $scope.selectedDefOptionalClientScopes + ']'); - toRemove = $scope.selectedDefOptionalClientScopesToRemove.length; - - for (var i = 0; i < $scope.selectedDefOptionalClientScopesToRemove.length; i++) { - var currentScope = $scope.selectedDefOptionalClientScopesToRemove[i]; - - ClientOptionalClientScopes.remove({ - realm : realm.realm, - client : client.id, - clientScopeId : currentScope.id - }, function () { - toRemove = toRemove - 1; - if (toRemove === 0) { - $route.reload(); - Notifications.success("Optional scopes updated."); - } - }); - } - $scope.selectedDefOptionalClientScopesToRemove = []; - }; - -}); - -module.controller('ClientClientScopesEvaluateCtrl', function($scope, Realm, User, ClientEvaluateProtocolMappers, ClientEvaluateGrantedRoles, - ClientEvaluateNotGrantedRoles, ClientEvaluateGenerateExampleAccessToken, ClientEvaluateGenerateExampleIDToken, - ClientEvaluateGenerateExampleUserInfo, realm, client, clients, clientScopes, serverInfo, ComponentUtils, - clientOptionalClientScopes, clientDefaultClientScopes, $route, $routeParams, $http, Notifications, $location, - Client) { - - console.log('ClientClientScopesEvaluateCtrl'); - - var protocolMappers = serverInfo.protocolMapperTypes[client.protocol]; - var mapperTypes = {}; - for (var i = 0; i < protocolMappers.length; i++) { - mapperTypes[protocolMappers[i].id] = protocolMappers[i]; - } - $scope.mapperTypes = mapperTypes; - - $scope.realm = realm; - $scope.client = client; - $scope.clients = clients; - $scope.userId = null; - - $scope.availableClientScopes = []; - $scope.assignedClientScopes = []; - $scope.selectedClientScopes = []; - $scope.selectedDefClientScopes = []; - $scope.effectiveClientScopes = []; - - // Populate available client scopes. Available client scopes are neither already assigned to 'default' or 'optional' - for (var i = 0; i < clientOptionalClientScopes.length; i++) { - $scope.availableClientScopes.push(clientOptionalClientScopes[i]); - } - - function clearEvalResponse() { - $scope.protocolMappers = null; - $scope.grantedRealmRoles = null; - $scope.notGrantedRealmRoles = null; - $scope.grantedClientRoles = null; - $scope.notGrantedClientRoles = null; - $scope.targetClient = null; - $scope.oidcAccessToken = null; - $scope.oidcIDToken = null; - $scope.oidcUserInfo = null; - - $scope.selectedTab = 0; - } - - function updateState() { - // Compute scope parameter - $scope.scopeParam = 'openid'; - for (var i = 0; i < $scope.assignedClientScopes.length; i++) { - var currentScopeParam = $scope.assignedClientScopes[i].name; - $scope.scopeParam = $scope.scopeParam + ' ' + currentScopeParam; - } - - // Compute effective scopes - $scope.effectiveClientScopes = []; - - for (var i = 0; i < clientDefaultClientScopes.length; i++) { - var currentScope = clientDefaultClientScopes[i]; - $scope.effectiveClientScopes.push(currentScope); - } - for (var i = 0; i < $scope.assignedClientScopes.length; i++) { - var currentScope = $scope.assignedClientScopes[i]; - $scope.effectiveClientScopes.push(currentScope); - } - - // Clear the evaluation response - clearEvalResponse(); - } - - updateState(); - - - $scope.addAppliedClientScope = function () { - $scope.selectedClientScopesToAdd = JSON.parse('[' + $scope.selectedClientScopes + ']'); - for (var i = 0; i < $scope.selectedClientScopesToAdd.length; i++) { - var currentScope = $scope.selectedClientScopesToAdd[i]; - - $scope.assignedClientScopes.push(currentScope); - - var index = ComponentUtils.findIndexById($scope.availableClientScopes, currentScope.id); - if (index > -1) { - $scope.availableClientScopes.splice(index, 1); - } - } - - $scope.selectedClientScopes = []; - $scope.selectedClientScopesToAdd = []; - updateState(); - }; - - $scope.deleteAppliedClientScope = function () { - $scope.selectedDefClientScopesToRemove = JSON.parse('[' + $scope.selectedDefClientScopes + ']'); - for (var i = 0; i < $scope.selectedDefClientScopesToRemove.length; i++) { - var currentScope = $scope.selectedDefClientScopesToRemove[i]; - - $scope.availableClientScopes.push(currentScope); - - var index = ComponentUtils.findIndexById($scope.assignedClientScopes, currentScope.id); - if (index > -1) { - $scope.assignedClientScopes.splice(index, 1); - } - } - - $scope.selectedDefClientScopes = []; - $scope.selectedDefClientScopesToRemove = []; - - updateState(); - }; - - $scope.usersUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - var data = {results: []}; - if ('' == query.term.trim()) { - query.callback({ results: [] }); - return; - } - User.query({ realm: $route.current.params.realm, search: query.term.trim(), max: 20 }, function (response) { - query.callback({ - results: response.map(function (user) { - user.text = user.username; - return user; - }) - }); - }); - } - }; - - $scope.selectedUser = null; - - $scope.selectUser = function(user) { - clearEvalResponse(); - - if (!user || !user.id) { - $scope.selectedUser = null; - $scope.userId = ''; - return; - } - - $scope.userId = user.id; - } - - clientSelectControl($scope, $route.current.params.realm, Client); - - $scope.selectedClient = null; - - $scope.selectClient = function(client) { - console.log("selected client: ", client); - if (!client || !client.id) { - $scope.selectedClient = null; - return; - } - - $scope.selectedClient = client; - updateScopeClientRoles(); - } - - - $scope.sendEvaluationRequest = function () { - - // Send request for retrieve protocolMappers - $scope.protocolMappers = ClientEvaluateProtocolMappers.query({ - realm: realm.realm, - client: client.id, - scopeParam: $scope.scopeParam - }); - - // Send request for retrieve realmRoles - updateScopeRealmRoles(); - - // Send request for retrieve accessToken (in case user was selected) - if (client.protocol === 'openid-connect' && $scope.userId != null && $scope.userId !== '') { - var exampleRequestParams = { - realm: realm.realm, - client: client.id, - userId: $scope.userId, - scopeParam: $scope.scopeParam - }; - - var accessTokenUrl = ClientEvaluateGenerateExampleAccessToken.url(exampleRequestParams); - getPrettyJsonResponse(accessTokenUrl).then(function (result) { - $scope.oidcAccessToken = result; - }); - - var idTokenUrl = ClientEvaluateGenerateExampleIDToken.url(exampleRequestParams); - getPrettyJsonResponse(idTokenUrl).then(function (result) { - $scope.oidcIDToken = result; - }); - - var userInfoUrl = ClientEvaluateGenerateExampleUserInfo.url(exampleRequestParams); - getPrettyJsonResponse(userInfoUrl).then(function (result) { - $scope.oidcUserInfo = result; - }); - } - - $scope.showTab(1); - }; - - function getPrettyJsonResponse(url) { - return $http.get(url).then(function (response) { - if (response.data) { - var responseJson = angular.fromJson(response.data); - return angular.toJson(responseJson, true); - } else { - return null; - } - }); - } - - $scope.isResponseAvailable = function () { - return $scope.protocolMappers != null; - } - - $scope.isAccessTokenAvailable = function () { - return $scope.oidcAccessToken != null; - } - - $scope.isIDTokenAvailable = function () { - return $scope.oidcIDToken != null; - } - - $scope.isUserInfoAvailable = function () { - return $scope.oidcUserInfo != null; - } - - $scope.showTab = function (tab) { - $scope.selectedTab = tab; - - $scope.tabCss = { - tab1: getTabCssClass(1, tab), - tab2: getTabCssClass(2, tab), - tab3: getTabCssClass(3, tab), - tab4: getTabCssClass(4, tab), - tab5: getTabCssClass(5, tab) - } - } - - function getTabCssClass(tabNo, selectedTab) { - return (tabNo === selectedTab) ? 'active' : ''; - } - - $scope.protocolMappersShown = function () { - return $scope.selectedTab === 1; - } - - $scope.rolesShown = function () { - return $scope.selectedTab === 2; - } - - $scope.exampleTabInfo = function() { - switch ($scope.selectedTab) { - case 3: - return { isShown: true, value: $scope.oidcAccessToken} - case 4: - return { isShown: true, value: $scope.oidcIDToken} - case 5: - return { isShown: true, value: $scope.oidcUserInfo} - default: - return { isShown: false, value: null} - } - } - - $scope.sortMappersByPriority = function(mapper) { - return $scope.mapperTypes[mapper.protocolMapper].priority; - } - - - // Roles - - function updateScopeRealmRoles() { - $scope.grantedRealmRoles = ClientEvaluateGrantedRoles.query({ - realm: realm.realm, - client: client.id, - roleContainer: realm.realm, - scopeParam: $scope.scopeParam - }); - $scope.notGrantedRealmRoles = ClientEvaluateNotGrantedRoles.query({ - realm: realm.realm, - client: client.id, - roleContainer: realm.realm, - scopeParam: $scope.scopeParam - }); - } - - function updateScopeClientRoles() { - if ($scope.selectedClient) { - $scope.grantedClientRoles = ClientEvaluateGrantedRoles.query({ - realm: realm.realm, - client: client.id, - roleContainer: $scope.selectedClient.id, - scopeParam: $scope.scopeParam - }); - $scope.notGrantedClientRoles = ClientEvaluateNotGrantedRoles.query({ - realm: realm.realm, - client: client.id, - roleContainer: $scope.selectedClient.id, - scopeParam: $scope.scopeParam - }); - } else { - $scope.grantedClientRoles = null; - $scope.notGrantedClientRoles = null; - } - } -}); - - -module.controller('ClientScopeTabCtrl', function(Dialog, $scope, Current, Notifications, $location) { - $scope.removeClientScope = function() { - Dialog.confirmDelete($scope.clientScope.name, 'client scope', function() { - $scope.clientScope.$remove({ - realm : Current.realm.realm, - clientScope : $scope.clientScope.id - }, function() { - $location.url("/realms/" + Current.realm.realm + "/client-scopes"); - Notifications.success("The client scope has been deleted."); - }); - }); - }; -}); - - - -module.controller('ClientScopeListCtrl', function($scope, realm, clientScopes, ClientScope, serverInfo, $route, Dialog, Notifications, $location) { - $scope.realm = realm; - $scope.clientScopes = clientScopes; - - $scope.removeClientScope = function(clientScope) { - Dialog.confirmDelete(clientScope.name, 'client scope', function() { - ClientScope.remove({ - realm : realm.realm, - clientScope : clientScope.id - }, function() { - $route.reload(); - Notifications.success("The client scope been deleted."); - }); - }); - }; -}); - -module.controller('ClientScopesRealmDefaultCtrl', function($scope, realm, Realm, clientScopes, realmDefaultClientScopes, RealmDefaultClientScopes, - realmOptionalClientScopes, RealmOptionalClientScopes, serverInfo, $route, Dialog, Notifications, $location) { - - console.log('ClientScopesRealmDefaultCtrl'); - - $scope.realm = realm; - $scope.realmDefaultClientScopes = realmDefaultClientScopes; - $scope.realmOptionalClientScopes = realmOptionalClientScopes; - - $scope.availableClientScopes = []; - $scope.selectedDefaultClientScopes = []; - $scope.selectedDefDefaultClientScopes = []; - - $scope.selectedOptionalClientScopes = []; - $scope.selectedDefOptionalClientScopes = []; - - // Populate available client scopes. Available client scopes are neither already assigned to 'default' or 'optional' - for (var i = 0; i < clientScopes.length; i++) { - var scopeName = clientScopes[i].name; - - var available = true; - for (var j = 0; j < $scope.realmDefaultClientScopes.length; j++) { - if (scopeName === $scope.realmDefaultClientScopes[j].name) { - available = false; - } - } - for (var j = 0; j < $scope.realmOptionalClientScopes.length; j++) { - if (scopeName === $scope.realmOptionalClientScopes[j].name) { - available = false; - } - } - - if (available) { - $scope.availableClientScopes.push(clientScopes[i]); - } - } - - $scope.addDefaultClientScope = function () { - $scope.selectedDefaultClientScopesToAdd = JSON.parse('[' + $scope.selectedDefaultClientScopes + ']'); - toAdd = $scope.selectedDefaultClientScopesToAdd.length; - - for (var i = 0; i < $scope.selectedDefaultClientScopesToAdd.length; i++) { - var currentScope = $scope.selectedDefaultClientScopesToAdd[i]; - - RealmDefaultClientScopes.update({ - realm : realm.realm, - clientScopeId : currentScope.id - }, function () { - toAdd = toAdd - 1; - console.log('toAdd: ' + toAdd); - if (toAdd === 0) { - $route.reload(); - Notifications.success("Realm default scopes updated."); - } - }); - } - $scope.selectedDefaultClientScopesToAdd = []; - }; - - $scope.deleteDefaultClientScope = function () { - $scope.selectedDefDefaultClientScopesToRemove = JSON.parse('[' + $scope.selectedDefDefaultClientScopes + ']'); - toRemove = $scope.selectedDefDefaultClientScopesToRemove.length; - - for (var i = 0; i < $scope.selectedDefDefaultClientScopesToRemove.length; i++) { - var currentScope = $scope.selectedDefDefaultClientScopesToRemove[i]; - - RealmDefaultClientScopes.remove({ - realm : realm.realm, - clientScopeId : currentScope.id - }, function () { - toRemove = toRemove - 1; - if (toRemove === 0) { - $route.reload(); - Notifications.success("Realm default scopes updated."); - } - }); - } - $scope.selectedDefDefaultClientScopesToRemove = []; - }; - - $scope.addOptionalClientScope = function () { - $scope.selectedOptionalClientScopesToAdd = JSON.parse('[' + $scope.selectedOptionalClientScopes + ']'); - toAdd = $scope.selectedOptionalClientScopesToAdd.length; - - for (var i = 0; i < $scope.selectedOptionalClientScopesToAdd.length; i++) { - var currentScope = $scope.selectedOptionalClientScopesToAdd[i]; - - RealmOptionalClientScopes.update({ - realm : realm.realm, - clientScopeId : currentScope.id - }, function () { - toAdd = toAdd - 1; - console.log('toAdd: ' + toAdd); - if (toAdd === 0) { - $route.reload(); - Notifications.success("Realm optional scopes updated."); - } - }); - } - $scope.selectedOptionalClientScopesToAdd = []; - }; - - $scope.deleteOptionalClientScope = function () { - $scope.selectedDefOptionalClientScopesToRemove = JSON.parse('[' + $scope.selectedDefOptionalClientScopes + ']'); - toRemove = $scope.selectedDefOptionalClientScopesToRemove.length; - - for (var i = 0; i < $scope.selectedDefOptionalClientScopesToRemove.length; i++) { - var currentScope = $scope.selectedDefOptionalClientScopesToRemove[i]; - - RealmOptionalClientScopes.remove({ - realm : realm.realm, - clientScopeId : currentScope.id - }, function () { - toRemove = toRemove - 1; - if (toRemove === 0) { - $route.reload(); - Notifications.success("Realm optional scopes updated."); - } - }); - } - $scope.selectedDefOptionalClientScopesToRemove = []; - }; -}); - -module.controller('ClientScopeDetailCtrl', function($scope, realm, clientScope, $route, serverInfo, ClientScope, $location, $modal, Dialog, Notifications) { - $scope.protocols = serverInfo.listProviderIds('login-protocol'); - - $scope.realm = realm; - $scope.create = !clientScope.name; - - function updateProperties() { - if (!$scope.clientScope.attributes) { - $scope.clientScope.attributes = {}; - } - - if ($scope.clientScope.protocol) { - $scope.protocol = $scope.protocols[$scope.protocols.indexOf($scope.clientScope.protocol)]; - } else { - $scope.protocol = $scope.protocols[0]; - } - - if ($scope.clientScope.attributes["display.on.consent.screen"]) { - if ($scope.clientScope.attributes["display.on.consent.screen"] == "true") { - $scope.displayOnConsentScreen = true; - } else { - $scope.displayOnConsentScreen = false; - } - } else { - $scope.displayOnConsentScreen = true; - } - - if(serverInfo.featureEnabled("DYNAMIC_SCOPES")) { - if ($scope.clientScope.attributes["is.dynamic.scope"]) { - if ($scope.clientScope.attributes["is.dynamic.scope"] === "true") { - $scope.isDynamicScope = true; - } else { - $scope.isDynamicScope = false; - } - } else { - $scope.isDynamicScope = false; - } - - $scope.clientScope.attributes["dynamic.scope.regexp"] = $scope.clientScope.name + ":*"; - } - - if ($scope.clientScope.attributes["include.in.token.scope"]) { - if ($scope.clientScope.attributes["include.in.token.scope"] == "true") { - $scope.includeInTokenScope = true; - } else { - $scope.includeInTokenScope = false; - } - } else { - $scope.includeInTokenScope = true; - } - } - - if (!$scope.create) { - $scope.clientScope = angular.copy(clientScope); - } else { - $scope.clientScope = {}; - } - - updateProperties(); - - - $scope.switchChange = function() { - $scope.changed = true; - } - - $scope.changeProtocol = function() { - if ($scope.protocol == "openid-connect") { - $scope.clientScope.protocol = "openid-connect"; - } else if ($scope.protocol == "saml") { - $scope.clientScope.protocol = "saml"; - } - }; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - function isChanged() { - if (!angular.equals($scope.clientScope, clientScope)) { - return true; - } - return false; - } - - $scope.$watch('clientScope', function() { - $scope.changed = isChanged(); - }, true); - - $scope.save = function() { - $scope.clientScope.protocol = $scope.protocol; - - if ($scope.displayOnConsentScreen == true) { - $scope.clientScope.attributes["display.on.consent.screen"] = "true"; - } else { - $scope.clientScope.attributes["display.on.consent.screen"] = "false"; - } - - if(serverInfo.featureEnabled("DYNAMIC_SCOPES")) { - if ($scope.isDynamicScope === true) { - $scope.clientScope.attributes["is.dynamic.scope"] = "true"; - } else { - $scope.clientScope.attributes["is.dynamic.scope"] = "false"; - } - } - - if ($scope.includeInTokenScope == true) { - $scope.clientScope.attributes["include.in.token.scope"] = "true"; - } else { - $scope.clientScope.attributes["include.in.token.scope"] = "false"; - } - - if ($scope.create) { - ClientScope.save({ - realm: realm.realm, - clientScope: '' - }, $scope.clientScope, function (data, headers) { - $scope.changed = false; - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - $location.url("/realms/" + realm.realm + "/client-scopes/" + id); - Notifications.success("The client scope has been created."); - }); - } else { - ClientScope.update({ - realm : realm.realm, - clientScope : clientScope.id - }, $scope.clientScope, function() { - $scope.changed = false; - clientScope = angular.copy($scope.clientScope); - $location.url("/realms/" + realm.realm + "/client-scopes/" + clientScope.id); - Notifications.success("Your changes have been saved to the client scope."); - }); - } - }; - - $scope.reset = function() { - $route.reload(); - }; - - $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/client-scopes"); - }; -}); - -module.controller('ClientScopeProtocolMapperListCtrl', function($scope, realm, clientScope, serverInfo, - ClientScopeProtocolMappersByProtocol, ClientScopeProtocolMapper, - $route, Dialog, Notifications) { - $scope.realm = realm; - $scope.clientScope = clientScope; - if (clientScope.protocol == null) { - clientScope.protocol = 'openid-connect'; - } - - var protocolMappers = serverInfo.protocolMapperTypes[clientScope.protocol]; - var mapperTypes = {}; - for (var i = 0; i < protocolMappers.length; i++) { - mapperTypes[protocolMappers[i].id] = protocolMappers[i]; - } - $scope.mapperTypes = mapperTypes; - - $scope.removeMapper = function(mapper) { - console.debug(mapper); - Dialog.confirmDelete(mapper.name, 'mapper', function() { - ClientScopeProtocolMapper.remove({ realm: realm.realm, clientScope: clientScope.id, id : mapper.id }, function() { - Notifications.success("The mapper has been deleted."); - $route.reload(); - }); - }); - }; - - $scope.sortMappersByPriority = function(mapper) { - return $scope.mapperTypes[mapper.protocolMapper].priority; - } - - var updateMappers = function() { - $scope.mappers = ClientScopeProtocolMappersByProtocol.query({realm : realm.realm, clientScope : clientScope.id, protocol : clientScope.protocol}); - }; - - updateMappers(); -}); - -module.controller('ClientScopeProtocolMapperCtrl', function($scope, realm, serverInfo, clientScope, mapper, clients, ClientScopeProtocolMapper, Notifications, Dialog, $location, $route) { - $scope.realm = realm; - $scope.clients = clients; - - if (clientScope.protocol == null) { - clientScope.protocol = 'openid-connect'; - } - - $scope.model = { - realm: realm, - clientScope: clientScope, - create: false, - protocol: clientScope.protocol, - mapper: angular.copy(mapper), - changed: false - } - - var protocolMappers = serverInfo.protocolMapperTypes[clientScope.protocol]; - for (var i = 0; i < protocolMappers.length; i++) { - if (protocolMappers[i].id == mapper.protocolMapper) { - $scope.model.mapperType = protocolMappers[i]; - } - } - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.$watch('model.mapper', function() { - if (!angular.equals($scope.model.mapper, mapper)) { - $scope.model.changed = true; - } - }, true); - - $scope.save = function() { - ClientScopeProtocolMapper.update({ - realm : realm.realm, - clientScope: clientScope.id, - id : mapper.id - }, $scope.model.mapper, function() { - $route.reload(); - Notifications.success("Your changes have been saved."); - }); - }; - - $scope.reset = function() { - $scope.model.mapper = angular.copy(mapper); - $scope.model.changed = false; - }; - - $scope.cancel = function() { - //$location.url("/realms"); - window.history.back(); - }; - - $scope.remove = function() { - Dialog.confirmDelete($scope.model.mapper.name, 'mapper', function() { - ClientScopeProtocolMapper.remove({ realm: realm.realm, clientScope: clientScope.id, id : $scope.model.mapper.id }, function() { - Notifications.success("The mapper has been deleted."); - $location.url("/realms/" + realm.realm + '/client-scopes/' + clientScope.id + "/mappers"); - }); - }); - }; - -}); - -module.controller('ClientScopeProtocolMapperCreateCtrl', function($scope, realm, serverInfo, clientScope, clients, ClientScopeProtocolMapper, Notifications, Dialog, $location) { - $scope.realm = realm; - $scope.clients = clients; - - if (clientScope.protocol == null) { - clientScope.protocol = 'openid-connect'; - } - var protocol = clientScope.protocol; - $scope.model = { - realm: realm, - clientScope: clientScope, - create: true, - protocol: clientScope.protocol, - mapper: { protocol : clientScope.protocol, config: {}}, - changed: false, - mapperTypes: serverInfo.protocolMapperTypes[protocol] - } - - // apply default configurations on change for selected protocolmapper type. - $scope.$watch('model.mapperType', function() { - var currentMapperType = $scope.model.mapperType; - var defaultConfig = {}; - - if (currentMapperType && Array.isArray(currentMapperType.properties)) { - for (var i = 0; i < currentMapperType.properties.length; i++) { - var property = currentMapperType.properties[i]; - if (property && property.name && property.defaultValue) { - defaultConfig[property.name] = property.defaultValue; - } - } - } - - $scope.model.mapper.config = defaultConfig; - }, true); - - $scope.model.mapperType = $scope.model.mapperTypes[0]; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.save = function() { - $scope.model.mapper.protocolMapper = $scope.model.mapperType.id; - ClientScopeProtocolMapper.save({ - realm : realm.realm, clientScope: clientScope.id - }, $scope.model.mapper, function(data, headers) { - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - $location.url("/realms/" + realm.realm + '/client-scopes/' + clientScope.id + "/mappers/" + id); - Notifications.success("Mapper has been created."); - }); - }; - - $scope.cancel = function() { - //$location.url("/realms"); - window.history.back(); - }; - - -}); - -module.controller('ClientScopeAddBuiltinProtocolMapperCtrl', function($scope, realm, clientScope, serverInfo, - ClientScopeProtocolMappersByProtocol, - $http, $location, Dialog, Notifications) { - $scope.realm = realm; - $scope.clientScope = clientScope; - if (clientScope.protocol == null) { - clientScope.protocol = 'openid-connect'; - } - - var protocolMappers = serverInfo.protocolMapperTypes[clientScope.protocol]; - var mapperTypes = {}; - for (var i = 0; i < protocolMappers.length; i++) { - mapperTypes[protocolMappers[i].id] = protocolMappers[i]; - } - $scope.mapperTypes = mapperTypes; - - - - - var updateMappers = function() { - var clientMappers = ClientScopeProtocolMappersByProtocol.query({realm : realm.realm, clientScope : clientScope.id, protocol : clientScope.protocol}, function() { - var builtinMappers = serverInfo.builtinProtocolMappers[clientScope.protocol]; - for (var i = 0; i < clientMappers.length; i++) { - for (var j = 0; j < builtinMappers.length; j++) { - if (builtinMappers[j].name == clientMappers[i].name - && builtinMappers[j].protocolMapper == clientMappers[i].protocolMapper) { - builtinMappers.splice(j, 1); - break; - } - } - } - $scope.mappers = builtinMappers; - for (var i = 0; i < $scope.mappers.length; i++) { - $scope.mappers[i].isChecked = false; - } - - - }); - }; - - updateMappers(); - - $scope.add = function() { - var toAdd = []; - for (var i = 0; i < $scope.mappers.length; i++) { - if ($scope.mappers[i].isChecked) { - delete $scope.mappers[i].isChecked; - toAdd.push($scope.mappers[i]); - } - } - $http.post(authUrl + '/admin/realms/' + realm.realm + '/client-scopes/' + clientScope.id + '/protocol-mappers/add-models', - toAdd).then(function() { - Notifications.success("Mappers added"); - $location.url('/realms/' + realm.realm + '/client-scopes/' + clientScope.id + '/mappers'); - }).catch(function() { - Notifications.error("Error adding mappers"); - $location.url('/realms/' + realm.realm + '/client-scopes/' + clientScope.id + '/mappers'); - }); - }; - -}); - - -module.controller('ClientScopeScopeMappingCtrl', function($scope, $http, $route, realm, clientScope, Notifications, - ClientScope, Client, - ClientScopeRealmScopeMapping, ClientScopeClientScopeMapping, ClientRole, - ClientScopeAvailableRealmScopeMapping, ClientScopeAvailableClientScopeMapping, - ClientScopeCompositeRealmScopeMapping, ClientScopeCompositeClientScopeMapping) { - $scope.realm = realm; - $scope.clientScope = angular.copy(clientScope); - $scope.selectedRealmRoles = []; - $scope.selectedRealmMappings = []; - $scope.realmMappings = []; - $scope.clientRoles = []; - $scope.clientComposite = []; - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - $scope.clientMappings = []; - $scope.dummymodel = []; - $scope.selectedClient = null; - - function updateScopeRealmRoles() { - $scope.realmRoles = ClientScopeAvailableRealmScopeMapping.query({realm : realm.realm, clientScope : clientScope.id}); - $scope.realmMappings = ClientScopeRealmScopeMapping.query({realm : realm.realm, clientScope : clientScope.id}); - $scope.realmComposite = ClientScopeCompositeRealmScopeMapping.query({realm : realm.realm, clientScope : clientScope.id}); - } - - function updateScopeClientRoles() { - if ($scope.selectedClient) { - $scope.clientRoles = ClientScopeAvailableClientScopeMapping.query({realm : realm.realm, clientScope : clientScope.id, targetClient : $scope.selectedClient.id}); - $scope.clientMappings = ClientScopeClientScopeMapping.query({realm : realm.realm, clientScope : clientScope.id, targetClient : $scope.selectedClient.id}); - $scope.clientComposite = ClientScopeCompositeClientScopeMapping.query({realm : realm.realm, clientScope : clientScope.id, targetClient : $scope.selectedClient.id}); - } else { - $scope.clientRoles = null; - $scope.clientMappings = null; - $scope.clientComposite = null; - } - } - - $scope.changeClient = function(client) { - if (!client || !client.id) { - $scope.selectedClient = null; - return; - } - $scope.selectedClient = client; - updateScopeClientRoles(); - }; - - $scope.addRealmRole = function() { - $scope.selectedRealmRolesToAdd = JSON.parse('[' + $scope.selectedRealmRoles + ']'); - $scope.selectedRealmRoles = []; - $http.post(authUrl + '/admin/realms/' + realm.realm + '/client-scopes/' + clientScope.id + '/scope-mappings/realm', - $scope.selectedRealmRolesToAdd).then(function() { - updateScopeRealmRoles(); - $scope.selectedRealmRolesToAdd = []; - Notifications.success("Scope mappings updated."); - }); - }; - - $scope.deleteRealmRole = function() { - $scope.selectedRealmMappingsToRemove = JSON.parse('[' + $scope.selectedRealmMappings + ']'); - $scope.selectedRealmMappings = []; - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/client-scopes/' + clientScope.id + '/scope-mappings/realm', - {data : $scope.selectedRealmMappingsToRemove, headers : {"content-type" : "application/json"}}).then(function () { - updateScopeRealmRoles(); - $scope.selectedRealmMappingsToRemove = []; - Notifications.success("Scope mappings updated."); - }); - }; - - $scope.addClientRole = function() { - $scope.selectedClientRolesToAdd = JSON.parse('[' + $scope.selectedClientRoles + ']'); - $scope.selectedClientRoles = []; - $http.post(authUrl + '/admin/realms/' + realm.realm + '/client-scopes/' + clientScope.id + '/scope-mappings/clients/' + $scope.selectedClient.id, - $scope.selectedClientRolesToAdd).then(function () { - updateScopeClientRoles(); - $scope.selectedClientRolesToAdd = []; - Notifications.success("Scope mappings updated."); - }); - }; - - $scope.deleteClientRole = function() { - $scope.selectedClientMappingsToRemove = JSON.parse('[' + $scope.selectedClientMappings + ']'); - $scope.selectedClientMappings = []; - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/client-scopes/' + clientScope.id + '/scope-mappings/clients/' + $scope.selectedClient.id, - {data : $scope.selectedClientMappingsToRemove, headers : {"content-type" : "application/json"}}).then(function () { - updateScopeClientRoles(); - $scope.selectedClientMappingsToRemove = []; - Notifications.success("Scope mappings updated."); - }); - }; - - clientSelectControl($scope, $route.current.params.realm, Client); - updateScopeRealmRoles(); -}); - -module.controller('ClientStoresCtrl', function($scope, $location, $route, realm, serverInfo, Components, Notifications, Dialog) { - console.log('ClientStoresCtrl ++++****'); - $scope.realm = realm; - $scope.providers = serverInfo.componentTypes['org.keycloak.storage.client.ClientStorageProvider']; - $scope.clientStorageProviders = serverInfo.componentTypes['org.keycloak.storage.client.ClientStorageProvider']; - $scope.instancesLoaded = false; - - if (!$scope.providers) $scope.providers = []; - - $scope.addProvider = function(provider) { - console.log('Add provider: ' + provider.id); - $location.url("/create/client-storage/" + realm.realm + "/providers/" + provider.id); - }; - - $scope.getInstanceLink = function(instance) { - return "/realms/" + realm.realm + "/client-storage/providers/" + instance.providerId + "/" + instance.id; - } - - $scope.getInstanceName = function(instance) { - return instance.name; - } - $scope.getInstanceProvider = function(instance) { - return instance.providerId; - } - - $scope.isProviderEnabled = function(instance) { - return !instance.config['enabled'] || instance.config['enabled'][0] == 'true'; - } - - $scope.getInstancePriority = function(instance) { - if (!instance.config['priority']) { - return "0"; - } - return instance.config['priority'][0]; - } - - Components.query({realm: realm.realm, - parent: realm.id, - type: 'org.keycloak.storage.client.ClientStorageProvider' - }, function(data) { - $scope.instances = data; - $scope.instancesLoaded = true; - }); - - $scope.removeInstance = function(instance) { - Dialog.confirmDelete(instance.name, 'client storage provider', function() { - Components.remove({ - realm : realm.realm, - componentId : instance.id - }, function() { - $route.reload(); - Notifications.success("The provider has been deleted."); - }); - }); - }; -}); - -module.controller('GenericClientStorageCtrl', function($scope, $location, Notifications, $route, Dialog, realm, - serverInfo, instance, providerId, Components) { - console.log('GenericClientStorageCtrl'); - console.log('providerId: ' + providerId); - $scope.create = !instance.providerId; - console.log('create: ' + $scope.create); - var providers = serverInfo.componentTypes['org.keycloak.storage.client.ClientStorageProvider']; - console.log('providers length ' + providers.length); - var providerFactory = null; - for (var i = 0; i < providers.length; i++) { - var p = providers[i]; - console.log('provider: ' + p.id); - if (p.id == providerId) { - $scope.providerFactory = p; - providerFactory = p; - break; - } - - } - $scope.changed = false; - - console.log("providerFactory: " + providerFactory.id); - - function initClientStorageSettings() { - if ($scope.create) { - $scope.changed = true; - instance.name = providerFactory.id; - instance.providerId = providerFactory.id; - instance.providerType = 'org.keycloak.storage.client.ClientStorageProvider'; - instance.parentId = realm.id; - instance.config = { - - }; - instance.config['priority'] = ["0"]; - instance.config['enabled'] = ["true"]; - - $scope.fullSyncEnabled = false; - $scope.changedSyncEnabled = false; - instance.config['cachePolicy'] = ['DEFAULT']; - instance.config['evictionDay'] = ['']; - instance.config['evictionHour'] = ['']; - instance.config['evictionMinute'] = ['']; - instance.config['maxLifespan'] = ['']; - if (providerFactory.properties) { - - for (var i = 0; i < providerFactory.properties.length; i++) { - var configProperty = providerFactory.properties[i]; - if (configProperty.defaultValue) { - instance.config[configProperty.name] = [configProperty.defaultValue]; - } else { - instance.config[configProperty.name] = ['']; - } - - } - } - - } else { - $scope.changed = false; - if (!instance.config['enabled']) { - instance.config['enabled'] = ['true']; - } - if (!instance.config['cachePolicy']) { - instance.config['cachePolicy'] = ['DEFAULT']; - - } - if (!instance.config['evictionDay']) { - instance.config['evictionDay'] = ['']; - - } - if (!instance.config['evictionHour']) { - instance.config['evictionHour'] = ['']; - - } - if (!instance.config['evictionMinute']) { - instance.config['evictionMinute'] = ['']; - - } - if (!instance.config['maxLifespan']) { - instance.config['maxLifespan'] = ['']; - - } - if (!instance.config['priority']) { - instance.config['priority'] = ['0']; - } - - if (providerFactory.properties) { - for (var i = 0; i < providerFactory.properties.length; i++) { - var configProperty = providerFactory.properties[i]; - if (!instance.config[configProperty.name]) { - instance.config[configProperty.name] = ['']; - } - } - } - - } - } - - initClientStorageSettings(); - $scope.instance = angular.copy(instance); - $scope.realm = realm; - - $scope.$watch('instance', function() { - if (!angular.equals($scope.instance, instance)) { - $scope.changed = true; - } - - }, true); - - $scope.save = function() { - console.log('save provider'); - $scope.changed = false; - if ($scope.create) { - console.log('saving new provider'); - Components.save({realm: realm.realm}, $scope.instance, function (data, headers) { - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - - $location.url("/realms/" + realm.realm + "/client-storage/providers/" + $scope.instance.providerId + "/" + id); - Notifications.success("The provider has been created."); - }); - } else { - console.log('update existing provider'); - Components.update({realm: realm.realm, - componentId: instance.id - }, - $scope.instance, function () { - $route.reload(); - Notifications.success("The provider has been updated."); - }); - } - }; - - $scope.reset = function() { - $route.reload(); - }; - - $scope.cancel = function() { - console.log('cancel'); - if ($scope.create) { - $location.url("/realms/" + realm.realm + "/client-stores"); - } else { - $route.reload(); - } - }; - - - -}); - - diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/groups.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/groups.js deleted file mode 100755 index e92de0f5d3..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/groups.js +++ /dev/null @@ -1,625 +0,0 @@ -module.controller('GroupListCtrl', function($scope, $route, $q, realm, Groups, GroupsCount, Group, GroupChildren, Notifications, $location, Dialog, ComponentUtils, $translate) { - $scope.realm = realm; - $scope.groupList = [ - { - "id" : "realm", - "name": $translate.instant('groups'), - "subGroups" : [] - } - ]; - - $scope.searchCriteria = ''; - $scope.currentPage = 1; - $scope.currentPageInput = $scope.currentPage; - $scope.pageSize = 20; - $scope.numberOfPages = 1; - $scope.tree = []; - - var refreshGroups = function (search) { - console.log('refreshGroups'); - $scope.currentPageInput = $scope.currentPage; - - var first = ($scope.currentPage * $scope.pageSize) - $scope.pageSize; - console.log('first:' + first); - var queryParams = { - realm : realm.realm, - first : first, - max : $scope.pageSize - }; - var countParams = { - realm : realm.realm, - top : 'true' - }; - - if(angular.isDefined(search) && search !== '') { - queryParams.search = search; - countParams.search = search; - } - - var promiseGetGroups = $q.defer(); - Groups.query(queryParams, function(entry) { - promiseGetGroups.resolve(entry); - }, function() { - promiseGetGroups.reject($translate.instant('group.fetch.fail', {params: queryParams})); - }); - promiseGetGroups.promise.then(function(groups) { - $scope.groupList = [ - { - "id" : "realm", - "name": $translate.instant('groups'), - "subGroups": ComponentUtils.sortGroups('name', groups) - } - ]; - if (angular.isDefined(search) && search !== '') { - // Add highlight for concrete text match - setTimeout(function () { - document.querySelectorAll('span').forEach(function (element) { - if (element.textContent.indexOf(search) != -1) { - angular.element(element).addClass('highlight'); - } - }); - }, 500); - } - }, function (failed) { - Notifications.error(failed); - }); - - var promiseCount = $q.defer(); - console.log('countParams: realm[' + countParams.realm); - GroupsCount.query(countParams, function(entry) { - promiseCount.resolve(entry); - }, function() { - promiseCount.reject($translate.instant('group.fetch.fail', {params: countParams})); - }); - promiseCount.promise.then(function(entry) { - if(angular.isDefined(entry.count) && entry.count > $scope.pageSize) { - $scope.numberOfPages = Math.ceil(entry.count/$scope.pageSize); - } else { - $scope.numberOfPages = 1; - } - }, function (failed) { - Notifications.error(failed); - }); - }; - refreshGroups(); - - $scope.$watch('currentPage', function(newValue, oldValue) { - if(parseInt(newValue, 10) !== oldValue) { - refreshGroups($scope.searchCriteria); - } - }); - - $scope.clearSearch = function() { - $scope.searchCriteria = ''; - if (parseInt($scope.currentPage, 10) === 1) { - refreshGroups(); - } else { - $scope.currentPage = 1; - } - }; - - $scope.searchGroup = function() { - if (parseInt($scope.currentPage, 10) === 1) { - refreshGroups($scope.searchCriteria); - } else { - $scope.currentPage = 1; - } - }; - - $scope.edit = function(selected) { - if (selected.id === 'realm') return; - $location.url("/realms/" + realm.realm + "/groups/" + selected.id); - }; - - $scope.cut = function(selected) { - $scope.cutNode = selected; - }; - - $scope.isDisabled = function() { - if (!$scope.tree.currentNode) return true; - return $scope.tree.currentNode.id === 'realm'; - }; - - $scope.paste = function(selected) { - if (selected === null) return; - if ($scope.cutNode === null) return; - if (selected.id === $scope.cutNode.id) return; - if (selected.id === 'realm') { - Groups.save({realm: realm.realm}, {id:$scope.cutNode.id, name: $scope.cutNode.name}, function() { - $route.reload(); - Notifications.success($translate.instant('group.move.success')); - - }); - - } else { - GroupChildren.save({realm: realm.realm, groupId: selected.id}, {id:$scope.cutNode.id, name: $scope.cutNode.name}, function() { - $route.reload(); - Notifications.success($translate.instant('group.move.success')); - - }); - - } - - }; - - $scope.remove = function(selected) { - if (selected === null) return; - Dialog.confirmWithButtonText( - $translate.instant('group.remove.confirm.title', {name: selected.name}), - $translate.instant('group.remove.confirm.message', {name: selected.name}), - $translate.instant('dialogs.delete.confirm'), - function() { - Group.remove({ realm: realm.realm, groupId : selected.id }, function() { - $route.reload(); - Notifications.success($translate.instant('group.remove.success')); - }); - } - ); - }; - - $scope.createGroup = function(selected) { - var parent = 'realm'; - if (selected) { - parent = selected.id; - } - $location.url("/create/group/" + realm.realm + '/parent/' + parent); - - }; - var isLeaf = function(node) { - return node.id !== "realm" && (!node.subGroups || node.subGroups.length === 0); - }; - - $scope.getGroupClass = function(node) { - if (node.id === "realm") { - return 'pficon pficon-users'; - } - if (isLeaf(node)) { - return 'normal'; - } - if (node.subGroups.length && node.collapsed) return 'collapsed'; - if (node.subGroups.length && !node.collapsed) return 'expanded'; - return 'collapsed'; - - }; - - $scope.getSelectedClass = function(node) { - if (node.selected) { - return 'selected'; - } else if ($scope.cutNode && $scope.cutNode.id === node.id) { - return 'cut'; - } - return undefined; - } - -}); - -module.controller('GroupCreateCtrl', function($scope, $route, realm, parentId, Groups, Group, GroupChildren, Notifications, $location, $translate) { - $scope.realm = realm; - $scope.group = {}; - $scope.save = function() { - console.log('save!!!'); - if (parentId === 'realm') { - console.log('realm'); - Groups.save({realm: realm.realm}, $scope.group, function(data, headers) { - var l = headers().location; - - - var id = l.substring(l.lastIndexOf("/") + 1); - - $location.url("/realms/" + realm.realm + "/groups/" + id); - Notifications.success($translate.instant('group.create.success')); - }) - - } else { - GroupChildren.save({realm: realm.realm, groupId: parentId}, $scope.group, function(data, headers) { - var l = headers().location; - - - var id = l.substring(l.lastIndexOf("/") + 1); - - $location.url("/realms/" + realm.realm + "/groups/" + id); - Notifications.success($translate.instant('group.create.success')); - }) - - } - - }; - $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/groups"); - }; -}); - -module.controller('GroupTabCtrl', function(Dialog, $scope, Current, Group, Notifications, $location, $translate) { - $scope.removeGroup = function() { - Dialog.confirmWithButtonText( - $translate.instant('group.remove.confirm.title', {name: $scope.group.name}), - $translate.instant('group.remove.confirm.message', {name: $scope.group.name}), - $translate.instant('dialogs.delete.confirm'), - function() { - Group.remove({ - realm : Current.realm.realm, - groupId : $scope.group.id - }, function() { - $location.url("/realms/" + Current.realm.realm + "/groups"); - Notifications.success($translate.instant('group.remove.success')); - }); - } - ); - }; -}); - -module.controller('GroupDetailCtrl', function(Dialog, $scope, realm, group, Group, Notifications, $location, $translate) { - $scope.realm = realm; - - if (!group.attributes) { - group.attributes = {} - } - convertAttributeValuesToString(group); - - - $scope.group = angular.copy(group); - - $scope.changed = false; // $scope.create; - $scope.$watch('group', function() { - if (!angular.equals($scope.group, group)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - convertAttributeValuesToLists(); - - Group.update({ - realm: realm.realm, - groupId: $scope.group.id - }, $scope.group, function () { - $scope.changed = false; - convertAttributeValuesToString($scope.group); - group = angular.copy($scope.group); - Notifications.success($translate.instant('group.edit.success')); - }); - }; - - function convertAttributeValuesToLists() { - var attrs = $scope.group.attributes; - for (var attribute in attrs) { - if (typeof attrs[attribute] === "string") { - attrs[attribute] = attrs[attribute].split("##"); - } - } - } - - function convertAttributeValuesToString(group) { - var attrs = group.attributes; - for (var attribute in attrs) { - if (typeof attrs[attribute] === "object") { - attrs[attribute] = attrs[attribute].join("##"); - } - } - } - - $scope.reset = function() { - $scope.group = angular.copy(group); - $scope.changed = false; - }; - - $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/groups"); - }; - - $scope.addAttribute = function() { - $scope.group.attributes[$scope.newAttribute.key] = $scope.newAttribute.value; - delete $scope.newAttribute; - } - - $scope.removeAttribute = function(key) { - delete $scope.group.attributes[key]; - } -}); - -module.controller('GroupRoleMappingCtrl', function($scope, $http, $route, realm, group, clients, client, Client, Notifications, GroupRealmRoleMapping, - GroupClientRoleMapping, GroupAvailableRealmRoleMapping, GroupAvailableClientRoleMapping, - GroupCompositeRealmRoleMapping, GroupCompositeClientRoleMapping, $translate) { - $scope.realm = realm; - $scope.group = group; - $scope.selectedRealmRoles = []; - $scope.selectedRealmMappings = []; - $scope.realmMappings = []; - $scope.clients = clients; - $scope.client = client; - $scope.clientRoles = []; - $scope.clientComposite = []; - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - $scope.clientMappings = []; - $scope.dummymodel = []; - - $scope.realmMappings = GroupRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.realmRoles = GroupAvailableRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.realmComposite = GroupCompositeRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - - $scope.addRealmRole = function() { - $scope.selectedRealmRolesToAdd = JSON.parse('[' + $scope.selectedRealmRoles + ']'); - $scope.selectedRealmRoles = []; - $http.post(authUrl + '/admin/realms/' + realm.realm + '/groups/' + group.id + '/role-mappings/realm', - $scope.selectedRealmRolesToAdd).then(function() { - $scope.realmMappings = GroupRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.realmRoles = GroupAvailableRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.realmComposite = GroupCompositeRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.selectedRealmMappings = []; - $scope.selectRealmRoles = []; - if ($scope.selectedClient) { - console.log('load available'); - $scope.clientComposite = GroupCompositeClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.clientRoles = GroupAvailableClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.clientMappings = GroupClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - } - $scope.selectedRealmRolesToAdd = []; - Notifications.success($translate.instant('group.roles.add.success')); - - }); - }; - - $scope.deleteRealmRole = function() { - $scope.selectedRealmMappingsToRemove = JSON.parse('[' + $scope.selectedRealmMappings + ']'); - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/groups/' + group.id + '/role-mappings/realm', - {data : $scope.selectedRealmMappingsToRemove, headers : {"content-type" : "application/json"}}).then(function() { - $scope.realmMappings = GroupRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.realmRoles = GroupAvailableRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.realmComposite = GroupCompositeRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.selectedRealmMappings = []; - $scope.selectRealmRoles = []; - if ($scope.selectedClient) { - console.log('load available'); - $scope.clientComposite = GroupCompositeClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.clientRoles = GroupAvailableClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.clientMappings = GroupClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - } - $scope.selectedRealmMappingsToRemove = []; - Notifications.success($translate.instant('group.roles.remove.success')); - }); - }; - - $scope.addClientRole = function() { - $scope.selectedClientRolesToAdd = JSON.parse('[' + $scope.selectedClientRoles + ']'); - $http.post(authUrl + '/admin/realms/' + realm.realm + '/groups/' + group.id + '/role-mappings/clients/' + $scope.selectedClient.id, - $scope.selectedClientRolesToAdd).then(function() { - $scope.clientMappings = GroupClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.clientRoles = GroupAvailableClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.clientComposite = GroupCompositeClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - $scope.realmComposite = GroupCompositeRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.realmRoles = GroupAvailableRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.selectedClientRolesToAdd = []; - Notifications.success($translate.instant('group.roles.add.success')); - }); - }; - - $scope.deleteClientRole = function() { - $scope.selectedClientMappingsToRemove = JSON.parse('[' + $scope.selectedClientMappings + ']'); - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/groups/' + group.id + '/role-mappings/clients/' + $scope.selectedClient.id, - {data : $scope.selectedClientMappingsToRemove, headers : {"content-type" : "application/json"}}).then(function() { - $scope.clientMappings = GroupClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.clientRoles = GroupAvailableClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.clientComposite = GroupCompositeClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - $scope.realmComposite = GroupCompositeRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.realmRoles = GroupAvailableRealmRoleMapping.query({realm : realm.realm, groupId : group.id}); - $scope.selectedClientMappingsToRemove = []; - Notifications.success($translate.instant('group.roles.remove.success')); - }); - }; - - - $scope.changeClient = function(client) { - $scope.selectedClient = client; - if (!client || !client.id) { - $scope.selectedClient = null; - $scope.clientRoles = null; - $scope.clientMappings = null; - $scope.clientComposite = null; - return; - } - if ($scope.selectedClient) { - $scope.clientComposite = GroupCompositeClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.clientRoles = GroupAvailableClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - $scope.clientMappings = GroupClientRoleMapping.query({realm : realm.realm, groupId : group.id, client : $scope.selectedClient.id}); - } - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - }; - - clientSelectControl($scope, $route.current.params.realm, Client); - -}); - -module.controller('GroupMembersCtrl', function($scope, realm, group, GroupMembership) { - $scope.realm = realm; - $scope.page = 0; - $scope.group = group; - - $scope.query = { - realm: realm.realm, - groupId: group.id, - max : 5, - first : 0 - }; - - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.searchQuery(); - }; - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.searchQuery(); - }; - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.searchQuery(); - }; - - $scope.searchQuery = function() { - console.log("query.search: " + $scope.query.search); - $scope.searchLoaded = false; - - $scope.users = GroupMembership.query($scope.query, function() { - console.log('search loaded'); - $scope.searchLoaded = true; - $scope.lastSearch = $scope.query.search; - }); - }; - - $scope.searchQuery(); - -}); - -module.controller('DefaultGroupsCtrl', function($scope, $q, realm, Groups, GroupsCount, DefaultGroups, Notifications, $translate) { - $scope.realm = realm; - $scope.groupList = []; - $scope.selectedGroup = null; - $scope.tree = []; - - $scope.searchCriteria = ''; - $scope.currentPage = 1; - $scope.currentPageInput = $scope.currentPage; - $scope.pageSize = 20; - $scope.numberOfPages = 1; - - var refreshDefaultGroups = function () { - DefaultGroups.query({realm: realm.realm}, function(data) { - $scope.defaultGroups = data; - }); - } - - var refreshAvailableGroups = function (search) { - var first = ($scope.currentPage * $scope.pageSize) - $scope.pageSize; - $scope.currentPageInput = $scope.currentPage; - var queryParams = { - realm : realm.realm, - first : first, - max : $scope.pageSize - }; - var countParams = { - realm : realm.realm, - top : 'true' - }; - - if(angular.isDefined(search) && search !== '') { - queryParams.search = search; - countParams.search = search; - } - - var promiseGetGroups = $q.defer(); - Groups.query(queryParams, function(entry) { - promiseGetGroups.resolve(entry); - }, function() { - promiseGetGroups.reject($translate.instant('group.fetch.fail', {params: queryParams})); - }); - promiseGetGroups.promise.then(function(groups) { - $scope.groupList = groups; - }, function (failed) { - Notifications.success(failed); - }); - - var promiseCount = $q.defer(); - GroupsCount.query(countParams, function(entry) { - promiseCount.resolve(entry); - }, function() { - promiseCount.reject($translate.instant('group.fetch.fail', {params: countParams})); - }); - promiseCount.promise.then(function(entry) { - if(angular.isDefined(entry.count) && entry.count > $scope.pageSize) { - $scope.numberOfPages = Math.ceil(entry.count/$scope.pageSize); - } - }, function (failed) { - Notifications.success(failed); - }); - }; - - refreshAvailableGroups(); - - $scope.$watch('currentPage', function(newValue, oldValue) { - if(parseInt(newValue, 10) !== parseInt(oldValue, 10)) { - refreshAvailableGroups($scope.searchCriteria); - } - }); - - $scope.clearSearch = function() { - $scope.searchCriteria = ''; - if (parseInt($scope.currentPage, 10) === 1) { - refreshAvailableGroups(); - } else { - $scope.currentPage = 1; - } - }; - - $scope.searchGroup = function() { - if (parseInt($scope.currentPage, 10) === 1) { - refreshAvailableGroups($scope.searchCriteria); - } else { - $scope.currentPage = 1; - } - }; - - refreshDefaultGroups(); - - $scope.addDefaultGroup = function() { - if (!$scope.tree.currentNode) { - Notifications.error($translate.instant('group.default.add.error')); - return; - } - - DefaultGroups.update({realm: realm.realm, groupId: $scope.tree.currentNode.id}, function() { - refreshDefaultGroups(); - Notifications.success($translate.instant('group.default.add.success')); - }); - - }; - - $scope.removeDefaultGroup = function() { - DefaultGroups.remove({realm: realm.realm, groupId: $scope.selectedGroup.id}, function() { - refreshDefaultGroups(); - Notifications.success($translate.instant('group.default.remove.success')); - }); - - }; - - var isLeaf = function(node) { - return node.id !== "realm" && (!node.subGroups || node.subGroups.length === 0); - }; - - $scope.getGroupClass = function(node) { - if (node.id === "realm") { - return 'pficon pficon-users'; - } - if (isLeaf(node)) { - return 'normal'; - } - if (node.subGroups.length && node.collapsed) return 'collapsed'; - if (node.subGroups.length && !node.collapsed) return 'expanded'; - return 'collapsed'; - - }; - - $scope.getSelectedClass = function(node) { - if (node.selected) { - return 'selected'; - } else if ($scope.cutNode && $scope.cutNode.id === node.id) { - return 'cut'; - } - return undefined; - } - -}); diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js deleted file mode 100644 index d683e4028a..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js +++ /dev/null @@ -1,4598 +0,0 @@ -function getAccess(Auth, Current, role) { - if (!Current.realm)return false; - var realmAccess = Auth.user && Auth.user['realm_access']; - if (realmAccess) { - realmAccess = realmAccess[Current.realm.realm]; - if (realmAccess) { - return realmAccess.indexOf(role) >= 0; - } - } - return false; -} - -function getAccessObject(Auth, Current) { - return { - get createRealm() { - return Auth.user && Auth.user.createRealm; - }, - - get queryUsers() { - return getAccess(Auth, Current, 'query-users') || this.viewUsers; - }, - - get queryGroups() { - return getAccess(Auth, Current, 'query-groups') || this.viewUsers; - }, - - get queryClients() { - return getAccess(Auth, Current, 'query-clients') || this.viewClients; - }, - - get viewRealm() { - return getAccess(Auth, Current, 'view-realm') || getAccess(Auth, Current, 'manage-realm') || this.manageRealm; - }, - - get viewClients() { - return getAccess(Auth, Current, 'view-clients') || getAccess(Auth, Current, 'manage-clients') || this.manageClients; - }, - - get viewUsers() { - return getAccess(Auth, Current, 'view-users') || getAccess(Auth, Current, 'manage-users') || this.manageClients; - }, - - get viewEvents() { - return getAccess(Auth, Current, 'view-events') || getAccess(Auth, Current, 'manage-events') || this.manageClients; - }, - - get viewIdentityProviders() { - return getAccess(Auth, Current, 'view-identity-providers') || getAccess(Auth, Current, 'manage-identity-providers') || this.manageIdentityProviders; - }, - - get viewAuthorization() { - return getAccess(Auth, Current, 'view-authorization') || this.manageAuthorization; - }, - - get manageRealm() { - return getAccess(Auth, Current, 'manage-realm'); - }, - - get manageClients() { - return getAccess(Auth, Current, 'manage-clients'); - }, - - get manageUsers() { - return getAccess(Auth, Current, 'manage-users'); - }, - - get manageEvents() { - return getAccess(Auth, Current, 'manage-events'); - }, - - get manageIdentityProviders() { - return getAccess(Auth, Current, 'manage-identity-providers'); - }, - - get manageAuthorization() { - return getAccess(Auth, Current, 'manage-authorization'); - }, - - get impersonation() { - return getAccess(Auth, Current, 'impersonation'); - } - }; -} - - -module.controller('GlobalCtrl', function($scope, $http, Auth, Current, $location, Notifications, ServerInfo, RealmSpecificLocalizationTexts) { - $scope.authUrl = authUrl; - $scope.resourceUrl = resourceUrl; - $scope.auth = Auth; - $scope.serverInfo = ServerInfo.get(); - - $scope.access = getAccessObject(Auth, Current); - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.fragment = $location.path(); - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.$watch(function() { - return Current.realm; - }, function() { - if(Current.realm !== null && currentRealm !== Current.realm.id) { - currentRealm = Current.realm.id; - translateProvider.translations(locale, resourceBundle); - RealmSpecificLocalizationTexts.get({id: Current.realm.realm, locale: locale, useRealmDefaultLocaleFallback:true}, function (localizationTexts) { - translateProvider.translations(locale, localizationTexts.toJSON()); - }) - } - }) -}); - -module.controller('HomeCtrl', function(Realm, Auth, Current, $location) { - - Realm.query(null, function(realms) { - var realm; - if (realms.length == 1) { - realm = realms[0]; - } else if (realms.length == 2) { - if (realms[0].realm == Auth.user.realm) { - realm = realms[1]; - } else if (realms[1].realm == Auth.user.realm) { - realm = realms[0]; - } - } - if (realm) { - Current.realms = realms; - Current.realm = realm; - var access = getAccessObject(Auth, Current); - if (access.viewRealm || access.manageRealm) { - $location.url('/realms/' + realm.realm ); - } else if (access.queryClients) { - $location.url('/realms/' + realm.realm + "/clients"); - } else if (access.viewIdentityProviders) { - $location.url('/realms/' + realm.realm + "/identity-provider-settings"); - } else if (access.queryUsers) { - $location.url('/realms/' + realm.realm + "/users"); - } else if (access.queryGroups) { - $location.url('/realms/' + realm.realm + "/groups"); - } else if (access.viewEvents) { - $location.url('/realms/' + realm.realm + "/events"); - } - } else { - $location.url('/realms'); - } - }); -}); - -module.controller('RealmTabCtrl', function(Dialog, $scope, Current, Realm, Notifications, $location) { - $scope.removeRealm = function() { - Dialog.confirmDelete(Current.realm.realm, 'realm', function() { - Realm.remove({ id : Current.realm.realm }, function() { - Current.realms = Realm.query(); - Notifications.success("The realm has been deleted."); - $location.url("/"); - }); - }); - }; -}); - -module.controller('ServerInfoCtrl', function($scope, ServerInfo) { - ServerInfo.reload(); - - $scope.serverInfo = ServerInfo.get(); - - $scope.$watch($scope.serverInfo, function() { - $scope.providers = []; - for(var spi in $scope.serverInfo.providers) { - var p = angular.copy($scope.serverInfo.providers[spi]); - p.name = spi; - $scope.providers.push(p) - } - }); - - $scope.serverInfoReload = function() { - ServerInfo.reload(); - } -}); - -module.controller('RealmListCtrl', function($scope, Realm, Current) { - $scope.realms = Realm.query(); - Current.realms = $scope.realms; -}); - -module.controller('RealmDropdownCtrl', function($scope, Realm, Current, Auth, $location) { -// Current.realms = Realm.get(); - $scope.current = Current; - - $scope.isCreateEndpoint = function(endpoint) { - return $scope.path.length > 1 && $scope.path[0] === 'create' && $scope.path[1] === endpoint; - } - - $scope.changeRealm = function(selectedRealm) { - $location.url("/realms/" + selectedRealm); - } -}); - -module.controller('RealmCreateCtrl', function($scope, Current, Realm, $upload, $http, $location, $route, Dialog, Notifications, Auth, $modal) { - console.log('RealmCreateCtrl'); - - Current.realm = null; - - $scope.realm = { - enabled: true - }; - - $scope.changed = false; - $scope.files = []; - - var oldCopy = angular.copy($scope.realm); - - $scope.importFile = function($fileContent){ - $scope.realm = angular.copy(JSON.parse($fileContent)); - $scope.importing = true; - }; - - $scope.viewImportDetails = function() { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/view-object.html', - controller: 'ObjectModalCtrl', - resolve: { - object: function () { - return $scope.realm; - } - } - }) - }; - - $scope.$watch('realm', function() { - if (!angular.equals($scope.realm, oldCopy)) { - $scope.changed = true; - } - }, true); - - $scope.$watch('realm.realm', function() { - $scope.realm.id = $scope.realm.realm; - }, true); - - $scope.save = function() { - var realmCopy = angular.copy($scope.realm); - Realm.create(realmCopy, function() { - Notifications.success("The realm has been created."); - - Auth.refreshPermissions(function() { - $scope.$apply(function() { - $location.url("/realms/" + realmCopy.realm); - }); - }); - }); - }; - - $scope.cancel = function() { - $location.url("/"); - }; - - $scope.reset = function() { - $route.reload(); - } -}); - -module.controller('ObjectModalCtrl', function($scope, object) { - $scope.object = object; -}); - -module.controller('RealmDetailCtrl', function($scope, Current, Realm, realm, serverInfo, $http, $location, $window, Dialog, Notifications, Auth) { - $scope.createRealm = !realm.realm; - $scope.serverInfo = serverInfo; - $scope.realmName = realm.realm; - $scope.disableRename = realm.realm == masterRealm; - $scope.authServerUrl = authServerUrl; - - if (Current.realm == null || Current.realm.realm != realm.realm) { - for (var i = 0; i < Current.realms.length; i++) { - if (realm.realm == Current.realms[i].realm) { - Current.realm = Current.realms[i]; - break; - } - } - } - for (var i = 0; i < Current.realms.length; i++) { - if (Current.realms[i].realm == realm.realm) { - Current.realm = Current.realms[i]; - } - } - $scope.realm = angular.copy(realm); - - if ($scope.realm.attributes != null) { - $scope.realm.attributes['userProfileEnabled'] = $scope.realm.attributes['userProfileEnabled'] == 'true'; - } - - var oldCopy = angular.copy($scope.realm); - $scope.realmCopy = oldCopy; - - $scope.changed = $scope.create; - - $scope.$watch('realm', function() { - if (!angular.equals($scope.realm, oldCopy)) { - $scope.changed = true; - } - }, true); - $scope.$watch('realmName', function() { - if (!angular.equals($scope.realmName, oldCopy.realm)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - var realmCopy = angular.copy($scope.realm); - realmCopy.realm = $scope.realmName; - $scope.changed = false; - var nameChanged = !angular.equals($scope.realmName, oldCopy.realm); - var oldName = oldCopy.realm; - Realm.update({ id : oldCopy.realm}, realmCopy, function () { - var data = Realm.query(function () { - Current.realms = data; - for (var i = 0; i < Current.realms.length; i++) { - if (Current.realms[i].realm == realmCopy.realm) { - Current.realm = Current.realms[i]; - oldCopy = angular.copy($scope.realm); - $scope.realmCopy = oldCopy; - } - } - }); - - if (nameChanged) { - console.debug(Auth); - console.debug(Auth.authz.tokenParsed.iss); - - if (Auth.authz.tokenParsed.iss.endsWith(masterRealm)) { - Auth.refreshPermissions(function () { - Auth.refreshPermissions(function () { - Notifications.success("Your changes have been saved to the realm."); - $scope.$apply(function () { - $location.url("/realms/" + realmCopy.realm); - }); - }); - }); - } else { - delete Auth.authz.token; - delete Auth.authz.refreshToken; - - var newLocation = $window.location.href.replace('/' + oldName + '/', '/' + realmCopy.realm + '/') - .replace('/realms/' + oldName, '/realms/' + realmCopy.realm); - window.location.replace(newLocation); - } - } else { - $location.url("/realms/" + realmCopy.realm); - Notifications.success("Your changes have been saved to the realm."); - } - }); - }; - - $scope.reset = function() { - $scope.realm = angular.copy(oldCopy); - $scope.changed = false; - }; - - $scope.cancel = function() { - window.history.back(); - }; -}); - -function genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications, url, saveCallback, resetCallback) { - $scope.realm = angular.copy(realm); - $scope.serverInfo = serverInfo; - $scope.registrationAllowed = $scope.realm.registrationAllowed; - - var oldCopy = angular.copy($scope.realm); - - $scope.changed = false; - - $scope.$watch('realm', function() { - if (!angular.equals($scope.realm, oldCopy)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - if (saveCallback) { - saveCallback(); - } - var realmCopy = angular.copy($scope.realm); - console.log('updating realm...'); - $scope.changed = false; - console.log('oldCopy.realm - ' + oldCopy.realm); - Realm.update({ id : oldCopy.realm}, realmCopy, function () { - $route.reload(); - Notifications.success("Your changes have been saved to the realm."); - $scope.registrationAllowed = $scope.realm.registrationAllowed; - }); - }; - - $scope.reset = function() { - $scope.realm = angular.copy(oldCopy); - if (resetCallback) { - resetCallback(); - } - $scope.changed = false; - }; - - $scope.cancel = function() { - $route.reload(); - }; - -} - -module.controller('DefenseHeadersCtrl', function($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications) { - genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications, "/realms/" + realm.realm + "/defense/headers"); -}); - -module.controller('RealmLoginSettingsCtrl', function($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications) { - // KEYCLOAK-5474: Make sure duplicateEmailsAllowed is disabled if loginWithEmailAllowed - $scope.$watch('realm.loginWithEmailAllowed', function() { - if ($scope.realm.loginWithEmailAllowed) { - $scope.realm.duplicateEmailsAllowed = false; - } - }); - - var resetCallback = function() { - try { - $scope.acrLoaMap = JSON.parse(realm.attributes["acr.loa.map"] || "{}"); - } catch (e) { - $scope.acrLoaMap = {}; - } - } - resetCallback(); - var previousNewAcr = undefined; - var previousNewLoa = undefined; - - $scope.$watch('newAcr', function() { - var changed = $scope.newAcr != previousNewAcr; - if (changed) { - previousNewAcr = $scope.newAcr; - $scope.changed = true; - } - }, true); - $scope.$watch('newLoa', function() { - var changed = $scope.newLoa != previousNewLoa; - if (changed) { - previousNewLoa = $scope.newLoa; - $scope.changed = true; - } - }, true); - $scope.deleteAcrLoaMapping = function(acr) { - delete $scope.acrLoaMap[acr]; - $scope.changed = true; - updateRealmAcrAttribute(); - } - $scope.checkAddAcrLoaMapping = function() { - if ($scope.newAcr && $scope.newAcr.length > 0 && $scope.newLoa && $scope.newLoa.length > 0 && $scope.newLoa.match(/^[0-9]+$/)) { - console.log("Adding acrLoaMapping: " + $scope.newLoa + " : " + $scope.newAcr); - $scope.acrLoaMap[$scope.newAcr] = $scope.newLoa; - $scope.newAcr = $scope.newLoa = ""; - $scope.changed = true; - updateRealmAcrAttribute(); - } - } - - function updateRealmAcrAttribute() { - var acrLoaMapStr = JSON.stringify($scope.acrLoaMap); - console.log("Updating realm acr.loa.map attribute: " + acrLoaMapStr); - $scope.realm.attributes["acr.loa.map"] = acrLoaMapStr; - } - - genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications, "/realms/" + realm.realm + "/login-settings", $scope.checkAddAcrLoaMapping, resetCallback); -}); - -module.controller('RealmOtpPolicyCtrl', function($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications) { - $scope.optionsDigits = [ 6, 8 ]; - - genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications, "/realms/" + realm.realm + "/authentication/otp-policy"); -}); - -module.controller('RealmWebAuthnPolicyCtrl', function ($scope, Current, Realm, realm, serverInfo, $http, $route, $location, Dialog, Notifications) { - - $scope.deleteAcceptableAaguid = function(index) { - $scope.realm.webAuthnPolicyAcceptableAaguids.splice(index, 1); - }; - - $scope.addAcceptableAaguid = function() { - $scope.realm.webAuthnPolicyAcceptableAaguids.push($scope.newAcceptableAaguid); - $scope.newAcceptableAaguid = ""; - }; - - // Just for case the user fill particular URL with disabled WebAuthn feature. - $scope.redirectIfWebAuthnDisabled = function () { - if (!serverInfo.featureEnabled('WEB_AUTHN')) { - $location.url("/realms/" + $scope.realm.realm + "/authentication"); - } - }; - - genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications, "/realms/" + realm.realm + "/authentication/webauthn-policy"); -}); - -module.controller('RealmWebAuthnPasswordlessPolicyCtrl', function ($scope, Current, Realm, realm, serverInfo, $http, $route, $location, Dialog, Notifications) { - - $scope.deleteAcceptableAaguid = function(index) { - $scope.realm.webAuthnPolicyPasswordlessAcceptableAaguids.splice(index, 1); - }; - - $scope.addAcceptableAaguid = function() { - $scope.realm.webAuthnPolicyPasswordlessAcceptableAaguids.push($scope.newAcceptableAaguid); - $scope.newAcceptableAaguid = ""; - }; - - // Just for case the user fill particular URL with disabled WebAuthn feature. - $scope.redirectIfWebAuthnDisabled = function () { - if (!serverInfo.featureEnabled('WEB_AUTHN')) { - $location.url("/realms/" + $scope.realm.realm + "/authentication"); - } - }; - - genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications, "/realms/" + realm.realm + "/authentication/webauthn-policy-passwordless"); -}); - -module.controller('RealmCibaPolicyCtrl', function ($scope, Current, Realm, realm, serverInfo, $http, $route, $location, Dialog, Notifications) { - - genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications, "/realms/" + realm.realm + "/authentication/ciba-policy"); -}); - -module.controller('RealmThemeCtrl', function($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications) { - genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications, "/realms/" + realm.realm + "/theme-settings"); - - $scope.supportedLocalesOptions = { - 'multiple' : true, - 'simple_tags' : true, - 'tags' : [] - }; - - updateSupported(); - - function localeForTheme(type, name) { - name = name || 'base'; - for (var i = 0; i < serverInfo.themes[type].length; i++) { - if (serverInfo.themes[type][i].name == name) { - return serverInfo.themes[type][i].locales || []; - } - } - return []; - } - - function updateSupported() { - if ($scope.realm.internationalizationEnabled) { - var accountLocales = localeForTheme('account', $scope.realm.accountTheme); - var loginLocales = localeForTheme('login', $scope.realm.loginTheme); - var emailLocales = localeForTheme('email', $scope.realm.emailTheme); - - var supportedLocales = []; - for (var i = 0; i < accountLocales.length; i++) { - var l = accountLocales[i]; - if (loginLocales.indexOf(l) >= 0 && emailLocales.indexOf(l) >= 0) { - supportedLocales.push(l); - } - } - - $scope.supportedLocalesOptions.tags = supportedLocales; - - if (!$scope.realm.supportedLocales) { - $scope.realm.supportedLocales = supportedLocales; - } else { - for (var i = 0; i < $scope.realm.supportedLocales.length; i++) { - if (supportedLocales.indexOf($scope.realm.supportedLocales[i]) == -1) { - $scope.realm.supportedLocales = supportedLocales; - } - } - } - - if (!$scope.realm.defaultLocale || supportedLocales.indexOf($scope.realm.defaultLocale) == -1) { - $scope.realm.defaultLocale = 'en'; - } - } - } - - $scope.$watch('realm.loginTheme', updateSupported); - $scope.$watch('realm.accountTheme', updateSupported); - $scope.$watch('realm.emailTheme', updateSupported); - $scope.$watch('realm.internationalizationEnabled', updateSupported); -}); - -module.controller('RealmLocalizationCtrl', function($scope, Current, $location, Realm, realm, serverInfo, Notifications, RealmSpecificLocales, realmSpecificLocales, RealmSpecificLocalizationTexts, RealmSpecificLocalizationText, Dialog, $translate){ - $scope.realm = realm; - $scope.realmSpecificLocales = realmSpecificLocales; - $scope.newLocale = null; - $scope.selectedRealmSpecificLocales = null; - $scope.localizationTexts = null; - - $scope.createLocale = function() { - if(!$scope.newLocale) { - Notifications.error($translate.instant('missing-locale')); - return; - } - $scope.realmSpecificLocales.push($scope.newLocale) - $scope.selectedRealmSpecificLocales = $scope.newLocale; - $scope.newLocale = null; - $location.url('/create/localization/' + realm.realm + '/' + $scope.selectedRealmSpecificLocales); - } - - $scope.$watch(function() { - return $scope.selectedRealmSpecificLocales; - }, function() { - if($scope.selectedRealmSpecificLocales != null) { - $scope.updateRealmSpecificLocalizationTexts(); - } - }) - - $scope.updateRealmSpecificLocales = function() { - RealmSpecificLocales.get({id: realm.realm}, function (updated) { - $scope.realmSpecificLocales = updated; - }) - } - - $scope.updateRealmSpecificLocalizationTexts = function() { - RealmSpecificLocalizationTexts.get({id: realm.realm, locale: $scope.selectedRealmSpecificLocales }, function (updated) { - $scope.localizationTexts = getSortedArrayByKeyFromObject(updated); - }) - } - - function getSortedArrayByKeyFromObject(object) { - const keys = Object.keys(object).sort(function (a, b) { - return a.localeCompare(b, locale); - }); - return keys.reduce(function (result, key) { - const value = object[key]; - if (typeof value !== 'string') { - return result; - } - return result.concat([[key, value]]); - }, []); - } - - $scope.removeLocalizationText = function(key) { - Dialog.confirmDelete(key, 'localization text', function() { - RealmSpecificLocalizationText.remove({ - realm: realm.realm, - locale: $scope.selectedRealmSpecificLocales, - key: key - }, function () { - $scope.updateRealmSpecificLocalizationTexts(); - Notifications.success($translate.instant('localization-text.remove.success')); - }); - }); - } -}); - -module.controller('RealmLocalizationUploadCtrl', function($scope, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications, $upload, $translate){ - $scope.realm = realm; - $scope.locale = null; - $scope.files = []; - - $scope.onFileSelect = function($files) { - $scope.files = $files; - }; - - $scope.reset = function() { - $scope.locale = null; - $scope.files = null; - }; - - $scope.save = function() { - - if(!$scope.files || $scope.files.length === 0) { - Notifications.error($translate.instant('missing-file')); - return; - } - //$files: an array of files selected, each file has name, size, and type. - for (var i = 0; i < $scope.files.length; i++) { - var $file = $scope.files[i]; - $scope.upload = $upload.upload({ - url: authUrl + '/admin/realms/' + realm.realm + '/localization/' + $scope.locale, - file: $file - }).then(function(response) { - $scope.reset(); - Notifications.success($translate.instant('localization-file.upload.success')); - }).catch(function() { - Notifications.error($translate.instant('localization-file.upload.error')); - }); - } - }; - -}); - -module.controller('RealmLocalizationDetailCtrl', function($scope, Current, $location, Realm, realm, Notifications, locale, key, RealmSpecificLocalizationText, localizationText, $translate){ - $scope.realm = realm; - $scope.locale = locale; - $scope.key = key; - $scope.value = ((localizationText)? localizationText.content : null); - - $scope.create = !key; - - $scope.save = function() { - if ($scope.create) { - RealmSpecificLocalizationText.save({ - realm: realm.realm, - locale: $scope.locale, - key: $scope.key - }, $scope.value, function (data, headers) { - $location.url("/realms/" + realm.realm + "/localization"); - Notifications.success($translate.instant('localization-text.create.success')); - }); - } else { - RealmSpecificLocalizationText.save({ - realm: realm.realm, - locale: $scope.locale, - key: $scope.key - }, $scope.value, function (data, headers) { - $location.url("/realms/" + realm.realm + "/localization"); - Notifications.success($translate.instant('localization-text.update.success')); - }); - } - }; - - $scope.cancel = function () { - $location.url("/realms/" + realm.realm + "/localization"); - }; - -}); - -module.controller('RealmCacheCtrl', function($scope, realm, RealmClearUserCache, RealmClearRealmCache, RealmClearKeysCache, Notifications) { - $scope.realm = angular.copy(realm); - - $scope.clearUserCache = function() { - RealmClearUserCache.save({ realm: realm.realm}, function () { - Notifications.success("User cache cleared"); - }); - } - - $scope.clearRealmCache = function() { - RealmClearRealmCache.save({ realm: realm.realm}, function () { - Notifications.success("Realm cache cleared"); - }); - } - - $scope.clearKeysCache = function() { - RealmClearKeysCache.save({ realm: realm.realm}, function () { - Notifications.success("Public keys cache cleared"); - }); - } - - -}); - -module.controller('RealmPasswordPolicyCtrl', function($scope, Realm, realm, $http, $location, $route, Dialog, Notifications, serverInfo) { - var parse = function(policyString) { - var policies = []; - if (!policyString || policyString.length == 0){ - return policies; - } - - var policyArray = policyString.split(" and "); - - for (var i = 0; i < policyArray.length; i ++){ - var policyToken = policyArray[i]; - var id; - var value; - if (policyToken.indexOf('(') == -1) { - id = policyToken.trim(); - value = null; - } else { - id = policyToken.substring(0, policyToken.indexOf('(')); - value = policyToken.substring(policyToken.indexOf('(') + 1, policyToken.lastIndexOf(')')).trim(); - } - - for (var j = 0; j < serverInfo.passwordPolicies.length; j++) { - if (serverInfo.passwordPolicies[j].id == id) { - // clone - var p = JSON.parse(JSON.stringify(serverInfo.passwordPolicies[j])); - - p.value = value && value || p.defaultValue; - policies.push(p); - } - } - } - return policies; - }; - - var toString = function(policies) { - if (!policies || policies.length == 0) { - return ""; - } - var policyString = ""; - for (var i = 0; i < policies.length; i++) { - policyString += policies[i].id + '(' + policies[i].value + ')'; - if (i != policies.length - 1) { - policyString += ' and '; - } - } - return policyString; - } - - $scope.realm = realm; - $scope.serverInfo = serverInfo; - - $scope.changed = false; - console.log(JSON.stringify(parse(realm.passwordPolicy))); - $scope.policy = parse(realm.passwordPolicy); - var oldCopy = angular.copy($scope.policy); - - $scope.$watch('policy', function() { - $scope.changed = ! angular.equals($scope.policy, oldCopy); - }, true); - - $scope.addPolicy = function(policy){ - policy.value = policy.defaultValue; - if (!$scope.policy) { - $scope.policy = []; - } - $scope.policy.push(policy); - } - - $scope.removePolicy = function(index){ - $scope.policy.splice(index, 1); - } - - $scope.save = function() { - $scope.realm.passwordPolicy = toString($scope.policy); - console.log($scope.realm.passwordPolicy); - - Realm.update($scope.realm, function () { - $route.reload(); - Notifications.success("Your changes have been saved to the realm."); - }); - }; - - $scope.reset = function() { - $route.reload(); - }; -}); - -module.controller('RealmDefaultRolesCtrl', function ($scope, $route, realm, roles, Notifications, ClientRole, Client, RoleRealmComposites, RoleClientComposites, ComponentUtils, $http) { - - console.log('RealmDefaultRolesCtrl'); - - $scope.realm = realm; - $scope.availableRealmRoles = angular.copy(roles); - $scope.selectedRealmRoles = []; - $scope.selectedRealmDefRoles = []; - - $scope.availableClientRoles = []; - $scope.selectedClientRoles = []; - $scope.selectedClientDefRoles = []; - - for (var j = 0; j < $scope.availableRealmRoles.length; j++) { - if ($scope.availableRealmRoles[j].id === realm.defaultRole.id) { - var realmRole = $scope.availableRealmRoles[j]; - var idx = $scope.availableRealmRoles.indexOf(realmRole); - $scope.availableRealmRoles.splice(idx, 1); - break; - } - } - - $scope.realmMappings = RoleRealmComposites.query({realm : realm.realm, role : realm.defaultRole.id}, function(){ - for (var i = 0; i < $scope.realmMappings.length; i++) { - var role = $scope.realmMappings[i]; - for (var j = 0; j < $scope.availableRealmRoles.length; j++) { - var realmRole = $scope.availableRealmRoles[j]; - if (realmRole.id === role.id) { - var idx = $scope.availableRealmRoles.indexOf(realmRole); - if (idx !== -1) { - $scope.availableRealmRoles.splice(idx, 1); - break; - } - } - } - } - }); - - $scope.addRealmDefaultRole = function () { - - $scope.selectedRealmRolesToAdd = JSON.parse('[' + $scope.selectedRealmRoles + ']'); - $http.post(authUrl + '/admin/realms/' + realm.realm + '/roles-by-id/' + realm.defaultRole.id + '/composites', - $scope.selectedRealmRolesToAdd).then(function() { - // Remove selected roles from the Available roles and add them to realm default roles (move from left to right). - for (var i = 0; i < $scope.selectedRealmRolesToAdd.length; i++) { - var selectedRole = $scope.selectedRealmRolesToAdd[i]; - var index = ComponentUtils.findIndexById($scope.availableRealmRoles, selectedRole.id); - if (index > -1) { - $scope.availableRealmRoles.splice(index, 1); - $scope.realmMappings.push(selectedRole); - } - } - - $scope.selectedRealmRoles = []; - $scope.selectedRealmRolesToAdd = []; - Notifications.success("Default roles updated."); - }); - }; - - $scope.deleteRealmDefaultRole = function () { - - $scope.selectedClientRolesToRemove = JSON.parse('[' + $scope.selectedRealmDefRoles + ']'); - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/roles-by-id/' + realm.defaultRole.id + '/composites', - {data : $scope.selectedClientRolesToRemove, headers : {"content-type" : "application/json"}}).then(function() { - // Remove selected roles from the realm default roles and add them to available roles (move from right to left). - for (var i = 0; i < $scope.selectedClientRolesToRemove.length; i++) { - var selectedRole = $scope.selectedClientRolesToRemove[i]; - var index = ComponentUtils.findIndexById($scope.realmMappings, selectedRole.id); - if (index > -1) { - $scope.realmMappings.splice(index, 1); - $scope.availableRealmRoles.push(selectedRole); - } - } - - $scope.selectedRealmDefRoles = []; - $scope.selectedClientRolesToRemove = []; - Notifications.success("Default roles updated."); - }); - }; - - $scope.changeClient = function (client) { - if (!client || !client.id) { - $scope.selectedClient = null; - return; - } - $scope.selectedClient = client; - $scope.selectedClientRoles = []; - $scope.selectedClientDefRoles = []; - - // Populate available roles for selected client - if ($scope.selectedClient) { - $scope.availableClientRoles = ClientRole.query({realm: realm.realm, client: client.id}, function () { - $scope.clientMappings = RoleClientComposites.query({realm : realm.realm, role : realm.defaultRole.id, client : client.id}, function(){ - for (var i = 0; i < $scope.clientMappings.length; i++) { - var role = $scope.clientMappings[i]; - for (var j = 0; j < $scope.availableClientRoles.length; j++) { - var clientRole = $scope.availableClientRoles[j]; - if (clientRole.id === role.id) { - var idx = $scope.availableClientRoles.indexOf(clientRole); - if (idx !== -1) { - $scope.availableClientRoles.splice(idx, 1); - break; - } - } - } - } - }); - for (var j = 0; j < $scope.availableClientRoles.length; j++) { - if ($scope.availableClientRoles[j] === realm.defaultRole.id) { - var clientRole = $scope.availableClientRoles[j]; - var idx = $scope.availableClientRoles.indexof(clientRole); - $scope.availableClientRoles.splice(idx, 1); - break; - } - } - }); - } else { - $scope.availableClientRoles = null; - } - }; - - $scope.addClientDefaultRole = function () { - - $scope.selectedClientRolesToAdd = JSON.parse('[' + $scope.selectedClientRoles + ']'); - $http.post(authUrl + '/admin/realms/' + realm.realm + '/roles-by-id/' + realm.defaultRole.id + '/composites', - $scope.selectedClientRolesToAdd).then(function() { - // Remove selected roles from the app available roles and add them to app default roles (move from left to right). - for (var i = 0; i < $scope.selectedClientRolesToAdd.length; i++) { - var selectedRole = $scope.selectedClientRolesToAdd[i]; - - var index = ComponentUtils.findIndexById($scope.availableClientRoles, selectedRole.id); - if (index > -1) { - $scope.availableClientRoles.splice(index, 1); - $scope.clientMappings.push(selectedRole); - } - } - - $scope.selectedClientRoles = []; - $scope.selectedClientRolesToAdd = []; - Notifications.success("Default roles updated."); - }); - }; - - $scope.rmClientDefaultRole = function () { - - $scope.selectedClientRolesToRemove = JSON.parse('[' + $scope.selectedClientDefRoles + ']'); - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/roles-by-id/' + realm.defaultRole.id + '/composites', - {data : $scope.selectedClientRolesToRemove, headers : {"content-type" : "application/json"}}).then(function() { - // Remove selected roles from the realm default roles and add them to available roles (move from right to left). - for (var i = 0; i < $scope.selectedClientRolesToRemove.length; i++) { - var selectedRole = $scope.selectedClientRolesToRemove[i]; - var index = ComponentUtils.findIndexById($scope.clientMappings, selectedRole.id); - if (index > -1) { - $scope.clientMappings.splice(index, 1); - $scope.availableClientRoles.push(selectedRole); - } - } - - $scope.selectedClientDefRoles = []; - $scope.selectedClientRolesToRemove = []; - Notifications.success("Default roles updated."); - }); - }; - - clientSelectControl($scope, $route.current.params.realm, Client); -}); - - - -module.controller('IdentityProviderTabCtrl', function(Dialog, $scope, Current, Notifications, $location) { - $scope.removeIdentityProvider = function() { - Dialog.confirmDelete($scope.identityProvider.alias, 'provider', function() { - $scope.identityProvider.$remove({ - realm : Current.realm.realm, - alias : $scope.identityProvider.alias - }, function() { - $location.url("/realms/" + Current.realm.realm + "/identity-provider-settings"); - Notifications.success("The identity provider has been deleted."); - }); - }); - }; -}); - -module.controller('RealmIdentityProviderCtrl', function($scope, $filter, $upload, $http, $route, realm, instance, providerFactory, IdentityProvider, serverInfo, authFlows, $location, Notifications, Dialog) { - $scope.realm = angular.copy(realm); - - $scope.initSamlProvider = function() { - $scope.nameIdFormats = [ - { - format: "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", - name: "Persistent" - - }, - { - format: "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", - name: "Transient" - }, - { - format: "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", - name: "Email" - - }, - { - format: "urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos", - name: "Kerberos" - - }, - { - format: "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName", - name: "X.509 Subject Name" - - }, - { - format: "urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName", - name: "Windows Domain Qualified Name" - - }, - { - format: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", - name: "Unspecified" - - } - ]; - $scope.signatureAlgorithms = [ - "RSA_SHA1", - "RSA_SHA256", - "RSA_SHA256_MGF1", - "RSA_SHA512", - "RSA_SHA512_MGF1", - "DSA_SHA1" - ]; - $scope.xmlKeyNameTranformers = [ - "NONE", - "KEY_ID", - "CERT_SUBJECT" - ]; - $scope.principalTypes = [ - { - type: "SUBJECT", - name: "Subject NameID" - - }, - { - type: "ATTRIBUTE", - name: "Attribute [Name]" - - }, - { - type: "FRIENDLY_ATTRIBUTE", - name: "Attribute [Friendly Name]" - - } - ]; - if (instance && instance.alias) { - - } else { - $scope.identityProvider.config.nameIDPolicyFormat = $scope.nameIdFormats[0].format; - $scope.identityProvider.config.principalType = $scope.principalTypes[0].type; - $scope.identityProvider.config.signatureAlgorithm = $scope.signatureAlgorithms[1]; - $scope.identityProvider.config.xmlSigKeyInfoKeyNameTransformer = $scope.xmlKeyNameTranformers[1]; - $scope.identityProvider.config.allowCreate = 'true'; - } - $scope.identityProvider.config.entityId = $scope.identityProvider.config.entityId || (authUrl + '/realms/' + realm.realm); - } - - $scope.hidePassword = true; - $scope.fromUrl = { - data: '' - }; - - if (instance && instance.alias) { - $scope.identityProvider = angular.copy(instance); - $scope.newIdentityProvider = false; - for (var i in serverInfo.identityProviders) { - var provider = serverInfo.identityProviders[i]; - - if (provider.id == instance.providerId) { - $scope.provider = provider; - } - } - } else { - $scope.identityProvider = {}; - $scope.identityProvider.config = {}; - $scope.identityProvider.alias = providerFactory.id; - $scope.identityProvider.providerId = providerFactory.id; - - $scope.identityProvider.enabled = true; - $scope.identityProvider.authenticateByDefault = false; - $scope.identityProvider.firstBrokerLoginFlowAlias = 'first broker login'; - $scope.identityProvider.config.useJwksUrl = 'true'; - $scope.identityProvider.config.syncMode = 'IMPORT'; - $scope.newIdentityProvider = true; - } - - $scope.changed = $scope.newIdentityProvider; - - $scope.$watch('identityProvider', function() { - if (!angular.equals($scope.identityProvider, instance)) { - $scope.changed = true; - } - }, true); - - - $scope.serverInfo = serverInfo; - - $scope.allProviders = angular.copy(serverInfo.identityProviders); - - $scope.configuredProviders = angular.copy(realm.identityProviders); - - removeUsedSocial(); - - $scope.authFlows = []; - for (var i=0 ; i 0) { - $scope.importUrl = true; - } else{ - $scope.importUrl = false; - } - }); - - $scope.$watch('configuredProviders', function(configuredProviders) { - if (configuredProviders) { - $scope.configuredProviders = angular.copy(configuredProviders); - - for (var j = 0; j < configuredProviders.length; j++) { - var configProvidedId = configuredProviders[j].providerId; - - for (var i in $scope.allProviders) { - var provider = $scope.allProviders[i]; - if (provider.id == configProvidedId) { - configuredProviders[j].provider = provider; - } - } - } - $scope.configuredProviders = angular.copy(configuredProviders); - } - }, true); - - $scope.callbackUrl = authServerUrl + "/realms/" + realm.realm + "/broker/"; - - $scope.addProvider = function(provider) { - $location.url("/create/identity-provider/" + realm.realm + "/" + provider.id); - }; - - $scope.save = function() { - if ($scope.newIdentityProvider) { - if (!$scope.identityProvider.alias) { - Notifications.error("You must specify an alias"); - return; - } - IdentityProvider.save({ - realm: $scope.realm.realm, alias: '' - }, $scope.identityProvider, function () { - $location.url("/realms/" + realm.realm + "/identity-provider-settings/provider/" + $scope.identityProvider.providerId + "/" + $scope.identityProvider.alias); - Notifications.success("The " + $scope.identityProvider.alias + " provider has been created."); - }); - } else { - IdentityProvider.update({ - realm: $scope.realm.realm, - alias: $scope.identityProvider.alias - }, $scope.identityProvider, function () { - $route.reload(); - Notifications.success("The " + $scope.identityProvider.alias + " provider has been updated."); - }); - } - }; - - $scope.cancel = function() { - if ($scope.newIdentityProvider) { - $location.url("/realms/" + realm.realm + "/identity-provider-settings"); - } else { - $route.reload(); - } - }; - - - $scope.reset = function() { - $scope.identityProvider = {}; - $scope.configuredProviders = angular.copy($scope.realm.identityProviders); - }; - - $scope.showPassword = function(flag) { - $scope.hidePassword = flag; - }; - - $scope.removeIdentityProvider = function(identityProvider) { - Dialog.confirmDelete(identityProvider.alias, 'provider', function() { - IdentityProvider.remove({ - realm : realm.realm, - alias : identityProvider.alias - }, function() { - $route.reload(); - Notifications.success("The identity provider has been deleted."); - }); - }); - }; - - // KEYCLOAK-5932: remove social providers that have already been defined - function removeUsedSocial() { - var i = $scope.allProviders.length; - while (i--) { - if ($scope.allProviders[i].groupName !== 'Social') continue; - if ($scope.configuredProviders != null) { - for (var j = 0; j < $scope.configuredProviders.length; j++) { - if ($scope.configuredProviders[j].providerId === $scope.allProviders[i].id) { - $scope.allProviders.splice(i, 1); - break; - } - } - } - } - }; - - if (instance && instance.alias) { - try { $scope.authnContextClassRefs = JSON.parse($scope.identityProvider.config.authnContextClassRefs || '[]'); } catch (e) { $scope.authnContextClassRefs = []; } - try { $scope.authnContextDeclRefs = JSON.parse($scope.identityProvider.config.authnContextDeclRefs || '[]'); } catch (e) { $scope.authnContextDeclRefs = []; } - } else { - $scope.authnContextClassRefs = []; - $scope.authnContextDeclRefs = []; - } - - $scope.deleteAuthnContextClassRef = function(index) { - $scope.authnContextClassRefs.splice(index, 1); - $scope.identityProvider.config.authnContextClassRefs = JSON.stringify($scope.authnContextClassRefs); - }; - - $scope.addAuthnContextClassRef = function() { - $scope.authnContextClassRefs.push($scope.newAuthnContextClassRef); - $scope.identityProvider.config.authnContextClassRefs = JSON.stringify($scope.authnContextClassRefs); - $scope.newAuthnContextClassRef = ""; - }; - - $scope.deleteAuthnContextDeclRef = function(index) { - $scope.authnContextDeclRefs.splice(index, 1); - $scope.identityProvider.config.authnContextDeclRefs = JSON.stringify($scope.authnContextDeclRefs); - }; - - $scope.addAuthnContextDeclRef = function() { - $scope.authnContextDeclRefs.push($scope.newAuthnContextDeclRef); - $scope.identityProvider.config.authnContextDeclRefs = JSON.stringify($scope.authnContextDeclRefs); - $scope.newAuthnContextDeclRef = ""; - }; -}); - -module.controller('RealmTokenDetailCtrl', function($scope, Realm, realm, $http, $location, $route, Dialog, Notifications, TimeUnit, TimeUnit2, serverInfo) { - $scope.realm = realm; - $scope.serverInfo = serverInfo; - $scope.actionTokenProviders = $scope.serverInfo.providers.actionTokenHandler.providers; - - $scope.realm.accessTokenLifespan = TimeUnit2.asUnit(realm.accessTokenLifespan); - $scope.realm.accessTokenLifespanForImplicitFlow = TimeUnit2.asUnit(realm.accessTokenLifespanForImplicitFlow); - $scope.realm.ssoSessionIdleTimeout = TimeUnit2.asUnit(realm.ssoSessionIdleTimeout); - $scope.realm.ssoSessionMaxLifespan = TimeUnit2.asUnit(realm.ssoSessionMaxLifespan); - $scope.realm.ssoSessionIdleTimeoutRememberMe = TimeUnit2.asUnit(realm.ssoSessionIdleTimeoutRememberMe); - $scope.realm.ssoSessionMaxLifespanRememberMe = TimeUnit2.asUnit(realm.ssoSessionMaxLifespanRememberMe); - $scope.realm.offlineSessionIdleTimeout = TimeUnit2.asUnit(realm.offlineSessionIdleTimeout); - // KEYCLOAK-7688 Offline Session Max for Offline Token - $scope.realm.offlineSessionMaxLifespan = TimeUnit2.asUnit(realm.offlineSessionMaxLifespan); - $scope.realm.clientSessionIdleTimeout = TimeUnit2.asUnit(realm.clientSessionIdleTimeout); - $scope.realm.clientSessionMaxLifespan = TimeUnit2.asUnit(realm.clientSessionMaxLifespan); - $scope.realm.clientOfflineSessionIdleTimeout = TimeUnit2.asUnit(realm.clientOfflineSessionIdleTimeout); - $scope.realm.clientOfflineSessionMaxLifespan = TimeUnit2.asUnit(realm.clientOfflineSessionMaxLifespan); - $scope.realm.accessCodeLifespan = TimeUnit2.asUnit(realm.accessCodeLifespan); - $scope.realm.accessCodeLifespanLogin = TimeUnit2.asUnit(realm.accessCodeLifespanLogin); - $scope.realm.accessCodeLifespanUserAction = TimeUnit2.asUnit(realm.accessCodeLifespanUserAction); - $scope.realm.actionTokenGeneratedByAdminLifespan = TimeUnit2.asUnit(realm.actionTokenGeneratedByAdminLifespan); - $scope.realm.actionTokenGeneratedByUserLifespan = TimeUnit2.asUnit(realm.actionTokenGeneratedByUserLifespan); - $scope.realm.oauth2DeviceCodeLifespan = TimeUnit2.asUnit(realm.oauth2DeviceCodeLifespan); - $scope.realm.attributes.parRequestUriLifespan = TimeUnit2.asUnit(realm.attributes.parRequestUriLifespan); - $scope.realm.attributes = realm.attributes; - - var oldCopy = angular.copy($scope.realm); - $scope.changed = false; - - $scope.$watch('realm', function() { - if (!angular.equals($scope.realm, oldCopy)) { - $scope.changed = true; - } - }, true); - - $scope.$watch('actionLifespanId', function () { - // changedActionLifespanId signals other watchers that we were merely - // changing the dropdown and we should not enable 'save' button - if ($scope.actionTokenAttribute && $scope.actionTokenAttribute.hasOwnProperty('time')) { - $scope.changedActionLifespanId = true; - } - - $scope.actionTokenAttribute = TimeUnit2.asUnit($scope.realm.attributes['actionTokenGeneratedByUserLifespan.' + $scope.actionLifespanId]); - }, true); - - $scope.$watch('actionTokenAttribute', function () { - if ($scope.actionLifespanId === null) return; - - if ($scope.changedActionLifespanId) { - $scope.changedActionLifespanId = false; - return; - } else { - $scope.changed = true; - } - - if ($scope.actionTokenAttribute !== null) { - $scope.realm.attributes['actionTokenGeneratedByUserLifespan.' + $scope.actionLifespanId] = $scope.actionTokenAttribute.toSeconds(); - } - }, true); - - $scope.changeRevokeRefreshToken = function() { - - }; - - $scope.save = function() { - $scope.realm.accessTokenLifespan = $scope.realm.accessTokenLifespan.toSeconds(); - $scope.realm.accessTokenLifespanForImplicitFlow = $scope.realm.accessTokenLifespanForImplicitFlow.toSeconds(); - $scope.realm.ssoSessionIdleTimeout = $scope.realm.ssoSessionIdleTimeout.toSeconds(); - $scope.realm.ssoSessionMaxLifespan = $scope.realm.ssoSessionMaxLifespan.toSeconds(); - $scope.realm.ssoSessionIdleTimeoutRememberMe = $scope.realm.ssoSessionIdleTimeoutRememberMe.toSeconds(); - $scope.realm.ssoSessionMaxLifespanRememberMe = $scope.realm.ssoSessionMaxLifespanRememberMe.toSeconds(); - $scope.realm.offlineSessionIdleTimeout = $scope.realm.offlineSessionIdleTimeout.toSeconds(); - // KEYCLOAK-7688 Offline Session Max for Offline Token - $scope.realm.offlineSessionMaxLifespan = $scope.realm.offlineSessionMaxLifespan.toSeconds(); - $scope.realm.clientSessionIdleTimeout = $scope.realm.clientSessionIdleTimeout.toSeconds(); - $scope.realm.clientSessionMaxLifespan = $scope.realm.clientSessionMaxLifespan.toSeconds(); - $scope.realm.clientOfflineSessionIdleTimeout = $scope.realm.clientOfflineSessionIdleTimeout.toSeconds(); - $scope.realm.clientOfflineSessionMaxLifespan = $scope.realm.clientOfflineSessionMaxLifespan.toSeconds(); - $scope.realm.accessCodeLifespan = $scope.realm.accessCodeLifespan.toSeconds(); - $scope.realm.accessCodeLifespanUserAction = $scope.realm.accessCodeLifespanUserAction.toSeconds(); - $scope.realm.accessCodeLifespanLogin = $scope.realm.accessCodeLifespanLogin.toSeconds(); - $scope.realm.actionTokenGeneratedByAdminLifespan = $scope.realm.actionTokenGeneratedByAdminLifespan.toSeconds(); - $scope.realm.actionTokenGeneratedByUserLifespan = $scope.realm.actionTokenGeneratedByUserLifespan.toSeconds(); - $scope.realm.oauth2DeviceCodeLifespan = $scope.realm.oauth2DeviceCodeLifespan.toSeconds(); - $scope.realm.attributes.parRequestUriLifespan = $scope.realm.attributes.parRequestUriLifespan.toSeconds(); - - Realm.update($scope.realm, function () { - $route.reload(); - Notifications.success("The changes have been saved to the realm."); - }); - }; - - $scope.resetToDefaultToken = function (actionTokenId) { - $scope.actionTokenAttribute = {}; - delete $scope.realm.attributes['actionTokenGeneratedByUserLifespan.' + $scope.actionLifespanId]; - //Only for UI effects, resets to the original state - $scope.actionTokenAttribute.unit = 'Minutes'; - } - - $scope.reset = function() { - $route.reload(); - }; -}); - -module.controller('RealmUserProfileCtrl', function($scope, Realm, realm, clientScopes, $http, $location, $route, UserProfile, Dialog, Notifications, serverInfo) { - $scope.realm = realm; - $scope.validatorProviders = serverInfo.componentTypes['org.keycloak.validate.Validator']; - - $scope.isShowAttributes = true; - $scope.isShowAttributeGroups = false; - $scope.isShowJsonEditor = false; - - UserProfile.get({realm: realm.realm}, function(config) { - $scope.config = config; - $scope.rawConfig = angular.toJson(config, true); - }); - - $scope.isShowAttributes = true; - $scope.isShowAttributeGroups = false; - $scope.isShowJsonEditor = false; - - $scope.showAttributes = function() { - $route.reload(); - delete $scope.currentAttributeGroup; - } - - $scope.showAttributeGroups = function() { - $scope.isShowAttributes = false; - $scope.isShowAttributeGroups = true; - $scope.isShowJsonEditor = false; - delete $scope.currentAttribute; - } - - $scope.showJsonEditor = function() { - $scope.isShowAttributes = false; - $scope.isShowAttributeGroups = false; - $scope.isShowJsonEditor = true; - delete $scope.currentAttribute; - delete $scope.currentAttributeGroup; - } - - $scope.isRequiredRoles = { - minimumInputLength: 0, - delay: 500, - allowClear: true, - id: function(e) { return e; }, - query: function (query) { - var expectedRoles = ['user', 'admin']; - var roles = []; - - if ('' == query.term.trim()) { - roles = expectedRoles; - } else { - for (var i = 0; i < expectedRoles.length; i++) { - if (expectedRoles[i].indexOf(query.term.trim()) != -1) { - roles.push(expectedRoles[i]); - } - } - } - - query.callback({results: roles}); - }, - formatResult: function(object, container, query) { - return object; - }, - formatSelection: function(object, container, query) { - return object; - } - }; - - $scope.isRequiredScopes = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - var scopes = []; - - if ('' == query.term.trim()) { - scopes = clientScopes; - } else { - for (var i = 0; i < clientScopes.length; i++) { - if (clientScopes[i].name.indexOf(query.term.trim()) != -1) { - scopes.push(clientScopes[i]); - } - } - } - - query.callback({results: scopes}); - }, - formatResult: function(object, container, query) { - return object.name; - }, - formatSelection: function(object, container, query) { - return object.name; - } - }; - - $scope.selectorByScopeSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - var scopes = []; - - if ('' == query.term.trim()) { - scopes = clientScopes; - } else { - for (var i = 0; i < clientScopes.length; i++) { - if (clientScopes[i].name.indexOf(query.term.trim()) != -1) { - scopes.push(clientScopes[i]); - } - } - } - - query.callback({results: scopes}); - }, - formatResult: function(object, container, query) { - return object.name; - }, - formatSelection: function(object, container, query) { - return object.name; - } - }; - - $scope.attributeSelected = false; - - $scope.showAttributeListing = function() { - return !$scope.attributeSelected && $scope.currentAttribute == null && $scope.isShowAttributes; - } - - $scope.showAttributeGroupListing = function() { - return !$scope.attributeGroupSelected && $scope.currentAttributeGroup == null && $scope.isShowAttributeGroups; - } - - $scope.createAttribute = function() { - $scope.isCreateAttribute = true; - $scope.currentAttribute = { - selector: { - scopes: [] - }, - required: { - roles: [], - scopes: [] - }, - permissions: { - view: [], - edit: [] - } - }; - }; - - $scope.createAttributeGroup = function() { - $scope.isCreateAttributeGroup = true; - $scope.currentAttributeGroup = {}; - }; - - $scope.isNotUsernameOrEmail = function(attributeName) { - return attributeName != "username" && attributeName != "email"; - }; - - $scope.showRequiredSettings = function(attributeName) { - if (attributeName == "username") { - return false; - } - - if (attributeName == "email" && realm.registrationEmailAsUsername) { - return false; - } - - return true; - }; - - $scope.guiOrderUp = function(index) { - $scope.moveAttribute(index, index - 1); - }; - - $scope.guiOrderDown = function(index) { - $scope.moveAttribute(index, index + 1); - }; - - $scope.moveAttribute = function(old_index, new_index){ - $scope.config.attributes.splice(new_index, 0, $scope.config.attributes.splice(old_index, 1)[0]); - $scope.save(); - } - - $scope.groupOrderUp = function(index) { - $scope.moveAttributeGroup(index, index - 1); - }; - - $scope.groupOrderDown = function(index) { - $scope.moveAttributeGroup(index, index + 1); - }; - - $scope.moveAttributeGroup = function(old_index, new_index){ - $scope.config.groups.splice(new_index, 0, $scope.config.groups.splice(old_index, 1)[0]); - $scope.save(false); - } - - $scope.removeAttribute = function(attribute) { - Dialog.confirmDelete(attribute.name, 'attribute', function() { - let newAttributes = []; - - for (var v of $scope.config.attributes) { - if (v != attribute) { - newAttributes.push(v); - } - } - - $scope.config.attributes = newAttributes; - $scope.save(); - }); - }; - - $scope.removeAttributeGroup = function(attributeGroup) { - Dialog.confirmDelete(attributeGroup.name, 'group', function() { - let newGroups = []; - - for (var v of $scope.config.groups) { - if (v != attributeGroup) { - newGroups.push(v); - } - } - - $scope.config.groups = newGroups; - $scope.save(); - }); - }; - - $scope.addAttributeAnnotation = function() { - if (!$scope.currentAttribute.annotations) { - $scope.currentAttribute.annotations = {}; - } - $scope.currentAttribute.annotations[$scope.newAnnotation.key] = $scope.newAnnotation.value; - delete $scope.newAnnotation; - } - - $scope.removeAttributeAnnotation = function(key) { - delete $scope.currentAttribute.annotations[key]; - } - - $scope.addAttributeGroupAnnotation = function() { - if (!$scope.currentAttributeGroup.annotations) { - $scope.currentAttributeGroup.annotations = {}; - } - $scope.currentAttributeGroup.annotations[$scope.newAttributeGroupAnnotation.key] = $scope.newAttributeGroupAnnotation.value; - delete $scope.newGroupAnnotation; - } - - $scope.removeAttributeGroupAnnotation = function(key) { - delete $scope.currentAttributeGroup.annotations[key]; - } - - $scope.editAttribute = function(attribute) { - // it isn't be possible to set permissions to username and email - if (attribute.permissions == null && (attribute.name != 'username' && attribute.name != 'email')) { - attribute.permissions = { - view: [], - edit: [] - }; - } - - if (attribute.selector == null) { - attribute.selector = { - scopes: [] - }; - } - - if (attribute.required) { - if (attribute.required.roles) { - $scope.requiredRoles = attribute.required.roles; - } - if (attribute.required.scopes) { - for (var i = 0; i < attribute.required.scopes.length; i++) { - $scope.requiredScopes.push({ - id: attribute.required.scopes[i], - name: attribute.required.scopes[i] - }); - } - } - } - - if (attribute.selector && attribute.selector.scopes) { - for (var i = 0; i < attribute.selector.scopes.length; i++) { - $scope.selectorByScope.push({ - id: attribute.selector.scopes[i], - name: attribute.selector.scopes[i] - }); - } - } - - $scope.isRequired = attribute.required != null; - - if (attribute.permissions != null) { - $scope.canUserView = attribute.permissions.view.includes('user'); - $scope.canAdminView = attribute.permissions.view.includes('admin'); - $scope.canUserEdit = attribute.permissions.edit.includes('user'); - $scope.canAdminEdit = attribute.permissions.edit.includes('admin'); - } - - $scope.currentAttribute = attribute; - $scope.attributeSelected = true; - }; - - $scope.editAttributeGroup = function(attributeGroup) { - $scope.currentAttributeGroup = attributeGroup; - $scope.attributeGroupSelected = true; - }; - - $scope.groupIsReferencedInAnyAttribute = function(group) { - for (var currentAttribute of $scope.config.attributes) { - if (currentAttribute.group === group.name) { - return true - } - } - return false; - } - - $scope.$watch('isRequired', function() { - if ($scope.isRequired) { - $scope.currentAttribute.required = { - roles: [], - scopes: [] - }; - } else if ($scope.currentAttribute) { - delete $scope.currentAttribute.required; - } - }, true); - - handlePermission = function(permission, role, allowed) { - let attribute = $scope.currentAttribute; - - if (attribute && attribute.permissions) { - let roles = []; - - for (let r of attribute.permissions[permission]) { - if (r != role) { - roles.push(r); - } - } - - if (allowed) { - roles.push(role); - } - - attribute.permissions[permission] = roles; - } - } - - $scope.$watch('canUserView', function() { - handlePermission('view', 'user', $scope.canUserView); - }, true); - - $scope.$watch('canAdminView', function() { - handlePermission('view', 'admin', $scope.canAdminView); - }, true); - - $scope.$watch('canUserEdit', function() { - handlePermission('edit', 'user', $scope.canUserEdit); - }, true); - - $scope.$watch('canAdminEdit', function() { - handlePermission('edit', 'admin', $scope.canAdminEdit); - }, true); - - $scope.addValidator = function(validator) { - if ($scope.currentAttribute.validations == null) { - $scope.currentAttribute.validations = {}; - } - - let config = {}; - - for (let key in validator.config) { - let values = validator.config[key]; - - if (Array.isArray(values)) { - config[key] = values; - } else { - for (let k in values) { - config[key] = values[k]; - } - } - } - - $scope.currentAttribute.validations[validator.id] = config; - - delete $scope.newValidator; - }; - - $scope.selectValidator = function(validator) { - validator.config = {}; - }; - - $scope.cancelAddValidator = function() { - delete $scope.newValidator; - }; - - $scope.removeValidator = function(id) { - let newValidators = {}; - - for (let v in $scope.currentAttribute.validations) { - if (v != id) { - newValidators[v] = $scope.currentAttribute.validations[v]; - } - } - - if (newValidators.length == 0) { - delete $scope.currentAttribute.validations; - return; - } - - $scope.currentAttribute.validations = newValidators; - }; - - $scope.reloadConfigurationFromUserProfile = function () { - UserProfile.get({realm: realm.realm}, function(config) { - $scope.config = config; - $scope.rawConfig = angular.toJson(config, true); - }); - } - - $scope.save = function() { - $scope.save(true) - } - - $scope.save = function(reload) { - if ($scope.isShowJsonEditor) { - $scope.config = JSON.parse($scope.rawConfig); - } - - if ($scope.currentAttribute) { - if ($scope.isRequired) { - $scope.currentAttribute.required.roles = $scope.requiredRoles; - - for (var i = 0; i < $scope.requiredScopes.length; i++) { - $scope.currentAttribute.required.scopes.push($scope.requiredScopes[i].name); - } - } - - $scope.currentAttribute.selector = {scopes: []}; - - for (var i = 0; i < $scope.selectorByScope.length; i++) { - $scope.currentAttribute.selector.scopes.push($scope.selectorByScope[i].name); - } - - if ($scope.isCreateAttribute) { - $scope.config['attributes'].push($scope.currentAttribute); - } - } - - if ($scope.currentAttributeGroup) { - if ($scope.config['groups'] == null) { - $scope.config['groups'] = [] - } - if ($scope.isCreateAttributeGroup) { - $scope.config['groups'].push($scope.currentAttributeGroup); - } - } - - UserProfile.update({realm: realm.realm}, - - $scope.config, function () { - $scope.attributeSelected = false; - delete $scope.currentAttribute; - delete $scope.isCreateAttribute - delete $scope.attributeSelected; - delete $scope.currentAttributeGroup; - delete $scope.isCreateAttributeGroup; - delete $scope.attributeGroupSelected; - delete $scope.isRequired; - delete $scope.canUserView; - delete $scope.canAdminView; - delete $scope.canUserEdit; - delete $scope.canAdminEdit; - - if (reload) { - $route.reload(); - } else { - $scope.reloadConfigurationFromUserProfile(); - } - Notifications.success("User Profile configuration has been saved."); - }); - }; - - $scope.cancelEditAttributeGroup = function() { - delete $scope.currentAttributeGroup; - delete $scope.isCreateAttributeGroup; - delete $scope.attributeGroupSelected; - $scope.reloadConfigurationFromUserProfile(); - } - - $scope.reset = function() { - $route.reload(); - }; -}); - -module.controller('ViewKeyCtrl', function($scope, key) { - $scope.key = key; -}); - -module.controller('RealmKeysCtrl', function($scope, Realm, realm, $http, $route, $location, Dialog, Notifications, serverInfo, keys, Components, $modal) { - $scope.realm = angular.copy(realm); - $scope.keys = keys.keys; - $scope.active = {}; - - Components.query({realm: realm.realm, - parent: realm.id, - type: 'org.keycloak.keys.KeyProvider' - }, function(data) { - for (var i = 0; i < keys.keys.length; i++) { - for (var j = 0; j < data.length; j++) { - if (keys.keys[i].providerId == data[j].id) { - keys.keys[i].provider = data[j]; - } - } - } - - for (var t in keys.active) { - for (var i = 0; i < keys.keys.length; i++) { - if (keys.active[t] == keys.keys[i].kid) { - $scope.active[t] = keys.keys[i]; - } - } - } - }); - - $scope.viewKey = function(key) { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/view-key.html', - controller: 'ViewKeyCtrl', - resolve: { - key: function () { - return key; - } - } - }) - } -}); - -module.controller('RealmKeysProvidersCtrl', function($scope, Realm, realm, $http, $route, $location, Dialog, Notifications, serverInfo, Components, $modal) { - $scope.realm = angular.copy(realm); - $scope.enableUpload = false; - - $scope.providers = serverInfo.componentTypes['org.keycloak.keys.KeyProvider']; - - Components.query({realm: realm.realm, - parent: realm.id, - type: 'org.keycloak.keys.KeyProvider' - }, function(data) { - $scope.instances = data; - - for (var i = 0; i < $scope.instances.length; i++) { - for (var j = 0; j < $scope.providers.length; j++) { - if ($scope.providers[j].id === $scope.instances[i].providerId) { - $scope.instances[i].provider = $scope.providers[j]; - } - } - } - }); - - $scope.addProvider = function(provider) { - $location.url("/create/keys/" + realm.realm + "/providers/" + provider.id); - }; - - $scope.removeInstance = function(instance) { - Dialog.confirmDelete(instance.name, 'key provider', function() { - Components.remove({ - realm : realm.realm, - componentId : instance.id - }, function() { - $route.reload(); - Notifications.success("The provider has been deleted."); - }); - }); - }; -}); - -module.controller('GenericKeystoreCtrl', function($scope, $location, Notifications, $route, Dialog, realm, serverInfo, instance, providerId, Components) { - $scope.create = !instance.providerId; - $scope.realm = realm; - - var providers = serverInfo.componentTypes['org.keycloak.keys.KeyProvider']; - var providerFactory = null; - for (var i = 0; i < providers.length; i++) { - var p = providers[i]; - if (p.id == providerId) { - $scope.providerFactory = p; - providerFactory = p; - break; - } - } - - if ($scope.create) { - $scope.instance = { - name: providerFactory.id, - providerId: providerFactory.id, - providerType: 'org.keycloak.keys.KeyProvider', - parentId: realm.id, - config: { - 'priority': ["0"] - } - } - } else { - $scope.instance = angular.copy(instance); - } - - if (providerFactory.properties) { - for (var i = 0; i < providerFactory.properties.length; i++) { - var configProperty = providerFactory.properties[i]; - if (!$scope.instance.config[configProperty.name]) { - if (configProperty.defaultValue) { - $scope.instance.config[configProperty.name] = [configProperty.defaultValue]; - if (!$scope.create) { - instance.config[configProperty.name] = [configProperty.defaultValue]; - } - } else { - $scope.instance.config[configProperty.name] = ['']; - if (!$scope.create) { - instance.config[configProperty.name] = [configProperty.defaultValue]; - } - } - } - } - } - - $scope.$watch('instance', function() { - if (!angular.equals($scope.instance, instance)) { - $scope.changed = true; - } - - }, true); - - $scope.save = function() { - $scope.changed = false; - if ($scope.create) { - Components.save({realm: realm.realm}, $scope.instance, function (data, headers) { - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - - $location.url("/realms/" + realm.realm + "/keys/providers/" + $scope.instance.providerId + "/" + id); - Notifications.success("The provider has been created."); - }); - } else { - Components.update({realm: realm.realm, - componentId: instance.id - }, - $scope.instance, function () { - $route.reload(); - Notifications.success("The provider has been updated."); - }); - } - }; - - $scope.reset = function() { - $route.reload(); - }; - - $scope.cancel = function() { - if ($scope.create) { - $location.url("/realms/" + realm.realm + "/keys"); - } else { - $route.reload(); - } - }; -}); - -module.controller('RealmSessionStatsCtrl', function($scope, realm, stats, RealmClientSessionStats, RealmLogoutAll, Notifications) { - $scope.realm = realm; - $scope.stats = stats; - - $scope.logoutAll = function() { - RealmLogoutAll.save({realm : realm.realm}, function (globalReqResult) { - var successCount = globalReqResult.successRequests ? globalReqResult.successRequests.length : 0; - var failedCount = globalReqResult.failedRequests ? globalReqResult.failedRequests.length : 0; - - if (failedCount > 0) { - var msgStart = successCount>0 ? 'Successfully logout all users under: ' + globalReqResult.successRequests + ' . ' : ''; - Notifications.error(msgStart + 'Failed to logout users under: ' + globalReqResult.failedRequests + '. Verify availability of failed hosts and try again'); - } else { - window.location.reload(); - } - }); - }; -}); - - -module.controller('RealmRevocationCtrl', function($scope, Realm, RealmPushRevocation, realm, $http, $location, Dialog, Notifications) { - $scope.realm = angular.copy(realm); - - var setNotBefore = function() { - if ($scope.realm.notBefore == 0) { - $scope.notBefore = "None"; - } else { - $scope.notBefore = new Date($scope.realm.notBefore * 1000); - } - }; - - setNotBefore(); - - var reset = function() { - Realm.get({ id : realm.realm }, function(updated) { - $scope.realm = updated; - setNotBefore(); - }) - - }; - - $scope.clear = function() { - Realm.update({ realm: realm.realm, notBefore : 0 }, function () { - $scope.notBefore = "None"; - Notifications.success('Not Before cleared for realm.'); - reset(); - }); - } - $scope.setNotBeforeNow = function() { - Realm.update({ realm: realm.realm, notBefore : new Date().getTime()/1000}, function () { - Notifications.success('Not Before set for realm.'); - reset(); - }); - } - $scope.pushRevocation = function() { - RealmPushRevocation.save({ realm: realm.realm}, function (globalReqResult) { - var successCount = globalReqResult.successRequests ? globalReqResult.successRequests.length : 0; - var failedCount = globalReqResult.failedRequests ? globalReqResult.failedRequests.length : 0; - - if (successCount==0 && failedCount==0) { - Notifications.warn('No push sent. No admin URI configured or no registered cluster nodes available'); - } else if (failedCount > 0) { - var msgStart = successCount>0 ? 'Successfully push notBefore to: ' + globalReqResult.successRequests + ' . ' : ''; - Notifications.error(msgStart + 'Failed to push notBefore to: ' + globalReqResult.failedRequests + '. Verify availability of failed hosts and try again'); - } else { - Notifications.success('Successfully push notBefore to all configured clients'); - } - }); - } - -}); - - -module.controller('RoleTabCtrl', function(Dialog, $scope, Current, Notifications, $location) { - $scope.removeRole = function() { - Dialog.confirmDelete($scope.role.name, 'role', function() { - RoleById.remove({ - realm: realm.realm, - role: $scope.role.id - }, function () { - $route.reload(); - Notifications.success("The role has been deleted."); - }); - }); - }; -}); - - -module.controller('RoleListCtrl', function($scope, $route, Dialog, Notifications, realm, RoleList, RoleById, filterFilter) { - $scope.realm = realm; - $scope.roles = []; - $scope.defaultRoleName = realm.defaultRole.name; - - $scope.query = { - realm: realm.realm, - search : null, - max : 20, - first : 0 - } - - $scope.$watch('query.search', function (newVal, oldVal) { - if($scope.query.search && $scope.query.search.length >= 3) { - $scope.firstPage(); - } - }, true); - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.searchQuery(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.searchQuery(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.searchQuery(); - } - - $scope.searchQuery = function() { - $scope.searchLoaded = false; - - $scope.roles = RoleList.query($scope.query, function() { - $scope.searchLoaded = true; - $scope.lastSearch = $scope.query.search; - }); - }; - - $scope.searchQuery(); - - $scope.determineEditLink = function(role) { - return role.name === $scope.defaultRoleName ? "/realms/" + $scope.realm.realm + "/default-roles" : "/realms/" + $scope.realm.realm + "/roles/" + role.id; - } - - $scope.removeRole = function (role) { - if (role.name === $scope.defaultRoleName) return; - - Dialog.confirmDelete(role.name, 'role', function () { - RoleById.remove({ - realm: realm.realm, - role: role.id - }, function () { - $route.reload(); - Notifications.success("The role has been deleted."); - }); - }); - }; -}); - - -module.controller('RoleDetailCtrl', function($scope, realm, role, roles, Client, $route, - Role, ClientRole, RoleById, RoleRealmComposites, RoleClientComposites, - $http, $location, Dialog, Notifications, RealmRoleRemover, ComponentUtils) { - $scope.realm = realm; - $scope.role = angular.copy(role); - $scope.create = !role.name; - - $scope.changed = $scope.create; - - $scope.save = function() { - convertAttributeValuesToLists(); - console.log('save'); - if ($scope.create) { - Role.save({ - realm: realm.realm - }, $scope.role, function (data, headers) { - $scope.changed = false; - convertAttributeValuesToString($scope.role); - role = angular.copy($scope.role); - - Role.get({ realm: realm.realm, role: role.name }, function(role) { - var id = role.id; - $location.url("/realms/" + realm.realm + "/roles/" + id); - Notifications.success("The role has been created."); - }); - }); - } else { - $scope.update(); - } - }; - - $scope.remove = function() { - RealmRoleRemover.remove($scope.role, realm, Dialog, $location, Notifications); - }; - - $scope.cancel = function () { - $location.url("/realms/" + realm.realm + "/roles"); - }; - - $scope.addAttribute = function() { - $scope.role.attributes[$scope.newAttribute.key] = $scope.newAttribute.value; - delete $scope.newAttribute; - } - - $scope.removeAttribute = function(key) { - delete $scope.role.attributes[key]; - } - - function convertAttributeValuesToLists() { - var attrs = $scope.role.attributes; - for (var attribute in attrs) { - if (typeof attrs[attribute] === "string") { - var attrVals = attrs[attribute].split("##"); - attrs[attribute] = attrVals; - } - } - } - - function convertAttributeValuesToString(role) { - var attrs = role.attributes; - for (var attribute in attrs) { - if (typeof attrs[attribute] === "object") { - var attrVals = attrs[attribute].join("##"); - attrs[attribute] = attrVals; - console.log("attribute" + attrVals) - } - } - } - - roleControl($scope, $route, realm, role, roles, Client, - ClientRole, RoleById, RoleRealmComposites, RoleClientComposites, - $http, $location, Notifications, Dialog, ComponentUtils); -}); - -module.controller('RealmSMTPSettingsCtrl', function($scope, Current, Realm, realm, $http, $location, Dialog, Notifications, RealmSMTPConnectionTester) { - console.log('RealmSMTPSettingsCtrl'); - - var booleanSmtpAtts = ["auth","ssl","starttls"]; - - $scope.realm = realm; - - if ($scope.realm.smtpServer) { - $scope.realm.smtpServer = typeObject($scope.realm.smtpServer); - }; - - var oldCopy = angular.copy($scope.realm); - $scope.changed = false; - - $scope.$watch('realm', function() { - if (!angular.equals($scope.realm, oldCopy)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - var realmCopy = angular.copy($scope.realm); - realmCopy['smtpServer'] = detypeObject(realmCopy.smtpServer); - $scope.changed = false; - Realm.update(realmCopy, function () { - $location.url("/realms/" + realm.realm + "/smtp-settings"); - Notifications.success("Your changes have been saved to the realm."); - }); - }; - - $scope.reset = function() { - $scope.realm = angular.copy(oldCopy); - $scope.changed = false; - }; - - $scope.testConnection = function() { - RealmSMTPConnectionTester.save({realm: realm.realm}, realm.smtpServer, function() { - Notifications.success("SMTP connection successful. E-mail was sent!"); - }, function(errorResponse) { - if (error.data.errorMessage) { - Notifications.error(error.data.errorMessage); - } else { - Notifications.error('Unexpected error during SMTP validation'); - } - }); - }; - - /* Convert string attributes containing a boolean to actual boolean type + convert an integer string (port) to integer. */ - function typeObject(obj){ - for (var att in obj){ - if (booleanSmtpAtts.indexOf(att) < 0) - continue; - if (obj[att] === "true"){ - obj[att] = true; - } else if (obj[att] === "false"){ - obj[att] = false; - } - } - - obj['port'] = parseInt(obj['port']); - - return obj; - } - - /* Convert all non-string values to strings to invert changes caused by the typeObject function. */ - function detypeObject(obj){ - for (var att in obj){ - if (booleanSmtpAtts.indexOf(att) < 0) - continue; - if (obj[att] === true){ - obj[att] = "true"; - } else if (obj[att] === false){ - obj[att] = "false" - } - } - - obj['port'] = obj['port'] && obj['port'].toString(); - - return obj; - } -}); - -module.controller('RealmEventsConfigCtrl', function($scope, eventsConfig, RealmEventsConfig, RealmEvents, RealmAdminEvents, realm, serverInfo, $location, Notifications, TimeUnit, Dialog, Realm) { - $scope.realm = realm; - - $scope.eventsConfig = eventsConfig; - - $scope.eventsConfig.expirationUnit = TimeUnit.autoUnit(eventsConfig.eventsExpiration); - $scope.eventsConfig.eventsExpiration = TimeUnit.toUnit(eventsConfig.eventsExpiration, $scope.eventsConfig.expirationUnit); - $scope.realm.attributes.adminEventsExpirationUnit = TimeUnit.autoUnit(realm.attributes.adminEventsExpiration); - $scope.realm.attributes.adminEventsExpiration = TimeUnit.toUnit(realm.attributes.adminEventsExpiration, $scope.realm.attributes.adminEventsExpirationUnit); - - $scope.eventListeners = Object.keys(serverInfo.providers.eventsListener.providers); - - $scope.eventsConfigSelectOptions = { - 'multiple': true, - 'simple_tags': true, - 'tags': $scope.eventListeners - }; - - $scope.eventSelectOptions = { - 'multiple': true, - 'simple_tags': true, - 'tags': serverInfo.enums['eventType'] - }; - - - $scope.changed = false; - - var oldCopy = angular.copy($scope.eventsConfig); - $scope.configChanged = false; - $scope.$watch('eventsConfig', function() { - if (!angular.equals($scope.eventsConfig, oldCopy)) { - $scope.configChanged = true; - $scope.changed = true; - } - }, true); - - $scope.attributesChanged = false; - var oldAttributes = angular.copy($scope.realm.attributes) - $scope.$watch('realm.attributes', function() { - if($scope.realm.attributes.adminEventsExpiration != oldAttributes.adminEventsExpiration || $scope.realm.attributes.adminEventsExpirationUnit != oldAttributes.adminEventsExpirationUnit) - $scope.attributesChanged = true; - $scope.changed = true; - },true); - - $scope.save = function() { - $scope.changed = false; - var successFunction = function(){ - $location.url("/realms/" + realm.realm + "/events-settings"); - Notifications.success("Your changes have been saved to the realm."); - }; - - var updateAttributes = function (){ - $scope.attributesChanged = false; - var realmCopy = angular.copy($scope.realm) - delete realmCopy.attributes['adminEventsExpirationUnit']; - realmCopy.attributes.adminEventsExpiration = TimeUnit.toSeconds($scope.realm.attributes.adminEventsExpiration, $scope.realm.attributes.adminEventsExpirationUnit); - Realm.update({id: realm.realm},realmCopy,successFunction) - }; - - if($scope.configChanged) { - var copy = angular.copy($scope.eventsConfig) - delete copy['expirationUnit']; - copy.eventsExpiration = TimeUnit.toSeconds($scope.eventsConfig.eventsExpiration, $scope.eventsConfig.expirationUnit); - RealmEventsConfig.update({ - id: realm.realm - }, copy, function () { - $scope.configChanged = false; - if($scope.attributesChanged){ - updateAttributes() - }else{ - successFunction() - } - }); - } else if($scope.attributesChanged){ - updateAttributes() - } - }; - - $scope.reset = function() { - $scope.eventsConfig = angular.copy(oldCopy); - $scope.changed = false; - $scope.realm.attributes.adminEventsExpiration = oldAttributes.adminEventsExpiration; - $scope.realm.attributes.adminEventsExpirationUnit = oldAttributes.adminEventsExpirationUnit; - $scope.attributesChanged = false; - }; - - $scope.clearEvents = function() { - Dialog.confirmDelete($scope.realm.realm, 'events', function() { - RealmEvents.remove({ id : $scope.realm.realm }, function() { - Notifications.success("The events has been cleared."); - }); - }); - }; - - $scope.clearAdminEvents = function() { - Dialog.confirmDelete($scope.realm.realm, 'admin-events', function() { - RealmAdminEvents.remove({ id : $scope.realm.realm }, function() { - Notifications.success("The admin events has been cleared."); - }); - }); - }; -}); - -module.controller('RealmEventsCtrl', function($scope, RealmEvents, realm, serverInfo) { - $scope.realm = realm; - $scope.page = 0; - - $scope.eventSelectOptions = { - 'multiple': true, - 'simple_tags': true, - 'tags': serverInfo.enums['eventType'] - }; - - $scope.query = { - id : realm.realm, - max : 5, - first : 0 - } - - $scope.disablePaste = function(e) { - e.preventDefault(); - return false; - } - - $scope.update = function() { - $scope.query.first = 0; - for (var i in $scope.query) { - if ($scope.query[i] === '') { - delete $scope.query[i]; - } - } - $scope.events = RealmEvents.query($scope.query); - } - - $scope.reset = function() { - $scope.query.first = 0; - $scope.query.max = 5; - $scope.query.type = ''; - $scope.query.client = ''; - $scope.query.user = ''; - $scope.query.dateFrom = ''; - $scope.query.dateTo = ''; - - $scope.update(); - } - - $scope.queryUpdate = function() { - for (var i in $scope.query) { - if ($scope.query[i] === '') { - delete $scope.query[i]; - } - } - $scope.events = RealmEvents.query($scope.query); - } - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.queryUpdate(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.queryUpdate(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.queryUpdate(); - } - - $scope.update(); -}); - -module.controller('RealmAdminEventsCtrl', function($scope, RealmAdminEvents, realm, serverInfo, $modal, $filter) { - $scope.realm = realm; - $scope.page = 0; - - $scope.query = { - id : realm.realm, - max : 5, - first : 0 - }; - - $scope.adminEnabledEventOperationsOptions = { - 'multiple': true, - 'simple_tags': true, - 'tags': serverInfo.enums['operationType'] - }; - - $scope.adminEnabledEventResourceTypesOptions = { - 'multiple': true, - 'simple_tags': true, - 'tags': serverInfo.enums['resourceType'] - }; - - $scope.disablePaste = function(e) { - e.preventDefault(); - return false; - } - - $scope.update = function() { - $scope.query.first = 0; - for (var i in $scope.query) { - if ($scope.query[i] === '') { - delete $scope.query[i]; - } - } - $scope.events = RealmAdminEvents.query($scope.query); - }; - - $scope.reset = function() { - $scope.query.first = 0; - $scope.query.max = 5; - $scope.query.operationTypes = ''; - $scope.query.resourceTypes = ''; - $scope.query.resourcePath = ''; - $scope.query.authRealm = ''; - $scope.query.authClient = ''; - $scope.query.authUser = ''; - $scope.query.authIpAddress = ''; - $scope.query.dateFrom = ''; - $scope.query.dateTo = ''; - - $scope.update(); - }; - - $scope.queryUpdate = function() { - for (var i in $scope.query) { - if ($scope.query[i] === '') { - delete $scope.query[i]; - } - } - $scope.events = RealmAdminEvents.query($scope.query); - } - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.queryUpdate(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.queryUpdate(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.queryUpdate(); - } - - $scope.update(); - - $scope.viewRepresentation = function(event) { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/realm-events-admin-representation.html', - controller: 'RealmAdminEventsModalCtrl', - resolve: { - event: function () { - return event; - } - } - }) - } - - $scope.viewAuth = function(event) { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/realm-events-admin-auth.html', - controller: 'RealmAdminEventsModalCtrl', - resolve: { - event: function () { - return event; - } - } - }) - } -}); - -module.controller('RealmAdminEventsModalCtrl', function($scope, $filter, event) { - $scope.event = event; -}); - -module.controller('RealmBruteForceCtrl', function($scope, Realm, realm, $http, $location, Dialog, Notifications, TimeUnit, $route) { - console.log('RealmBruteForceCtrl'); - - $scope.realm = realm; - - $scope.realm.waitIncrementUnit = TimeUnit.autoUnit(realm.waitIncrementSeconds); - $scope.realm.waitIncrement = TimeUnit.toUnit(realm.waitIncrementSeconds, $scope.realm.waitIncrementUnit); - - $scope.realm.minimumQuickLoginWaitUnit = TimeUnit.autoUnit(realm.minimumQuickLoginWaitSeconds); - $scope.realm.minimumQuickLoginWait = TimeUnit.toUnit(realm.minimumQuickLoginWaitSeconds, $scope.realm.minimumQuickLoginWaitUnit); - - $scope.realm.maxFailureWaitUnit = TimeUnit.autoUnit(realm.maxFailureWaitSeconds); - $scope.realm.maxFailureWait = TimeUnit.toUnit(realm.maxFailureWaitSeconds, $scope.realm.maxFailureWaitUnit); - - $scope.realm.maxDeltaTimeUnit = TimeUnit.autoUnit(realm.maxDeltaTimeSeconds); - $scope.realm.maxDeltaTime = TimeUnit.toUnit(realm.maxDeltaTimeSeconds, $scope.realm.maxDeltaTimeUnit); - - var oldCopy = angular.copy($scope.realm); - $scope.changed = false; - - $scope.$watch('realm', function() { - if (!angular.equals($scope.realm, oldCopy)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - var realmCopy = angular.copy($scope.realm); - delete realmCopy["waitIncrementUnit"]; - delete realmCopy["waitIncrement"]; - delete realmCopy["minimumQuickLoginWaitUnit"]; - delete realmCopy["minimumQuickLoginWait"]; - delete realmCopy["maxFailureWaitUnit"]; - delete realmCopy["maxFailureWait"]; - delete realmCopy["maxDeltaTimeUnit"]; - delete realmCopy["maxDeltaTime"]; - - realmCopy.waitIncrementSeconds = TimeUnit.toSeconds($scope.realm.waitIncrement, $scope.realm.waitIncrementUnit) - realmCopy.minimumQuickLoginWaitSeconds = TimeUnit.toSeconds($scope.realm.minimumQuickLoginWait, $scope.realm.minimumQuickLoginWaitUnit) - realmCopy.maxFailureWaitSeconds = TimeUnit.toSeconds($scope.realm.maxFailureWait, $scope.realm.maxFailureWaitUnit) - realmCopy.maxDeltaTimeSeconds = TimeUnit.toSeconds($scope.realm.maxDeltaTime, $scope.realm.maxDeltaTimeUnit) - - $scope.changed = false; - Realm.update(realmCopy, function () { - oldCopy = angular.copy($scope.realm); - $location.url("/realms/" + realm.realm + "/defense/brute-force"); - Notifications.success("Your changes have been saved to the realm."); - }); - }; - - $scope.reset = function() { - $route.reload(); - }; -}); - - -module.controller('IdentityProviderMapperListCtrl', function($scope, realm, identityProvider, mapperTypes, mappers) { - $scope.realm = realm; - $scope.identityProvider = identityProvider; - $scope.mapperTypes = mapperTypes; - $scope.mappers = mappers; -}); - -module.controller('IdentityProviderMapperCtrl', function ($scope, realm, identityProvider, mapperTypes, mapper, IdentityProviderMapper, Notifications, Dialog, ComponentUtils, $location) { - $scope.realm = realm; - $scope.identityProvider = identityProvider; - $scope.create = false; - $scope.changed = false; - $scope.mapperType = mapperTypes[mapper.identityProviderMapper]; - - ComponentUtils.convertAllMultivaluedStringValuesToList($scope.mapperType.properties, mapper.config); - ComponentUtils.addLastEmptyValueToMultivaluedLists($scope.mapperType.properties, mapper.config); - - $scope.mapper = angular.copy(mapper); - - $scope.$watch(function () { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.$watch('mapper', function() { - if (!angular.equals($scope.mapper, mapper)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - let mapperCopy = angular.copy($scope.mapper); - ComponentUtils.convertAllListValuesToMultivaluedString($scope.mapperType.properties, mapperCopy.config); - - IdentityProviderMapper.update({ - realm : realm.realm, - alias : identityProvider.alias, - mapperId : mapper.id - }, mapperCopy, function () { - $scope.changed = false; - ComponentUtils.addLastEmptyValueToMultivaluedLists($scope.mapperType.properties, $scope.mapper.config); - mapper = angular.copy($scope.mapper); - $location.url("/realms/" + realm.realm + '/identity-provider-mappers/' + identityProvider.alias + "/mappers/" + mapper.id); - Notifications.success("Your changes have been saved."); - }); - }; - - $scope.reset = function() { - $scope.mapper = angular.copy(mapper); - $scope.changed = false; - }; - - $scope.cancel = function() { - //$location.url("/realms"); - window.history.back(); - }; - - $scope.remove = function() { - Dialog.confirmDelete($scope.mapper.name, 'mapper', function() { - IdentityProviderMapper.remove({ realm: realm.realm, alias: mapper.identityProviderAlias, mapperId : $scope.mapper.id }, function() { - Notifications.success("The mapper has been deleted."); - $location.url("/realms/" + realm.realm + '/identity-provider-mappers/' + identityProvider.alias + "/mappers"); - }); - }); - }; - -}); - -module.controller('IdentityProviderMapperCreateCtrl', function ($scope, realm, identityProvider, mapperTypes, IdentityProviderMapper, Notifications, Dialog, ComponentUtils, $location) { - $scope.realm = realm; - $scope.identityProvider = identityProvider; - $scope.create = true; - $scope.mapper = { identityProviderAlias: identityProvider.alias, config: {}}; - $scope.mapperTypes = mapperTypes; - - // make first type the default - $scope.mapperType = mapperTypes[Object.keys(mapperTypes)[0]]; - $scope.mapper.config.syncMode = 'INHERIT'; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.save = function () { - $scope.mapper.identityProviderMapper = $scope.mapperType.id; - let copyMapper = angular.copy($scope.mapper); - ComponentUtils.convertAllListValuesToMultivaluedString($scope.mapperType.properties, copyMapper.config); - - IdentityProviderMapper.save({ - realm : realm.realm, - alias : identityProvider.alias - }, copyMapper, function (data, headers) { - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - $location.url("/realms/" + realm.realm + '/identity-provider-mappers/' + identityProvider.alias + "/mappers/" + id); - Notifications.success("Mapper has been created."); - }); - }; - - $scope.cancel = function() { - //$location.url("/realms"); - window.history.back(); - }; - - -}); - -module.controller('RealmFlowBindingCtrl', function($scope, flows, Current, Realm, realm, serverInfo, $http, $route, Dialog, Notifications) { - $scope.flows = []; - $scope.clientFlows = []; - for (var i=0 ; i 0) { - $scope.provider = formProviders[0]; - } - - $scope.save = function() { - $scope.flow.provider = $scope.provider.id; - CreateExecutionFlow.save({realm: realm.realm, alias: parentFlow.alias}, $scope.flow, function() { - $location.url("/realms/" + realm.realm + "/authentication/flows"); - Notifications.success("Flow Created."); - }) - } - $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/authentication/flows"); - }; -}); - -module.controller('CreateExecutionCtrl', function($scope, realm, parentFlow, formActionProviders, authenticatorProviders, clientAuthenticatorProviders, - CreateExecution, - Notifications, $location) { - $scope.realm = realm; - $scope.parentFlow = parentFlow; - - if (parentFlow.providerId == 'form-flow') { - $scope.providers = formActionProviders; - } else if (parentFlow.providerId == 'client-flow') { - $scope.providers = clientAuthenticatorProviders; - } else { - $scope.providers = authenticatorProviders; - } - - $scope.provider = {}; - if ($scope.providers.length > 0) { - $scope.provider = $scope.providers[0]; - } - - $scope.save = function() { - var execution = { - provider: $scope.provider.id - } - CreateExecution.save({realm: realm.realm, alias: parentFlow.alias}, execution, function() { - $location.url("/realms/" + realm.realm + "/authentication/flows"); - Notifications.success("Execution Created."); - }) - } - $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/authentication/flows"); - }; -}); - - - -module.controller('AuthenticationFlowsCtrl', function($scope, $route, realm, flows, selectedFlow, LastFlowSelected, Dialog, - AuthenticationFlows, AuthenticationFlowsCopy, AuthenticationFlowsUpdate, AuthenticationFlowExecutions, - AuthenticationExecution, AuthenticationExecutionRaisePriority, AuthenticationExecutionLowerPriority, - $modal, Notifications, CopyDialog, UpdateDialog, $location) { - $scope.realm = realm; - $scope.flows = flows; - - if (selectedFlow !== null) { - LastFlowSelected.alias = selectedFlow; - } - - if (selectedFlow === null && LastFlowSelected.alias !== null) { - selectedFlow = LastFlowSelected.alias; - } - - if (flows.length > 0) { - $scope.flow = flows[0]; - if (selectedFlow) { - for (var i = 0; i < flows.length; i++) { - if (flows[i].alias == selectedFlow) { - $scope.flow = flows[i]; - break; - } - } - } - } - - $scope.selectFlow = function(flow) { - $location.url("/realms/" + realm.realm + '/authentication/flows/' + flow.alias); - }; - - var setupForm = function() { - AuthenticationFlowExecutions.query({realm: realm.realm, alias: $scope.flow.alias}, function(data) { - $scope.executions = data; - $scope.choicesmax = 0; - $scope.levelmax = 0; - for (var i = 0; i < $scope.executions.length; i++ ) { - var execution = $scope.executions[i]; - if (execution.requirementChoices.length > $scope.choicesmax) { - $scope.choicesmax = execution.requirementChoices.length; - } - if (execution.level > $scope.levelmax) { - $scope.levelmax = execution.level; - } - } - $scope.levelmaxempties = []; - for (j = 0; j < $scope.levelmax; j++) { - $scope.levelmaxempties.push(j); - - } - for (var i = 0; i < $scope.executions.length; i++ ) { - var execution = $scope.executions[i]; - execution.empties = []; - for (j = 0; j < $scope.choicesmax - execution.requirementChoices.length; j++) { - execution.empties.push(j); - } - execution.preLevels = []; - for (j = 0; j < execution.level; j++) { - execution.preLevels.push(j); - } - execution.postLevels = []; - for (j = execution.level; j < $scope.levelmax; j++) { - execution.postLevels.push(j); - } - } - }) - }; - - $scope.copyFlow = function() { - CopyDialog.open('Copy Authentication Flow', $scope.flow.alias, function(name) { - AuthenticationFlowsCopy.save({realm: realm.realm, alias: $scope.flow.alias}, { - newName: name - }, function() { - $location.url("/realms/" + realm.realm + '/authentication/flows/' + name); - Notifications.success("Flow copied."); - }) - }) - }; - - $scope.deleteFlow = function() { - Dialog.confirmDelete($scope.flow.alias, 'flow', function() { - $scope.removeFlow(); - }); - }; - - $scope.removeFlow = function() { - console.log('Remove flow:' + $scope.flow.alias); - if (realm.browserFlow == $scope.flow.alias) { - Notifications.error("Cannot remove flow, it is currently being used as the browser flow."); - - } else if (realm.registrationFlow == $scope.flow.alias) { - Notifications.error("Cannot remove flow, it is currently being used as the registration flow."); - - } else if (realm.directGrantFlow == $scope.flow.alias) { - Notifications.error("Cannot remove flow, it is currently being used as the direct grant flow."); - - } else if (realm.resetCredentialsFlow == $scope.flow.alias) { - Notifications.error("Cannot remove flow, it is currently being used as the reset credentials flow."); - - } else if (realm.clientAuthenticationFlow == $scope.flow.alias) { - Notifications.error("Cannot remove flow, it is currently being used as the client authentication flow."); - - } else if (realm.dockerAuthenticationFlow == $scope.flow.alias) { - Notifications.error("Cannot remove flow, it is currently being used as the docker authentication flow."); - } else { - AuthenticationFlows.remove({realm: realm.realm, flow: $scope.flow.id}, function () { - $location.url("/realms/" + realm.realm + '/authentication/flows/' + flows[0].alias); - Notifications.success("Flow removed"); - }) - } - - }; - - $scope.editFlow = function(flow) { - var copy = angular.copy(flow); - UpdateDialog.open('Update Authentication Flow', copy.alias, copy.description, function(name, desc) { - copy.alias = name; - copy.description = desc; - AuthenticationFlowsUpdate.update({realm: realm.realm, flow: flow.id}, copy, function() { - $location.url("/realms/" + realm.realm + '/authentication/flows/' + name); - Notifications.success("Flow updated"); - }); - }) - }; - - $scope.addFlow = function() { - $location.url("/realms/" + realm.realm + '/authentication/flows/' + $scope.flow.id + '/create/flow/execution/' + $scope.flow.id); - - } - - $scope.addSubFlow = function(execution) { - $location.url("/realms/" + realm.realm + '/authentication/flows/' + execution.flowId + '/create/flow/execution/' + $scope.flow.alias); - - } - - $scope.addSubFlowExecution = function(execution) { - $location.url("/realms/" + realm.realm + '/authentication/flows/' + execution.flowId + '/create/execution/' + $scope.flow.alias); - - } - - $scope.addExecution = function() { - $location.url("/realms/" + realm.realm + '/authentication/flows/' + $scope.flow.id + '/create/execution/' + $scope.flow.id); - - } - - $scope.createFlow = function() { - $location.url("/realms/" + realm.realm + '/authentication/create/flow'); - } - - $scope.updateExecution = function(execution) { - var copy = angular.copy(execution); - delete copy.empties; - delete copy.levels; - delete copy.preLevels; - delete copy.postLevels; - AuthenticationFlowExecutions.update({realm: realm.realm, alias: $scope.flow.alias}, copy, function() { - Notifications.success("Auth requirement updated"); - setupForm(); - }); - - }; - - $scope.editExecutionFlow = function(execution) { - var copy = angular.copy(execution); - delete copy.empties; - delete copy.levels; - delete copy.preLevels; - delete copy.postLevels; - UpdateDialog.open('Update Execution Flow', copy.displayName, copy.description, function(name, desc) { - copy.displayName = name; - copy.description = desc; - AuthenticationFlowExecutions.update({realm: realm.realm, alias: $scope.flow.alias}, copy, function() { - Notifications.success("Execution Flow updated"); - setupForm(); - }); - }) - }; - - $scope.removeExecution = function(execution) { - console.log('removeExecution: ' + execution.id); - var exeOrFlow = execution.authenticationFlow ? 'flow' : 'execution'; - Dialog.confirmDelete(execution.displayName, exeOrFlow, function() { - AuthenticationExecution.remove({realm: realm.realm, execution: execution.id}, function() { - Notifications.success("The " + exeOrFlow + " was removed."); - setupForm(); - }); - }); - - } - - $scope.raisePriority = function(execution) { - AuthenticationExecutionRaisePriority.save({realm: realm.realm, execution: execution.id}, function() { - Notifications.success("Priority raised"); - setupForm(); - }) - } - - $scope.lowerPriority = function(execution) { - AuthenticationExecutionLowerPriority.save({realm: realm.realm, execution: execution.id}, function() { - Notifications.success("Priority lowered"); - setupForm(); - }) - } - - $scope.setupForm = setupForm; - - if (selectedFlow == null) { - $scope.selectFlow(flows[0]); - } else { - setupForm(); - } -}); - -module.controller('RequiredActionsCtrl', function($scope, realm, unregisteredRequiredActions, - $modal, $route, - RegisterRequiredAction, RequiredActions, RequiredActionRaisePriority, RequiredActionLowerPriority, Notifications) { - console.log('RequiredActionsCtrl'); - $scope.realm = realm; - $scope.unregisteredRequiredActions = unregisteredRequiredActions; - $scope.requiredActions = []; - var setupRequiredActionsForm = function() { - console.log('setupRequiredActionsForm'); - RequiredActions.query({realm: realm.realm}, function(data) { - $scope.requiredActions = []; - for (var i = 0; i < data.length; i++) { - $scope.requiredActions.push(data[i]); - } - }); - }; - - $scope.updateRequiredAction = function(action) { - RequiredActions.update({realm: realm.realm, alias: action.alias}, action, function() { - Notifications.success("Required action updated"); - setupRequiredActionsForm(); - }); - } - - $scope.raisePriority = function(action) { - RequiredActionRaisePriority.save({realm: realm.realm, alias: action.alias}, function() { - Notifications.success("Required action's priority raised"); - setupRequiredActionsForm(); - }) - } - - $scope.lowerPriority = function(action) { - RequiredActionLowerPriority.save({realm: realm.realm, alias: action.alias}, function() { - Notifications.success("Required action's priority lowered"); - setupRequiredActionsForm(); - }) - } - - $scope.register = function() { - var controller = function($scope, $modalInstance) { - $scope.unregisteredRequiredActions = unregisteredRequiredActions; - $scope.selected = { - selected: $scope.unregisteredRequiredActions[0] - } - $scope.ok = function () { - $modalInstance.close(); - RegisterRequiredAction.save({realm: realm.realm}, $scope.selected.selected, function() { - $route.reload(); - }); - }; - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - } - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/unregistered-required-action-selector.html', - controller: controller, - resolve: { - } - }); - } - - setupRequiredActionsForm(); - - -}); - -module.controller('AuthenticationConfigCtrl', function($scope, realm, flow, configType, config, AuthenticationConfig, Notifications, - Dialog, $location, ComponentUtils) { - $scope.realm = realm; - $scope.flow = flow; - $scope.configType = configType; - $scope.create = false; - $scope.config = angular.copy(config); - $scope.changed = false; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.$watch('config', function() { - if (!angular.equals($scope.config, config)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - var configCopy = angular.copy($scope.config); - ComponentUtils.convertAllListValuesToMultivaluedString(configType.properties, configCopy.config); - - AuthenticationConfig.update({ - realm : realm.realm, - config : config.id - }, configCopy, function() { - $scope.changed = false; - config = angular.copy($scope.config); - Notifications.success("Your changes have been saved."); - $location.reload(); - }); - }; - - $scope.reset = function() { - $scope.config = angular.copy(config); - $scope.changed = false; - }; - - $scope.cancel = function() { - //$location.url("/realms"); - window.history.back(); - }; - - $scope.remove = function() { - Dialog.confirmDelete($scope.config.alias, 'config', function() { - AuthenticationConfig.remove({ realm: realm.realm, config : $scope.config.id }, function() { - Notifications.success("The config has been deleted."); - $location.url("/realms/" + realm.realm + '/authentication/flows/' + flow.id); - }); - }); - }; - -}); - -module.controller('AuthenticationConfigCreateCtrl', function($scope, realm, flow, configType, execution, AuthenticationExecutionConfig, - Notifications, Dialog, $location, ComponentUtils) { - $scope.realm = realm; - $scope.flow = flow; - $scope.create = true; - $scope.configType = configType; - - var defaultConfig = {}; - if (configType && Array.isArray(configType.properties)) { - for(var i = 0; i < configType.properties.length; i++) { - var property = configType.properties[i]; - if (property && property.name) { - defaultConfig[property.name] = property.defaultValue; - } - } - } - - $scope.config = { config: defaultConfig}; - - $scope.$watch(function() { - return $location.path(); - }, function() { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.save = function() { - var configCopy = angular.copy($scope.config); - ComponentUtils.convertAllListValuesToMultivaluedString(configType.properties, configCopy.config); - - AuthenticationExecutionConfig.save({ - realm : realm.realm, - execution: execution - }, configCopy, function(data, headers) { - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - var url = "/realms/" + realm.realm + '/authentication/flows/' + flow.id + '/config/' + configType.providerId + "/" + id; - console.log('redirect url: ' + url); - $location.url(url); - Notifications.success("Config has been created."); - }); - }; - - $scope.cancel = function() { - //$location.url("/realms"); - window.history.back(); - }; -}); - -module.controller('ClientInitialAccessCtrl', function($scope, realm, clientInitialAccess, ClientInitialAccess, Dialog, Notifications, $route, $location) { - $scope.realm = realm; - $scope.clientInitialAccess = clientInitialAccess; - - $scope.remove = function(id) { - Dialog.confirmDelete(id, 'initial access token', function() { - ClientInitialAccess.remove({ realm: realm.realm, id: id }, function() { - Notifications.success("The initial access token was deleted."); - $route.reload(); - }); - }); - } -}); - -module.controller('ClientInitialAccessCreateCtrl', function($scope, realm, ClientInitialAccess, TimeUnit, Dialog, $location, $translate) { - $scope.expirationUnit = 'Days'; - $scope.expiration = TimeUnit.toUnit(0, $scope.expirationUnit); - $scope.count = 1; - $scope.realm = realm; - - $scope.save = function() { - var expiration = TimeUnit.toSeconds($scope.expiration, $scope.expirationUnit); - ClientInitialAccess.save({ - realm: realm.realm - }, { expiration: expiration, count: $scope.count}, function (data) { - console.debug(data); - $scope.id = data.id; - $scope.token = data.token; - }); - }; - - $scope.cancel = function() { - $location.url('/realms/' + realm.realm + '/client-registration/client-initial-access'); - }; - - $scope.done = function() { - var btns = { - ok: { - label: $translate.instant('continue'), - cssClass: 'btn btn-primary' - }, - cancel: { - label: $translate.instant('cancel'), - cssClass: 'btn btn-default' - } - } - - var title = $translate.instant('initial-access-token.confirm.title'); - var message = $translate.instant('initial-access-token.confirm.text'); - Dialog.open(title, message, btns, function() { - $location.url('/realms/' + realm.realm + '/client-registration/client-initial-access'); - }); - }; -}); - -module.controller('ClientRegPoliciesCtrl', function($scope, realm, clientRegistrationPolicyProviders, policies, Dialog, Notifications, Components, $route, $location) { - $scope.realm = realm; - $scope.providers = clientRegistrationPolicyProviders; - $scope.anonPolicies = []; - $scope.authPolicies = []; - for (var i=0 ; i { - $scope.headerTitle = translatedValue; - }).catch(() => { - $scope.headerTitle = $scope.instance.providerId; - }); - - if ($scope.create) { - $scope.instance.name = ""; - $scope.instance.parentId = realm.id; - $scope.instance.config = {}; - - if ($scope.providerType.properties) { - - for (let i = 0; i < $scope.providerType.properties.length; i++) { - let configProperty = $scope.providerType.properties[i]; - $scope.instance.config[configProperty.name] = toDefaultValue(configProperty); - } - } - } - - if ($scope.providerType.properties) { - ComponentUtils.addLastEmptyValueToMultivaluedLists($scope.providerType.properties, $scope.instance.config); - ComponentUtils.addMvOptionsToMultivaluedLists($scope.providerType.properties); - } - - let oldCopy = angular.copy($scope.instance); - $scope.changed = false; - - $scope.$watch('instance', function() { - if (!angular.equals($scope.instance, oldCopy)) { - $scope.changed = true; - } - }, true); - - $scope.reset = function() { - $scope.create ? window.history.back() : $route.reload(); - }; - - $scope.hasValidValues = () => $scope.changed && $scope.instance.name; - - $scope.save = function() { - $scope.changed = false; - if ($scope.create) { - Components.save({realm: realm.realm}, $scope.instance, function (data, headers) { - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - $location.url("/realms/" + realm.realm + "/client-registration/client-reg-policies/" + $scope.instance.providerId + "/" + id); - Notifications.success("The policy has been created."); - }); - } else { - Components.update({realm: realm.realm, - componentId: instance.id - }, - $scope.instance, function () { - $route.reload(); - Notifications.success("The policy has been updated."); - }); - } - }; - -}); - -module.controller('ClientPoliciesProfilesListCtrl', function($scope, realm, clientProfiles, ClientPoliciesProfiles, Dialog, Notifications, $route, $location) { - console.log('ClientPoliciesProfilesListCtrl'); - $scope.realm = realm; - $scope.clientProfiles = clientProfiles; - - $scope.removeClientProfile = function(clientProfile) { - Dialog.confirmDelete(clientProfile.name, 'client profile', function() { - console.log("Deleting client profile from the JSON: " + clientProfile.name); - - for (var i = 0; i < $scope.clientProfiles.profiles.length; i++) { - var currentProfile = $scope.clientProfiles.profiles[i]; - if (currentProfile.name === clientProfile.name) { - $scope.clientProfiles.profiles.splice(i, 1); - break; - } - } - - ClientPoliciesProfiles.update({ - realm: realm.realm, - }, $scope.clientProfiles, function () { - $route.reload(); - Notifications.success("The client profile was deleted."); - }, function (errorResponse) { - $route.reload(); - var errDetails = (!errorResponse.data.errorMessage) ? "unknown error, please see the server log" : errorResponse.data.errorMessage - Notifications.error('Failed to delete client profile: ' + errDetails); - }); - }); - }; - -}); - -module.controller('ClientPoliciesProfilesJsonCtrl', function($scope, realm, clientProfiles, ClientPoliciesProfiles, Dialog, Notifications, $route, $location) { - console.log('ClientPoliciesProfilesJsonCtrl'); - $scope.realm = realm; - $scope.clientProfilesString = angular.toJson(clientProfiles, true); - - $scope.save = function() { - var clientProfilesObj = null; - try { - clientProfilesObj = angular.fromJson($scope.clientProfilesString); - } catch (e) { - Notifications.error("Provided JSON is incorrect: " + e.message); - console.log(e); - return; - } - var clientProfilesCompressed = angular.toJson(clientProfilesObj, false); - - ClientPoliciesProfiles.update({ - realm: realm.realm, - }, clientProfilesCompressed, function () { - $route.reload(); - Notifications.success("The client profiles configuration was updated."); - }, function(errorResponse) { - var errDetails = (!errorResponse.data.errorMessage) ? "unknown error, please see the server log" : errorResponse.data.errorMessage - Notifications.error("Failed to update client profiles: " + errDetails); - console.log("Error response when updating client profiles JSON: Status: " + errorResponse.status + - ", statusText: " + errorResponse.statusText + ", data: " + JSON.stringify(errorResponse.data)); - }); - }; - - $scope.reset = function() { - $route.reload(); - }; - -}); - -module.controller('ClientPoliciesProfilesEditCtrl', function($scope, realm, clientProfiles, ClientPoliciesProfiles, Dialog, Notifications, $route, $location) { - var targetProfileName = $route.current.params.profileName; - $scope.createNew = targetProfileName == null; - if ($scope.createNew) { - console.log('ClientPoliciesProfilesEditCtrl: creating new profile'); - } else { - console.log('ClientPoliciesProfilesEditCtrl: updating profile ' + targetProfileName); - } - - $scope.realm = realm; - $scope.editedProfile = null; - - function getProfileByName(profilesArray) { - if (!profilesArray) return null; - for (var i=0 ; i < profilesArray.length ; i++) { - var currentProfile = profilesArray[i]; - if (targetProfileName === currentProfile.name) { - return currentProfile; - } - } - } - - if ($scope.createNew) { - $scope.editedProfile = { - name: "", - executors: [] - }; - } else { - var globalProfile = false; - $scope.editedProfile = getProfileByName(clientProfiles.profiles); - if (!$scope.editedProfile) { - $scope.editedProfile = getProfileByName(clientProfiles.globalProfiles); - globalProfile = true; - } - - if ($scope.editedProfile == null) { - console.log("Profile of name " + targetProfileName + " not found"); - throw 'Profile not found'; - } - } - - // needs to be a function because when this controller runs, the permissions might not be loaded yet - $scope.isReadOnly = function() { - return !$scope.access.manageRealm || globalProfile; - } - - $scope.removeExecutor = function(executorIndex) { - Dialog.confirmDelete($scope.editedProfile.executors[executorIndex].executor, 'executor', function() { - console.log("remove executor of index " + executorIndex); - - // Delete executor - $scope.editedProfile.executors.splice(executorIndex, 1); - - ClientPoliciesProfiles.update({ - realm: realm.realm, - }, clientProfiles, function () { - Notifications.success("The executor was deleted."); - }, function (errorResponse) { - $route.reload(); - var errDetails = (!errorResponse.data.errorMessage) ? "unknown error, please see the server log" : errorResponse.data.errorMessage - Notifications.error('Failed to delete executor: ' + errDetails); - }); - }); - } - - $scope.save = function() { - if (!$scope.editedProfile.name || $scope.editedProfile.name === '') { - Notifications.error('Name must be provided'); - return; - } - - if ($scope.createNew) { - clientProfiles.profiles.push($scope.editedProfile); - } - - ClientPoliciesProfiles.update({ - realm: realm.realm, - }, clientProfiles, function () { - if ($scope.createNew) { - Notifications.success("The client profile was created."); - $location.url('/realms/' + realm.realm + '/client-policies/profiles-update/' + $scope.editedProfile.name); - } else { - Notifications.success("The client profile was updated."); - $location.url('/realms/' + realm.realm + '/client-policies/profiles'); - } - }, function(errorResponse) { - var errDetails = (!errorResponse.data.errorMessage) ? "unknown error, please see the server log" : errorResponse.data.errorMessage - if ($scope.createNew) { - Notifications.error('Failed to create client profile: ' + errDetails); - } else { - Notifications.error('Failed to update client profile: ' + errDetails); - } - }); - - }; - - $scope.back = function() { - $location.url('/realms/' + realm.realm + '/client-policies/profiles'); - }; - -}); - -module.controller('ClientPoliciesProfilesEditExecutorCtrl', function($scope, realm, serverInfo, clientProfiles, ClientPoliciesProfiles, ComponentUtils, Dialog, Notifications, $route, $location) { - var updatedExecutorIndex = $route.current.params.executorIndex; - var targetProfileName = $route.current.params.profileName; - $scope.createNew = updatedExecutorIndex == null; - if ($scope.createNew) { - console.log('ClientPoliciesProfilesEditExecutorCtrl: adding executor to profile ' + targetProfileName); - } else { - console.log('ClientPoliciesProfilesEditExecutorCtrl: updating executor with index ' + updatedExecutorIndex + ' of profile ' + targetProfileName); - } - $scope.realm = realm; - - function getProfileByName(profilesArray) { - if (!profilesArray) return null; - for (var i=0 ; i < profilesArray.length ; i++) { - var currentProfile = profilesArray[i]; - if (targetProfileName === currentProfile.name) { - return currentProfile; - } - } - } - - var globalProfile = false; - $scope.editedProfile = getProfileByName(clientProfiles.profiles); - if (!$scope.editedProfile) { - $scope.editedProfile = getProfileByName(clientProfiles.globalProfiles); - globalProfile = true; - } - if ($scope.editedProfile == null) { - throw 'Client profile of specified name not found'; - } - - // needs to be a function because when this controller runs, the permissions might not be loaded yet - $scope.isReadOnly = function() { - return !$scope.access.manageRealm || globalProfile; - } - - $scope.executorTypes = serverInfo.componentTypes['org.keycloak.services.clientpolicy.executor.ClientPolicyExecutorProvider']; - - for (var j=0 ; j < $scope.executorTypes.length ; j++) { - var currExecutorType = $scope.executorTypes[j]; - if (currExecutorType.properties) { - console.log("Adjusting executorType: " + currExecutorType.id); - ComponentUtils.addMvOptionsToMultivaluedLists(currExecutorType.properties); - } - } - - function getExecutorByIndex(clientProfile, executorIndex) { - if (clientProfile.executors.length <= executorIndex) { - console.error('Client profile does not have executor of specified index'); - $location.path('/notfound'); - return null; - } else { - return clientProfile.executors[executorIndex]; - } - } - - if ($scope.createNew) { - // make first type the default - $scope.executorType = $scope.executorTypes[0]; - var oldExecutorType = $scope.executorType; - initConfig(); - - $scope.$watch('executorType', function() { - if (!angular.equals($scope.executorType, oldExecutorType)) { - oldExecutorType = $scope.executorType; - initConfig(); - } - }, true); - } else { - var exec = getExecutorByIndex($scope.editedProfile, updatedExecutorIndex); - if (exec) { - // a failsafe in case the configuration was deleted entirely (or set to null) in the JSON view - if (!exec.configuration) { - exec.configuration = {} - } - - $scope.executor = { - config: exec.configuration - }; - - $scope.executorType = null; - for (var j=0 ; j < $scope.executorTypes.length ; j++) { - var currentExType = $scope.executorTypes[j]; - if (exec.executor === currentExType.id) { - $scope.executorType = currentExType; - break; - } - } - - for (var j=0 ; j < $scope.executorType.properties.length ; j++) { - // Convert boolean properties from the configuration to strings as expected by the kc-provider-config directive - var currentProperty = $scope.executorType.properties[j]; - if (currentProperty.type === 'boolean') { - $scope.executor.config[currentProperty.name] = ($scope.executor.config[currentProperty.name]) ? "true" : "false"; - } - - // a workaround for select2 to prevent displaying empty boxes - var configProperty = $scope.executor.config[$scope.executorType.properties[j].name]; - if (Array.isArray(configProperty) && configProperty.length === 0) { - $scope.executor.config[$scope.executorType.properties[j].name] = null - } - - } - } - - } - - function toDefaultValue(configProperty) { - if (configProperty.type === 'boolean') { - return (configProperty.defaultValue) ? "true" : "false"; - } - - if (configProperty.defaultValue !== undefined) { - if ((configProperty.type === 'MultivaluedString' || configProperty.type === 'MultivaluedList') && !Array.isArray(configProperty.defaultValue)) { - return [configProperty.defaultValue] - } - return configProperty.defaultValue; - } else { - return null; - } - } - - function initConfig() { - console.log("Initialized config now. ConfigType is: " + $scope.executorType.id); - $scope.executor = { - config: {} - }; - - for (let i = 0; i < $scope.executorType.properties.length; i++) { - let configProperty = $scope.executorType.properties[i]; - $scope.executor.config[configProperty.name] = toDefaultValue(configProperty); - } - } - - $scope.save = function() { - console.log("save: " + $scope.executorType.id); - - var executorName = $scope.executorType.id; - if (!$scope.editedProfile.executors) { - $scope.editedProfile.executors = []; - } - - ComponentUtils.removeLastEmptyValue($scope.executor.config); - - // Convert String properties required by the kc-provider-config directive back to booleans - for (var j=0 ; j < $scope.executorType.properties.length ; j++) { - var currentProperty = $scope.executorType.properties[j]; - if (currentProperty.type === 'boolean') { - $scope.executor.config[currentProperty.name] = ($scope.executor.config[currentProperty.name] === "true") ? true : false; - } - } - - if ($scope.createNew) { - var selectedExecutor = { - executor: $scope.executorType.id, - configuration: $scope.executor.config - }; - $scope.executors = $scope.editedProfile.executors.map((ex) => ex); //clone current executors - $scope.editedProfile.executors.push(selectedExecutor); - } else { - var currentExecutor = getExecutorByIndex($scope.editedProfile, updatedExecutorIndex); - if (currentExecutor) { - currentExecutor.configuration = $scope.executor.config; - } - } - - ClientPoliciesProfiles.update({ - realm: realm.realm, - }, clientProfiles, function () { - if ($scope.createNew) { - Notifications.success("Executor created successfully"); - } else { - Notifications.success("Executor updated successfully"); - } - $location.url('/realms/' + realm.realm + '/client-policies/profiles-update/' + $scope.editedProfile.name); - }, function(errorResponse) { - var errDetails = (!errorResponse.data.errorMessage) ? "unknown error, please see the server log" : errorResponse.data.errorMessage - if ($scope.createNew) { - $scope.editedProfile.executors = $scope.executors.map((ex) => ex); - $scope.executors = undefined; - Notifications.error('Failed to create executor: ' + errDetails); - } else { - Notifications.error('Failed to update executor: ' + errDetails); - } - }); - - }; - - $scope.cancel = function() { - $location.url('/realms/' + realm.realm + '/client-policies/profiles-update/' + $scope.editedProfile.name); - }; - -}); - -module.controller('ClientPoliciesListCtrl', function($scope, realm, clientPolicies, ClientPolicies, Dialog, Notifications, $route, $location) { - console.log('ClientPoliciesListCtrl'); - $scope.realm = realm; - $scope.clientPolicies = clientPolicies; - - $scope.removeClientPolicy = function(clientPolicy) { - Dialog.confirmDelete(clientPolicy.name, 'client policy', function() { - console.log("Deleting client policy from the JSON: " + clientPolicy.name); - - for (var i = 0; i < $scope.clientPolicies.policies.length; i++) { - var currentPolicy = $scope.clientPolicies.policies[i]; - if (currentPolicy.name === clientPolicy.name) { - $scope.clientPolicies.policies.splice(i, 1); - break; - } - } - - ClientPolicies.update({ - realm: realm.realm, - }, $scope.clientPolicies, function () { - $route.reload(); - Notifications.success("The client policy was deleted."); - }, function (errorResponse) { - $route.reload(); - var errDetails = (!errorResponse.data.errorMessage) ? "unknown error, please see the server log" : errorResponse.data.errorMessage - Notifications.error('Failed to delete client policy: ' + errDetails); - }); - }); - }; - -}); - -module.controller('ClientPoliciesJsonCtrl', function($scope, realm, clientPolicies, Dialog, Notifications, ClientPolicies, $route, $location) { - console.log('ClientPoliciesJsonCtrl'); - $scope.realm = realm; - $scope.clientPoliciesString = angular.toJson(clientPolicies, true); - - $scope.save = function() { - var clientPoliciesObj = null; - try { - var clientPoliciesObj = angular.fromJson($scope.clientPoliciesString); - } catch (e) { - Notifications.error("Provided JSON is incorrect: " + e.message); - console.log(e); - return; - } - var clientPoliciesCompressed = angular.toJson(clientPoliciesObj, false); - - ClientPolicies.update({ - realm: realm.realm, - }, clientPoliciesCompressed, function () { - $route.reload(); - Notifications.success("The client policies configuration was updated."); - }, function(errorResponse) { - var errDetails = (!errorResponse.data.errorMessage) ? "unknown error, please see the server log" : errorResponse.data.errorMessage - Notifications.error("Failed to update client policies: " + errDetails); - console.log("Error response when updating client policies JSON: Status: " + errorResponse.status + - ", statusText: " + errorResponse.statusText + ", data: " + JSON.stringify(errorResponse.data)); - }); - }; - - $scope.reset = function() { - $route.reload(); - }; -}); - -module.controller('ClientPoliciesEditCtrl', function($scope, realm, clientProfiles, clientPolicies, ClientPolicies, Dialog, Notifications, $route, $location) { - var targetPolicyName = $route.current.params.policyName; - $scope.createNew = targetPolicyName == null; - if ($scope.createNew) { - console.log('ClientPoliciesEditCtrl: creating new policy'); - } else { - console.log('ClientPoliciesEditCtrl: updating policy ' + targetPolicyName); - } - - $scope.realm = realm; - $scope.clientPolicies = clientPolicies; - $scope.clientProfiles = clientProfiles; - $scope.editedPolicy = null; - - if ($scope.createNew) { - $scope.editedPolicy = { - name: "", - enabled: true, - profiles: [], - conditions: [] - }; - } else { - for (var i=0 ; i < $scope.clientPolicies.policies.length ; i++) { - var currentPolicy = $scope.clientPolicies.policies[i]; - if (targetPolicyName === currentPolicy.name) { - $scope.editedPolicy = currentPolicy; - break; - } - } - - if ($scope.editedPolicy == null) { - console.log("Policy of name " + targetPolicyName + " not found"); - throw 'Policy not found'; - } - } - - // needs to be a function because when this controller runs, the permissions might not be loaded yet - $scope.isReadOnly = function() { - return !$scope.access.manageRealm; - } - - $scope.availableProfiles = []; - var allClientProfiles = clientProfiles.profiles; - if (clientProfiles.globalProfiles) { - allClientProfiles = allClientProfiles.concat(clientProfiles.globalProfiles); - } - for (var k=0 ; k 0)) { - if ($scope.rawContent.length > 1) $scope.isMultiRealm = true; - $scope.fileContent = $scope.rawContent[0]; - } else { - $scope.fileContent = $scope.rawContent; - } - - $scope.importing = true; - setOnOffSwitchDefaults(); - $scope.results = {}; - if (!$scope.hasResources()) { - $scope.nothingToImport(); - } - }; - - $scope.hasResults = function() { - return (Object.keys($scope.results).length > 0) && - ($scope.results.results !== undefined) && - ($scope.results.results.length > 0); - } - - $scope.resultsPage = function() { - if (!$scope.hasResults()) return {}; - return $scope.results.results.slice(startIndex(), endIndex()); - } - - function startIndex() { - return pageSize * $scope.currentPage; - } - - function endIndex() { - var length = $scope.results.results.length; - var endIndex = startIndex() + pageSize; - if (endIndex > length) endIndex = length; - return endIndex; - } - - function setOnOffSwitchDefaults() { - $scope.importUsers = $scope.hasArray('users'); - $scope.importGroups = $scope.hasArray('groups'); - $scope.importClients = $scope.hasArray('clients'); - $scope.importIdentityProviders = $scope.hasArray('identityProviders'); - $scope.importRealmRoles = $scope.hasRealmRoles(); - $scope.importClientRoles = $scope.hasClientRoles(); - } - - $scope.setFirstPage = function() { - $scope.currentPage = 0; - } - - $scope.setNextPage = function() { - $scope.currentPage++; - } - - $scope.setPreviousPage = function() { - $scope.currentPage--; - } - - $scope.hasNext = function() { - if (!$scope.hasResults()) return false; - var length = $scope.results.results.length; - //console.log('length=' + length); - var endIndex = startIndex() + pageSize; - //console.log('endIndex=' + endIndex); - return length > endIndex; - } - - $scope.hasPrevious = function() { - if (!$scope.hasResults()) return false; - return $scope.currentPage > 0; - } - - $scope.viewImportDetails = function() { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/view-object.html', - controller: 'ObjectModalCtrl', - resolve: { - object: function () { - return $scope.fileContent; - } - } - }) - }; - - $scope.hasArray = function(section) { - return ($scope.fileContent !== 'undefined') && - ($scope.fileContent.hasOwnProperty(section)) && - ($scope.fileContent[section] instanceof Array) && - ($scope.fileContent[section].length > 0); - } - - $scope.hasRealmRoles = function() { - return $scope.hasRoles() && - ($scope.fileContent.roles.hasOwnProperty('realm')) && - ($scope.fileContent.roles.realm instanceof Array) && - ($scope.fileContent.roles.realm.length > 0); - } - - $scope.hasRoles = function() { - return ($scope.fileContent !== 'undefined') && - ($scope.fileContent.hasOwnProperty('roles')) && - ($scope.fileContent.roles !== 'undefined'); - } - - $scope.hasClientRoles = function() { - return $scope.hasRoles() && - ($scope.fileContent.roles.hasOwnProperty('client')) && - (Object.keys($scope.fileContent.roles.client).length > 0); - } - - $scope.itemCount = function(section) { - if (!$scope.importing) return 0; - if ($scope.hasRealmRoles() && (section === 'roles.realm')) return $scope.fileContent.roles.realm.length; - if ($scope.hasClientRoles() && (section === 'roles.client')) return clientRolesCount($scope.fileContent.roles.client); - - if (!$scope.fileContent.hasOwnProperty(section)) return 0; - - return $scope.fileContent[section].length; - } - - clientRolesCount = function(clientRoles) { - var total = 0; - for (var clientName in clientRoles) { - total += clientRoles[clientName].length; - } - return total; - } - - $scope.hasResources = function() { - return ($scope.importUsers && $scope.hasArray('users')) || - ($scope.importGroups && $scope.hasArray('groups')) || - ($scope.importClients && $scope.hasArray('clients')) || - ($scope.importIdentityProviders && $scope.hasArray('identityProviders')) || - ($scope.importRealmRoles && $scope.hasRealmRoles()) || - ($scope.importClientRoles && $scope.hasClientRoles()); - } - - $scope.nothingToImport = function() { - Notifications.error('No resources specified to import.'); - } - - $scope.$watch('fileContent', function() { - if (!angular.equals($scope.fileContent, oldCopy)) { - $scope.changed = true; - } - setOnOffSwitchDefaults(); - }, true); - - $scope.successMessage = function() { - var message = $scope.results.added + ' records added. '; - if ($scope.ifResourceExists === 'SKIP') { - message += $scope.results.skipped + ' records skipped.' - } - if ($scope.ifResourceExists === 'OVERWRITE') { - message += $scope.results.overwritten + ' records overwritten.'; - } - return message; - } - - $scope.save = function() { - var json = angular.copy($scope.fileContent); - json.ifResourceExists = $scope.ifResourceExists; - if (!$scope.importUsers) delete json.users; - if (!$scope.importGroups) delete json.groups; - if (!$scope.importIdentityProviders) delete json.identityProviders; - if (!$scope.importClients) delete json.clients; - - if (json.hasOwnProperty('roles')) { - if (!$scope.importRealmRoles) delete json.roles.realm; - if (!$scope.importClientRoles) delete json.roles.client; - } - - var importFile = $resource(authUrl + '/admin/realms/' + realm.realm + '/partialImport'); - $scope.results = importFile.save(json, function() { - Notifications.success($scope.successMessage()); - }, function(error) { - if (error.data.errorMessage) { - Notifications.error(error.data.errorMessage); - } else { - Notifications.error('Unexpected error during import'); - } - }); - }; - - $scope.reset = function() { - $route.reload(); - } - -}); - -module.controller('RealmExportCtrl', function($scope, realm, $http, - $httpParamSerializer, Notifications, Dialog) { - $scope.realm = realm; - $scope.exportGroupsAndRoles = false; - $scope.exportClients = false; - - $scope.export = function() { - if ($scope.exportGroupsAndRoles || $scope.exportClients) { - Dialog.confirm('Export', 'This operation may make server unresponsive for a while.\n\nAre you sure you want to proceed?', download); - } else { - download(); - } - } - - function download() { - var exportUrl = authUrl + '/admin/realms/' + realm.realm + '/partial-export'; - var params = {}; - if ($scope.exportGroupsAndRoles) { - params['exportGroupsAndRoles'] = true; - } - if ($scope.exportClients) { - params['exportClients'] = true; - } - if (Object.keys(params).length > 0) { - exportUrl += '?' + $httpParamSerializer(params); - } - $http.post(exportUrl) - .then(function(response) { - var download = angular.fromJson(response.data); - download = angular.toJson(download, true); - saveAs(new Blob([download], { type: 'application/json' }), 'realm-export.json'); - }).catch(function() { - Notifications.error("Sorry, something went wrong."); - }); - } -}); diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/roles.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/roles.js deleted file mode 100644 index bc24c578eb..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/roles.js +++ /dev/null @@ -1,48 +0,0 @@ -module.controller('RoleMembersCtrl', function($scope, realm, role, RoleMembership, Dialog, Notifications, $location, RealmRoleRemover) { - $scope.realm = realm; - $scope.page = 0; - $scope.role = role; - - $scope.query = { - realm: realm.realm, - role: role.name, - max : 5, - first : 0 - } - - $scope.remove = function() { - RealmRoleRemover.remove($scope.role, realm, Dialog, $location, Notifications); - }; - - $scope.firstPage = function() { - $scope.query.first = 0; - $scope.searchQuery(); - } - - $scope.previousPage = function() { - $scope.query.first -= parseInt($scope.query.max); - if ($scope.query.first < 0) { - $scope.query.first = 0; - } - $scope.searchQuery(); - } - - $scope.nextPage = function() { - $scope.query.first += parseInt($scope.query.max); - $scope.searchQuery(); - } - - $scope.searchQuery = function() { - console.log("query.search: " + $scope.query.search); - $scope.searchLoaded = false; - - $scope.users = RoleMembership.query($scope.query, function() { - console.log('search loaded'); - $scope.searchLoaded = true; - $scope.lastSearch = $scope.query.search; - }); - }; - - $scope.searchQuery(); - -}); diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js deleted file mode 100755 index bd2ab8c372..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js +++ /dev/null @@ -1,2041 +0,0 @@ -module.controller('UserRoleMappingCtrl', function($scope, $http, $route, realm, user, client, Client, Notifications, RealmRoleMapping, - ClientRoleMapping, AvailableRealmRoleMapping, AvailableClientRoleMapping, - CompositeRealmRoleMapping, CompositeClientRoleMapping, $translate) { - $scope.realm = realm; - $scope.user = user; - $scope.selectedRealmRoles = []; - $scope.selectedRealmMappings = []; - $scope.realmMappings = []; - $scope.client = client; - $scope.clientRoles = []; - $scope.clientComposite = []; - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - $scope.clientMappings = []; - $scope.dummymodel = []; - $scope.selectedClient = null; - - - $scope.realmMappings = RealmRoleMapping.query({realm : realm.realm, userId : user.id}); - $scope.realmRoles = AvailableRealmRoleMapping.query({realm : realm.realm, userId : user.id}); - $scope.realmComposite = CompositeRealmRoleMapping.query({realm : realm.realm, userId : user.id}); - - $scope.addRealmRole = function() { - $scope.realmRolesToAdd = JSON.parse('[' + $scope.selectedRealmRoles + ']'); - $scope.selectedRealmRoles = []; - $http.post(authUrl + '/admin/realms/' + realm.realm + '/users/' + user.id + '/role-mappings/realm', - $scope.realmRolesToAdd).then(function() { - $scope.realmMappings = RealmRoleMapping.query({realm : realm.realm, userId : user.id}); - $scope.realmRoles = AvailableRealmRoleMapping.query({realm : realm.realm, userId : user.id}); - $scope.realmComposite = CompositeRealmRoleMapping.query({realm : realm.realm, userId : user.id}); - $scope.selectedRealmMappings = []; - $scope.selectRealmRoles = []; - if ($scope.selectedClient) { - console.log('load available'); - $scope.clientComposite = CompositeClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.clientRoles = AvailableClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.clientMappings = ClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - } - Notifications.success($translate.instant('user.roles.add.success')); - - }); - }; - - $scope.deleteRealmRole = function() { - $scope.realmRolesToRemove = JSON.parse('[' + $scope.selectedRealmMappings + ']'); - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/users/' + user.id + '/role-mappings/realm', - {data : $scope.realmRolesToRemove, headers : {"content-type" : "application/json"}}).then(function() { - $scope.realmMappings = RealmRoleMapping.query({realm : realm.realm, userId : user.id}); - $scope.realmRoles = AvailableRealmRoleMapping.query({realm : realm.realm, userId : user.id}); - $scope.realmComposite = CompositeRealmRoleMapping.query({realm : realm.realm, userId : user.id}); - $scope.selectedRealmMappings = []; - $scope.selectRealmRoles = []; - if ($scope.selectedClient) { - console.log('load available'); - $scope.clientComposite = CompositeClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.clientRoles = AvailableClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.clientMappings = ClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - } - Notifications.success($translate.instant('user.roles.remove.success')); - }); - }; - - $scope.addClientRole = function() { - $scope.clientRolesToAdd = JSON.parse('[' + $scope.selectedClientRoles + ']'); - $http.post(authUrl + '/admin/realms/' + realm.realm + '/users/' + user.id + '/role-mappings/clients/' + $scope.selectedClient.id, - $scope.clientRolesToAdd).then(function() { - $scope.clientMappings = ClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.clientRoles = AvailableClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.clientComposite = CompositeClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - $scope.realmComposite = CompositeRealmRoleMapping.query({realm : realm.realm, userId : user.id}); - $scope.realmRoles = AvailableRealmRoleMapping.query({realm : realm.realm, userId : user.id}); - Notifications.success($translate.instant('user.roles.add.success')); - }); - }; - - $scope.deleteClientRole = function() { - $scope.clientRolesToRemove = JSON.parse('[' + $scope.selectedClientMappings + ']'); - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/users/' + user.id + '/role-mappings/clients/' + $scope.selectedClient.id, - {data : $scope.clientRolesToRemove, headers : {"content-type" : "application/json"}}).then(function() { - $scope.clientMappings = ClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.clientRoles = AvailableClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.clientComposite = CompositeClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - $scope.realmComposite = CompositeRealmRoleMapping.query({realm : realm.realm, userId : user.id}); - $scope.realmRoles = AvailableRealmRoleMapping.query({realm : realm.realm, userId : user.id}); - Notifications.success($translate.instant('user.roles.remove.success')); - }); - }; - - $scope.changeClient = function(client) { - console.log("selected client: ", client); - if (!client || !client.id) { - $scope.selectedClient = null; - return; - } else { - $scope.selectedClient = client; - } - if ($scope.selectedClient) { - console.log('load available'); - $scope.clientComposite = CompositeClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.clientRoles = AvailableClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - $scope.clientMappings = ClientRoleMapping.query({realm : realm.realm, userId : user.id, client : $scope.selectedClient.id}); - } else { - $scope.clientRoles = null; - $scope.clientMappings = null; - $scope.clientComposite = null; - } - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - }; - - clientSelectControl($scope, $route.current.params.realm, Client); -}); - -module.controller('UserSessionsCtrl', function($scope, realm, user, sessions, UserSessions, UserLogout, UserSessionLogout, Notifications, $translate) { - $scope.realm = realm; - $scope.user = user; - $scope.sessions = sessions; - - $scope.logoutAll = function() { - UserLogout.save({realm : realm.realm, user: user.id}, function () { - Notifications.success($translate.instant('user.logout.all.success')); - UserSessions.query({realm: realm.realm, user: user.id}, function(updated) { - $scope.sessions = updated; - }) - }); - }; - - $scope.logoutSession = function(sessionId) { - console.log('here in logoutSession'); - UserSessionLogout.delete({realm : realm.realm, session: sessionId}, function() { - UserSessions.query({realm: realm.realm, user: user.id}, function(updated) { - $scope.sessions = updated; - Notifications.success($translate.instant('user.logout.session.success')); - }) - }); - } -}); - -module.controller('UserFederatedIdentityCtrl', function($scope, $location, realm, user, federatedIdentities, UserFederatedIdentity, Notifications, Dialog, $translate) { - $scope.realm = realm; - $scope.user = user; - $scope.federatedIdentities = federatedIdentities; - - $scope.hasAnyProvidersToCreate = function() { - return realm.identityProviders.length - $scope.federatedIdentities.length > 0; - } - - $scope.removeProviderLink = function(providerLink) { - - console.log("Removing provider link: " + providerLink.identityProvider); - - Dialog.confirmWithButtonText( - $translate.instant('user.fedid.link.remove.confirm.title', {name: providerLink.identityProvider}), - $translate.instant('user.fedid.link.remove.confirm.message', {name: providerLink.identityProvider}), - $translate.instant('dialogs.delete.confirm'), - function() { - UserFederatedIdentity.remove({ realm: realm.realm, user: user.id, provider: providerLink.identityProvider }, function() { - Notifications.success($translate.instant('user.fedid.link.remove.success')); - var indexToRemove = $scope.federatedIdentities.indexOf(providerLink); - $scope.federatedIdentities.splice(indexToRemove, 1); - }); - } - ); - } -}); - -module.controller('UserFederatedIdentityAddCtrl', function($scope, $location, realm, user, federatedIdentities, UserFederatedIdentity, Notifications, $translate) { - $scope.realm = realm; - $scope.user = user; - $scope.federatedIdentity = {}; - - var getAvailableProvidersToCreate = function() { - var realmProviders = []; - for (var i=0 ; i 0) { - $scope.previousPage(); - } - - Notifications.success($translate.instant('user.remove.success')); - }, function() { - Notifications.error($translate.instant('user.remove.error')); - }); - } - ); - }; -}); - - -module.controller('UserTabCtrl', function($scope, $location, Dialog, Notifications, Current) { - $scope.removeUser = function() { - Dialog.confirmDelete($scope.user.id, 'user', function() { - $scope.user.$remove({ - realm : Current.realm.realm, - userId : $scope.user.id - }, function() { - $location.url("/realms/" + Current.realm.realm + "/users"); - Notifications.success($translate.instant('user.remove.success')); - }, function() { - Notifications.error($translate.instant('user.remove.error')); - }); - }); - }; -}); - -function loadUserStorageLink(realm, user, console, Components, UserStorageOperations, $scope, $location) { - if(user.federationLink) { - console.log("federationLink is not null. It is " + user.federationLink); - - if ($scope.access.viewRealm) { - Components.get({realm: realm.realm, componentId: user.federationLink}, function (link) { - $scope.federationLinkName = link.name; - $scope.federationLink = "#/realms/" + realm.realm + "/user-storage/providers/" + link.providerId + "/" + link.id; - }); - } else { - // KEYCLOAK-4328 - UserStorageOperations.simpleName.get({realm: realm.realm, componentId: user.federationLink}, function (link) { - $scope.federationLinkName = link.name; - $scope.federationLink = $location.absUrl(); - }) - } - - } else { - console.log("federationLink is null"); - } - - if(user.origin) { - if ($scope.access.viewRealm) { - Components.get({realm: realm.realm, componentId: user.origin}, function (link) { - $scope.originName = link.name; - $scope.originLink = "#/realms/" + realm.realm + "/user-storage/providers/" + link.providerId + "/" + link.id; - }) - } - else { - // KEYCLOAK-4328 - UserStorageOperations.simpleName.get({realm: realm.realm, componentId: user.origin}, function (link) { - $scope.originName = link.name; - $scope.originLink = $location.absUrl(); - }) - } - } else { - console.log("origin is null"); - } -}; - -module.controller('UserDetailCtrl', function($scope, realm, user, BruteForceUser, User, - Components, - UserImpersonation, RequiredActions, - UserStorageOperations, - $location, $http, Dialog, Notifications, $translate, $route, Groups) { - $scope.realm = realm; - $scope.create = !user.id; - $scope.editUsername = $scope.create || $scope.realm.editUsernameAllowed; - $scope.emailAsUsername = $scope.realm.registrationEmailAsUsername; - $scope.groupSearch = { selectedGroup : null }; - - if ($scope.create) { - $scope.user = { enabled: true, attributes: {}, groups: [] } - } else { - if (!user.attributes) { - user.attributes = {} - } - convertAttributeValuesToString(user); - - - $scope.user = angular.copy(user); - $scope.impersonate = function() { - UserImpersonation.save({realm : realm.realm, user: $scope.user.id}, function (data) { - if (data.sameRealm) { - window.location = data.redirect; - } else { - window.open(data.redirect, "_blank"); - } - }); - }; - - loadUserStorageLink(realm, user, console, Components, UserStorageOperations, $scope, $location); - - console.log('realm brute force? ' + realm.bruteForceProtected) - $scope.temporarilyDisabled = false; - var isDisabled = function () { - BruteForceUser.get({realm: realm.realm, userId: user.id}, function(data) { - console.log('here in isDisabled ' + data.disabled); - $scope.temporarilyDisabled = data.disabled; - }); - }; - - console.log("check if disabled"); - isDisabled(); - - $scope.unlockUser = function() { - BruteForceUser.delete({realm: realm.realm, userId: user.id}, function(data) { - isDisabled(); - }); - } - } - - $scope.changed = false; // $scope.create; - if (user.requiredActions) { - for (var i = 0; i < user.requiredActions.length; i++) { - console.log("user require action: " + user.requiredActions[i]); - } - } - // ID - Name map for required actions. IDs are enum names. - RequiredActions.query({realm: realm.realm}, function(data) { - $scope.userReqActionList = []; - for (var i = 0; i < data.length; i++) { - console.log("listed required action: " + data[i].name); - if (data[i].enabled) { - var item = data[i]; - $scope.userReqActionList.push(item); - } - } - console.log("---------------------"); - console.log("ng-model: user.requiredActions=" + JSON.stringify($scope.user.requiredActions)); - console.log("---------------------"); - console.log("ng-repeat: userReqActionList=" + JSON.stringify($scope.userReqActionList)); - console.log("---------------------"); - }); - $scope.$watch('user', function() { - if (!angular.equals($scope.user, user)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - convertAttributeValuesToLists(); - - if ($scope.create) { - pushSelectedGroupsToUser(); - - User.save({ - realm: realm.realm - }, $scope.user, function (data, headers) { - $scope.changed = false; - convertAttributeValuesToString($scope.user); - user = angular.copy($scope.user); - var l = headers().location; - - console.debug("Location == " + l); - - var id = l.substring(l.lastIndexOf("/") + 1); - - - $location.url("/realms/" + realm.realm + "/users/" + id); - Notifications.success($translate.instant('user.create.success')); - }); - } else { - User.update({ - realm: realm.realm, - userId: $scope.user.id - }, $scope.user, function () { - Notifications.success($translate.instant('user.edit.success')); - $route.reload(); - }); - } - }; - - function convertAttributeValuesToLists() { - var attrs = $scope.user.attributes; - for (var attribute in attrs) { - if (typeof attrs[attribute] === "string") { - var attrVals = attrs[attribute].split("##"); - attrs[attribute] = attrVals; - } - } - } - - function convertAttributeValuesToString(user) { - var attrs = user.attributes; - for (var attribute in attrs) { - if (typeof attrs[attribute] === "object") { - var attrVals = attrs[attribute].join("##"); - attrs[attribute] = attrVals; - } - } - } - - function pushSelectedGroupsToUser() { - var groups = $scope.user.groups; - if ($scope.selectedGroups) { - for (i = 0; i < $scope.selectedGroups.length; i++) { - var groupPath = $scope.selectedGroups[i].path; - if (!groups.includes(groupPath)) { - groups.push(groupPath); - } - } - } - } - - function bfs(tree, collection) { - if (!tree["subGroups"] || tree["subGroups"].length === 0) return; - for (var i=0; i < tree["subGroups"].length; i++) { - var child = tree["subGroups"][i] - collection.push(child); - bfs(child, collection); - } - return; - } - - function flattenGroups(groups) { - var flattenedGroups = []; - if (!groups || groups.length === 0) return groups; - for (var i=0; i < groups.length; i++) { - flattenedGroups.push(groups[i]); - bfs(groups[i], flattenedGroups); - } - - return flattenedGroups; - } - - /** - * Only keep groups that : - * - include the search term in their path - * - are not already selected - */ - function filterSearchedGroups(groups, term, selectedGroups) { - if (!groups || groups.length === 0) return groups; - if (!selectedGroups) selectedGroups = []; - - return groups.filter(group => group.path?.includes(term) && !selectedGroups.some(selGroup => selGroup.id === group.id)); - } - - $scope.reset = function() { - $scope.user = angular.copy(user); - $scope.changed = false; - }; - - $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/users"); - }; - - $scope.addAttribute = function() { - $scope.user.attributes[$scope.newAttribute.key] = $scope.newAttribute.value; - delete $scope.newAttribute; - } - - $scope.removeAttribute = function(key) { - delete $scope.user.attributes[key]; - } - - $scope.groupsUiSelect = { - minimumInputLength: 1, - delay: 500, - allowClear: true, - query: function (query) { - var data = {results: []}; - if ('' == query.term.trim()) { - query.callback(data); - return; - } - $scope.query = { - realm: realm.realm, - search: query.term.trim(), - max : 20, - first : 0 - }; - Groups.query($scope.query, function(response) { - data.results = filterSearchedGroups(flattenGroups(response), query.term.trim(), $scope.selectedGroups).map(function(group) { - group.text = group.path; - return group; - }); - query.callback(data); - }); - } - }; - - $scope.removeGroup = function(list, group) { - for (i = 0; i < angular.copy(list).length; i++) { - if (group.id == list[i].id) { - list.splice(i, 1); - } - } - } - - $scope.selectGroup = function(group) { - if (!group || !group.id) { - return; - } - - $scope.groupSearch.selectedGroup = group; - - if (!$scope.selectedGroups) { - $scope.selectedGroups = []; - } - - for (i = 0; i < $scope.selectedGroups.length; i++) { - if ($scope.selectedGroups[i].id == group.id) { - return; - } - } - - $scope.selectedGroups.push(group); - $scope.groupSearch.selectedGroup = null; - } - - $scope.clearGroupSelection = function() { - $scope.groupSearch.selectedGroup = null; - $('#groups').val(null).trigger('change.select2'); - } -}); - -module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $location, RequiredActions, User, UserExecuteActionsEmail, - UserCredentials, Notifications, Dialog, TimeUnit2, Components, UserStorageOperations, $modal, $translate) { - console.log('UserCredentialsCtrl'); - - $scope.hasPassword = false; - - loadCredentials(); - - loadUserStorageLink(realm, user, console, Components, UserStorageOperations, $scope, $location); - - $scope.getUserStorageProviderName = function() { - return user.federationLink ? $scope.federationLinkName : $scope.originName; - } - - $scope.getUserStorageProviderLink = function() { - return user.federationLink ? $scope.federationLink : $scope.originLink; - } - - $scope.updateCredentialLabel = function(credential) { - UserCredentials.updateCredentialLabel({ realm: realm.realm, userId: user.id, credentialId: credential.id }, { - 'id': credential.id, - 'userLabel': credential.userLabel ? credential.userLabel : "", - // We JSONify the credential data - 'credentialData': JSON.stringify(credential.credentialData) - }, function() { - Notifications.success($translate.instant('user.credential.update.success')); - }, function(err) { - Notifications.error($translate.instant('user.credential.update.error')); - console.log(err); - }); - } - - $scope.deleteCredential = function(credential) { - Dialog.confirmWithButtonText( - $translate.instant('user.credential.remove.confirm.title', {name: credential.id}), - $translate.instant('user.credential.remove.confirm.message', {name: credential.id}), - $translate.instant('dialogs.delete.confirm'), - function() { - UserCredentials.deleteCredential({ realm: realm.realm, userId: user.id, credentialId: credential.id }, null, function() { - Notifications.success($translate.instant('user.credential.remove.success')); - $route.reload(); - }, function(err) { - Notifications.error($translate.instant('user.credential.remove.error')); - console.log(err); - }) - } - ); - } - - $scope.moveUp = function(credentials, index) { - // Safety first - if (index == 0) { - return; - } else if (index == 1) { - UserCredentials.moveToFirst( - { - realm: realm.realm, - userId: user.id, - credentialId: credentials[index].id - }, - function () { - $route.reload(); - }, - function (err) { - Notifications.error($translate.instant('user.credential.move-top.error')); - console.log(err); - }); - - } else { - UserCredentials.moveCredentialAfter( - { - realm: realm.realm, - userId: user.id, - credentialId: credentials[index].id, - newPreviousCredentialId: credentials[index - 2].id - }, - function () { - $route.reload(); - }, - function (err) { - Notifications.error($translate.instant('user.credential.move-up.error')); - console.log(err); - }); - } - } - - $scope.moveDown = function(credentials, index) { - // Safety first - if (index == credentials.length - 1) { - return; - } - UserCredentials.moveCredentialAfter( - { - realm: realm.realm, - userId: user.id, - credentialId: credentials[index].id, - newPreviousCredentialId: credentials[index + 1].id - }, - function() { - $route.reload(); - }, - function(err) { - Notifications.error($translate.instant('user.credential.move-down.error')); - console.log(err); - }); - } - - $scope.showData = function(credentialData) { - $modal.open({ - templateUrl: resourceUrl + '/partials/modal/user-credential-data.html', - controller: 'UserCredentialsDataModalCtrl', - resolve: { - credentialData: function () { - return credentialData; - } - } - }) - } - - $scope.realm = realm; - $scope.user = angular.copy(user); - $scope.temporaryPassword = true; - - $scope.isTotp = false; - if(!!user.totp){ - $scope.isTotp = user.totp; - } - // ID - Name map for required actions. IDs are enum names. - RequiredActions.query({realm: realm.realm}, function(data) { - $scope.userReqActionList = []; - for (var i = 0; i < data.length; i++) { - console.log("listed required action: " + data[i].name); - if (data[i].enabled) { - var item = data[i]; - $scope.userReqActionList.push(item); - } - } - - }); - - function loadCredentials() { - UserCredentials.getCredentials({ realm: realm.realm, userId: user.id }, null, function(credentials) { - $scope.credentials = credentials.map(function(c) { - // We de-JSONify the credential data - if (c.credentialData) { - c.credentialData = JSON.parse(c.credentialData); - } - if (c.type == 'password') { - $scope.hasPassword = true; - } - return c; - }); - }, function(err) { - Notifications.error($translate.instant('user.credential.fetch.error')); - console.log(err); - }); - - UserCredentials.getConfiguredUserStorageCredentialTypes({ realm: realm.realm, userId: user.id }, null, function(userStorageCredentialTypes) { - $scope.userStorageCredentialTypes = userStorageCredentialTypes; - $scope.hasPassword = $scope.hasPassword || userStorageCredentialTypes.lastIndexOf("password") > -1; - }, function(err) { - Notifications.error($translate.instant('user.credential.storage.fetch.error')); - console.log(err); - }); - } - - $scope.resetPassword = function() { - // hit enter without entering both fields - ignore - if (!$scope.passwordAndConfirmPasswordEntered()) return; - - if ($scope.pwdChange) { - if ($scope.password != $scope.confirmPassword) { - Notifications.error($translate.instant('user.password.error.not-matching')); - return; - } - } - - var msgTitle = ($scope.hasPassword ? $translate.instant('user.password.reset.confirm.title') : $translate.instant('user.password.set.confirm.title')); - var msg = ($scope.hasPassword ? $translate.instant('user.password.reset.confirm.message') : $translate.instant('user.password.set.confirm.message')); - var msgSuccess = ($scope.hasPassword ? $translate.instant('user.password.reset.success') : $translate.instant('user.password.set.success')); - - Dialog.confirm(msgTitle, msg, function() { - UserCredentials.resetPassword({ realm: realm.realm, userId: user.id }, { type : "password", value : $scope.password, temporary: $scope.temporaryPassword }, function() { - Notifications.success(msgSuccess); - $scope.password = null; - $scope.confirmPassword = null; - $route.reload(); - }); - }, function() { - $scope.password = null; - $scope.confirmPassword = null; - }); - }; - - $scope.passwordAndConfirmPasswordEntered = function() { - return $scope.password && $scope.confirmPassword; - } - - $scope.disableCredentialTypes = function() { - Dialog.confirm( - $translate.instant('user.credential.disable.confirm.title'), - $translate.instant('user.credential.disable.confirm.message'), - function() { - UserCredentials.disableCredentialTypes({ realm: realm.realm, userId: user.id }, $scope.disableableCredentialTypes, function() { - $route.reload(); - Notifications.success($translate.instant('user.credential.disable.confirm.success')); - }, function() { - Notifications.error($translate.instant('user.credential.disable.confirm.error')); - }); - }); - }; - - $scope.emailActions = []; - $scope.emailActionsTimeout = TimeUnit2.asUnit(realm.actionTokenGeneratedByAdminLifespan); - $scope.disableableCredentialTypes = []; - - $scope.sendExecuteActionsEmail = function() { - if ($scope.changed) { - Dialog.message($translate.instant('user.actions-email.send.pending-changes.title'), - $translate.instant('user.actions-email.send.pending-changes.message')); - return; - } - Dialog.confirm( - $translate.instant('user.actions-email.send.confirm.title'), - $translate.instant('user.actions-email.send.confirm.message'), - function() { - UserExecuteActionsEmail.update({ realm: realm.realm, userId: user.id, lifespan: $scope.emailActionsTimeout.toSeconds() }, $scope.emailActions, function() { - Notifications.success($translate.instant('user.actions-email.send.confirm.success')); - }, function() { - Notifications.error($translate.instant('user.actions-email.send.confirm.error')); - }); - }); - }; - - - - $scope.$watch('user', function() { - if (!angular.equals($scope.user, user)) { - $scope.userChange = true; - } else { - $scope.userChange = false; - } - }, true); - - $scope.$watch('password', function() { - if (!!$scope.password){ - $scope.pwdChange = true; - } else { - $scope.pwdChange = false; - } - }, true); - - $scope.reset = function() { - $scope.password = ""; - $scope.confirmPassword = ""; - - $scope.user = angular.copy(user); - - $scope.isTotp = false; - if(!!user.totp){ - $scope.isTotp = user.totp; - } - - $scope.pwdChange = false; - $scope.userChange = false; - }; -}); - -module.controller('UserCredentialsDataModalCtrl', function($scope, credentialData) { - $scope.credentialData = credentialData; - - $scope.keys = function(object) { - return object ? Object.keys(object) : []; - } -}); - -module.controller('UserFederationCtrl', function($scope, $location, $route, realm, serverInfo, Components, Notifications, Dialog, $translate) { - console.log('UserFederationCtrl ++++****'); - $scope.realm = realm; - $scope.providers = serverInfo.componentTypes['org.keycloak.storage.UserStorageProvider']; - $scope.instancesLoaded = false; - - if (!$scope.providers) $scope.providers = []; - - $scope.addProvider = function(provider) { - console.log('Add provider: ' + provider.id); - $location.url("/create/user-storage/" + realm.realm + "/providers/" + provider.id); - }; - - $scope.getInstanceLink = function(instance) { - return "/realms/" + realm.realm + "/user-storage/providers/" + instance.providerId + "/" + instance.id; - } - - $scope.getInstanceName = function(instance) { - return instance.name; - } - $scope.getInstanceProvider = function(instance) { - return instance.providerId; - } - - $scope.isProviderEnabled = function(instance) { - return !instance.config['enabled'] || instance.config['enabled'][0] == 'true'; - } - - $scope.getInstancePriority = function(instance) { - if (!instance.config['priority']) { - console.log('getInstancePriority is undefined'); - return -1; - } - return +instance.config['priority'][0]; - } - - Components.query({realm: realm.realm, - parent: realm.id, - type: 'org.keycloak.storage.UserStorageProvider' - }, function(data) { - $scope.instances = data; - $scope.instancesLoaded = true; - }); - - $scope.removeInstance = function(instance) { - Dialog.confirmWithButtonText( - $translate.instant('user.storage.remove.confirm.title', {name: instance.name}), - $translate.instant('user.storage.remove.confirm.message', {name: instance.name}), - $translate.instant('dialogs.delete.confirm'), - function() { - Components.remove({ - realm : realm.realm, - componentId : instance.id - }, function() { - $route.reload(); - Notifications.success($translate.instant('user.storage.remove.success')); - }); - } - ); - }; -}); - -module.controller('GenericUserStorageCtrl', function($scope, $location, Notifications, $route, Dialog, realm, - serverInfo, instance, providerId, Components, UserStorageOperations, $translate) { - console.log('GenericUserStorageCtrl'); - console.log('providerId: ' + providerId); - $scope.create = !instance.providerId; - console.log('create: ' + $scope.create); - var providers = serverInfo.componentTypes['org.keycloak.storage.UserStorageProvider']; - console.log('providers length ' + providers.length); - var providerFactory = null; - for (var i = 0; i < providers.length; i++) { - var p = providers[i]; - console.log('provider: ' + p.id); - if (p.id == providerId) { - $scope.providerFactory = p; - providerFactory = p; - break; - } - - } - $scope.showSync = false; - $scope.changed = false; - - console.log("providerFactory: " + providerFactory.id); - - function initUserStorageSettings() { - if ($scope.create) { - $scope.changed = true; - instance.name = providerFactory.id; - instance.providerId = providerFactory.id; - instance.providerType = 'org.keycloak.storage.UserStorageProvider'; - instance.parentId = realm.id; - instance.config = { - - }; - instance.config['priority'] = ["0"]; - instance.config['enabled'] = ["true"]; - - $scope.fullSyncEnabled = false; - $scope.changedSyncEnabled = false; - if (providerFactory.metadata.synchronizable) { - instance.config['fullSyncPeriod'] = ['-1']; - instance.config['changedSyncPeriod'] = ['-1']; - - } - instance.config['cachePolicy'] = ['DEFAULT']; - instance.config['evictionDay'] = ['']; - instance.config['evictionHour'] = ['']; - instance.config['evictionMinute'] = ['']; - instance.config['maxLifespan'] = ['']; - if (providerFactory.properties) { - - for (var i = 0; i < providerFactory.properties.length; i++) { - var configProperty = providerFactory.properties[i]; - if (configProperty.defaultValue) { - instance.config[configProperty.name] = [configProperty.defaultValue]; - } else { - instance.config[configProperty.name] = ['']; - } - - } - } - - } else { - $scope.changed = false; - $scope.fullSyncEnabled = (instance.config['fullSyncPeriod'] && instance.config['fullSyncPeriod'][0] > 0); - $scope.changedSyncEnabled = (instance.config['changedSyncPeriod'] && instance.config['changedSyncPeriod'][0]> 0); - if (providerFactory.metadata.synchronizable) { - if (!instance.config['fullSyncPeriod']) { - console.log('setting to -1'); - instance.config['fullSyncPeriod'] = ['-1']; - - } - if (!instance.config['changedSyncPeriod']) { - console.log('setting to -1'); - instance.config['changedSyncPeriod'] = ['-1']; - - } - } - if (!instance.config['enabled']) { - instance.config['enabled'] = ['true']; - } - if (!instance.config['cachePolicy']) { - instance.config['cachePolicy'] = ['DEFAULT']; - - } - if (!instance.config['evictionDay']) { - instance.config['evictionDay'] = ['']; - - } - if (!instance.config['evictionHour']) { - instance.config['evictionHour'] = ['']; - - } - if (!instance.config['evictionMinute']) { - instance.config['evictionMinute'] = ['']; - - } - if (!instance.config['maxLifespan']) { - instance.config['maxLifespan'] = ['']; - - } - if (!instance.config['priority']) { - instance.config['priority'] = ['0']; - } - - if (providerFactory.properties) { - for (var i = 0; i < providerFactory.properties.length; i++) { - var configProperty = providerFactory.properties[i]; - if (!instance.config[configProperty.name]) { - instance.config[configProperty.name] = ['']; - } - } - } - - } - if (providerFactory.metadata.synchronizable) { - if (instance.config && instance.config['importEnabled']) { - $scope.showSync = instance.config['importEnabled'][0] == 'true'; - } else { - $scope.showSync = true; - } - } - - } - - initUserStorageSettings(); - $scope.instance = angular.copy(instance); - $scope.realm = realm; - - $scope.$watch('instance', function() { - if (!angular.equals($scope.instance, instance)) { - $scope.changed = true; - } - - }, true); - - $scope.$watch('fullSyncEnabled', function(newVal, oldVal) { - if (oldVal == newVal) { - return; - } - - $scope.instance.config['fullSyncPeriod'][0] = $scope.fullSyncEnabled ? "604800" : "-1"; - $scope.changed = true; - }); - - $scope.$watch('changedSyncEnabled', function(newVal, oldVal) { - if (oldVal == newVal) { - return; - } - - $scope.instance.config['changedSyncPeriod'][0] = $scope.changedSyncEnabled ? "86400" : "-1"; - $scope.changed = true; - }); - - - $scope.save = function() { - console.log('save provider'); - $scope.changed = false; - if ($scope.create) { - console.log('saving new provider'); - Components.save({realm: realm.realm}, $scope.instance, function (data, headers) { - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - - $location.url("/realms/" + realm.realm + "/user-storage/providers/" + $scope.instance.providerId + "/" + id); - Notifications.success($translate.instant('user.storage.create.success')); - }); - } else { - console.log('update existing provider'); - Components.update({realm: realm.realm, - componentId: instance.id - }, - $scope.instance, function () { - $route.reload(); - Notifications.success($translate.instant('user.storage.edit.success')); - }); - } - }; - - $scope.reset = function() { - //initUserStorageSettings(); - //$scope.instance = angular.copy(instance); - $route.reload(); - }; - - $scope.cancel = function() { - console.log('cancel'); - if ($scope.create) { - $location.url("/realms/" + realm.realm + "/user-federation"); - } else { - $route.reload(); - } - }; - - $scope.triggerFullSync = function() { - console.log('GenericCtrl: triggerFullSync'); - triggerSync('triggerFullSync'); - } - - $scope.triggerChangedUsersSync = function() { - console.log('GenericCtrl: triggerChangedUsersSync'); - triggerSync('triggerChangedUsersSync'); - } - - function triggerSync(action) { - UserStorageOperations.sync.save({ action: action, realm: $scope.realm.realm, componentId: $scope.instance.id }, {}, function(syncResult) { - $route.reload(); - Notifications.success($translate.instant('user.storage.sync.success',{status: syncResult.status})); - }, function() { - $route.reload(); - Notifications.error($translate.instant('user.storage.sync.error')); - }); - } - $scope.removeImportedUsers = function() { - UserStorageOperations.removeImportedUsers.save({ realm: $scope.realm.realm, componentId: $scope.instance.id }, {}, function(syncResult) { - $route.reload(); - Notifications.success($translate.instant('user.storage.remove-users.success')); - }, function() { - $route.reload(); - Notifications.error($translate.instant('user.storage.remove-users.error')); - }); - }; - $scope.unlinkUsers = function() { - UserStorageOperations.unlinkUsers.save({ realm: $scope.realm.realm, componentId: $scope.instance.id }, {}, function(syncResult) { - $route.reload(); - Notifications.success($translate.instant('user.storage.unlink.success')); - }, function() { - $route.reload(); - Notifications.error($translate.instant('user.storage.unlink.error')); - }); - }; - -}); - - -function removeGroupMember(groups, member) { - for (var j = 0; j < groups.length; j++) { - //console.log('checking: ' + groups[j].path); - if (member.path == groups[j].path) { - groups.splice(j, 1); - break; - } - if (groups[j].subGroups && groups[j].subGroups.length > 0) { - //console.log('going into subgroups'); - removeGroupMember(groups[j].subGroups, member); - } - } -} - -module.controller('UserGroupMembershipCtrl', function($scope, $q, realm, user, UserGroupMembership, UserGroupMembershipCount, UserGroupMapping, Notifications, Groups, GroupsCount, ComponentUtils, $translate) { - $scope.realm = realm; - $scope.user = user; - $scope.groupList = []; - $scope.allGroupMemberships = []; - $scope.groupMemberships = []; - $scope.tree = []; - $scope.membershipTree = []; - - $scope.searchCriteria = ''; - $scope.searchCriteriaMembership = ''; - $scope.currentPage = 1; - $scope.currentMembershipPage = 1; - $scope.currentPageInput = $scope.currentPage; - $scope.currentMembershipPageInput = $scope.currentMembershipPage; - $scope.pageSize = 20; - $scope.numberOfPages = 1; - $scope.numberOfMembershipPages = 1; - - var refreshCompleteUserGroupMembership = function() { - var queryParams = { - realm : realm.realm, - userId: user.id - }; - - var promiseGetCompleteUserGroupMembership = $q.defer(); - UserGroupMembership.query(queryParams, function(entry) { - promiseGetCompleteUserGroupMembership.resolve(entry); - }, function() { - promiseGetCompleteUserGroupMembership.reject($translate.instant('user.groups.fetch.all.error', {params: queryParams})); - }); - promiseGetCompleteUserGroupMembership.promise.then(function(groups) { - for (var i = 0; i < groups.length; i++) { - $scope.allGroupMemberships.push(groups[i]); - $scope.getGroupClass(groups[i]); - } - }, function (failed) { - Notifications.error(failed); - }); - return promiseGetCompleteUserGroupMembership.promise; - }; - - var refreshUserGroupMembership = function (search) { - $scope.currentMembershipPageInput = $scope.currentMembershipPage; - var first = ($scope.currentMembershipPage * $scope.pageSize) - $scope.pageSize; - var queryParams = { - realm : realm.realm, - userId: user.id, - first : first, - max : $scope.pageSize - }; - - var countParams = { - realm : realm.realm, - userId: user.id - }; - - var isSearch = function() { - return angular.isDefined(search) && search !== ''; - }; - - if (isSearch()) { - queryParams.search = search; - countParams.search = search; - } - - var promiseGetUserGroupMembership = $q.defer(); - UserGroupMembership.query(queryParams, function(entry) { - promiseGetUserGroupMembership.resolve(entry); - }, function() { - promiseGetUserGroupMembership.reject($translate.instant('user.groups.fetch.error', {params: queryParams})); - }); - - var promiseMembershipCount = $q.defer(); - - promiseGetUserGroupMembership.promise.then(function(groups) { - $scope.groupMemberships = groups; - UserGroupMembershipCount.query(countParams, function(entry) { - promiseMembershipCount.resolve(entry); - }, function() { - promiseMembershipCount.reject($translate.instant('user.groups.fetch.error', {params: countParams})); - }); - promiseMembershipCount.promise.then(function(membershipEntry) { - if(angular.isDefined(membershipEntry.count) && membershipEntry.count > $scope.pageSize) { - $scope.numberOfMembershipPages = Math.ceil(membershipEntry.count/$scope.pageSize); - } else { - $scope.numberOfMembershipPages = 1; - } - if (parseInt($scope.currentMembershipPage, 10) > $scope.numberOfMembershipPages) { - $scope.currentMembershipPage = $scope.numberOfMembershipPages; - } - }, function (failed) { - Notifications.error(failed); - }); - }, function (failed) { - Notifications.error(failed); - }); - - return promiseMembershipCount.promise; - }; - - var refreshAvailableGroups = function (search) { - $scope.currentPageInput = $scope.currentPage; - var first = ($scope.currentPage * $scope.pageSize) - $scope.pageSize; - var queryParams = { - realm : realm.realm, - first : first, - max : $scope.pageSize - }; - - var countParams = { - realm : realm.realm, - top : 'true' - }; - - if(angular.isDefined(search) && search !== '') { - queryParams.search = search; - countParams.search = search; - } - - var promiseGetGroups = $q.defer(); - Groups.query(queryParams, function(entry) { - promiseGetGroups.resolve(entry); - }, function() { - promiseGetGroups.reject($translate.instant('user.groups.fetch.error', {params: queryParams})); - }); - - var promiseCount = $q.defer(); - - promiseGetGroups.promise.then(function(groups) { - $scope.groupList = ComponentUtils.sortGroups('name', groups); - GroupsCount.query(countParams, function(entry) { - promiseCount.resolve(entry); - }, function() { - promiseCount.reject($translate.instant('user.groups.fetch.error', {params: countParams})); - }); - promiseCount.promise.then(function(entry) { - if(angular.isDefined(entry.count) && entry.count > $scope.pageSize) { - $scope.numberOfPages = Math.ceil(entry.count/$scope.pageSize); - } else { - $scope.numberOfPages = 1; - } - }, function (failed) { - Notifications.error(failed); - }); - }, function (failed) { - Notifications.error(failed); - }); - - return promiseCount.promise; - }; - - $scope.clearSearchMembership = function() { - $scope.searchCriteriaMembership = ''; - if (parseInt($scope.currentMembershipPage, 10) === 1) { - refreshUserGroupMembership(); - } else { - $scope.currentMembershipPage = 1; - } - }; - - $scope.searchGroupMembership = function() { - if (parseInt($scope.currentMembershipPage, 10) === 1) { - refreshUserGroupMembership($scope.searchCriteriaMembership); - } else { - $scope.currentMembershipPage = 1; - } - }; - - refreshUserGroupMembership().then(function() { - refreshAvailableGroups(); - refreshCompleteUserGroupMembership(); - }); - - $scope.$watch('currentPage', function(newValue, oldValue) { - if(parseInt(newValue, 10) !== parseInt(oldValue, 10)) { - refreshAvailableGroups($scope.searchCriteria); - } - }); - - $scope.$watch('currentMembershipPage', function(newValue, oldValue) { - if(parseInt(newValue, 10) !== parseInt(oldValue, 10)) { - refreshUserGroupMembership($scope.searchCriteriaMembership); - } - }); - - $scope.clearSearch = function() { - $scope.searchCriteria = ''; - if (parseInt($scope.currentPage, 10) === 1) { - refreshAvailableGroups(); - } else { - $scope.currentPage = 1; - } - }; - - $scope.searchGroup = function() { - if (parseInt($scope.currentPage, 10) === 1) { - refreshAvailableGroups($scope.searchCriteria); - } else { - $scope.currentPage = 1; - } - }; - - $scope.joinGroup = function() { - if (!$scope.tree.currentNode) { - Notifications.error($translate.instant('user.groups.join.error.no-group-selected')); - return; - } - if (isMember($scope.tree.currentNode)) { - Notifications.error($translate.instant('user.groups.join.error.already-added')); - return; - } - UserGroupMapping.update({realm: realm.realm, userId: user.id, groupId: $scope.tree.currentNode.id}, function() { - $scope.allGroupMemberships.push($scope.tree.currentNode); - refreshUserGroupMembership($scope.searchCriteriaMembership); - Notifications.success($translate.instant('user.groups.join.success')); - }); - - }; - - $scope.leaveGroup = function() { - if (!$scope.membershipTree.currentNode) { - Notifications.error($translate.instant('user.groups.leave.error.no-group-selected')); - return; - } - UserGroupMapping.remove({realm: realm.realm, userId: user.id, groupId: $scope.membershipTree.currentNode.id}, function () { - removeGroupMember($scope.allGroupMemberships, $scope.membershipTree.currentNode); - refreshUserGroupMembership($scope.searchCriteriaMembership); - Notifications.success($translate.instant('user.groups.leave.success')); - }); - - }; - - var isLeaf = function(node) { - return node.id !== 'realm' && (!node.subGroups || node.subGroups.length === 0); - }; - - var isMember = function(node) { - for (var i = 0; i < $scope.allGroupMemberships.length; i++) { - var member = $scope.allGroupMemberships[i]; - if (node.id === member.id) { - return true; - } - } - return false; - }; - - $scope.getGroupClass = function(node) { - if (node.id == "realm") { - return 'pficon pficon-users'; - } - if (isMember(node)) { - return 'normal deactivate'; - } - if (isLeaf(node)) { - return 'normal'; - } - if (node.subGroups.length && node.collapsed) return 'collapsed'; - if (node.subGroups.length && !node.collapsed) return 'expanded'; - return 'collapsed'; - - } - - $scope.getSelectedClass = function(node) { - if (node.selected) { - if (isMember(node)) { - return "deactivate_selected"; - } else { - return 'selected'; - } - } else if ($scope.cutNode && $scope.cutNode.id === node.id) { - return 'cut'; - } - return undefined; - } - -}); - -module.controller('LDAPUserStorageCtrl', function($scope, $location, Notifications, $route, Dialog, realm, - serverInfo, instance, Components, UserStorageOperations, - RealmLDAPConnectionTester, $http) { - console.log('LDAPUserStorageCtrl'); - var providerId = 'ldap'; - console.log('providerId: ' + providerId); - $scope.create = !instance.providerId; - console.log('create: ' + $scope.create); - var providers = serverInfo.componentTypes['org.keycloak.storage.UserStorageProvider']; - console.log('providers length ' + providers.length); - var providerFactory = null; - for (var i = 0; i < providers.length; i++) { - var p = providers[i]; - console.log('provider: ' + p.id); - if (p.id == providerId) { - $scope.providerFactory = p; - providerFactory = p; - break; - } - - } - - $scope.provider = instance; - $scope.showSync = false; - - if (serverInfo.profileInfo.name == 'community') { - $scope.ldapVendors = [ - {"id": "ad", "name": "Active Directory"}, - {"id": "rhds", "name": "Red Hat Directory Server"}, - {"id": "tivoli", "name": "Tivoli"}, - {"id": "edirectory", "name": "Novell eDirectory"}, - {"id": "other", "name": "Other"} - ]; - } else { - $scope.ldapVendors = [ - {"id": "ad", "name": "Active Directory"}, - {"id": "rhds", "name": "Red Hat Directory Server"} - ]; - } - - $scope.authTypes = [ - { "id": "none", "name": "none" }, - { "id": "simple", "name": "simple" } - ]; - - $scope.searchScopes = [ - { "id": "1", "name": "One Level" }, - { "id": "2", "name": "Subtree" } - ]; - - $scope.useTruststoreOptions = [ - { "id": "always", "name": "Always" }, - { "id": "ldapsOnly", "name": "Only for ldaps" }, - { "id": "never", "name": "Never" } - ]; - - var DEFAULT_BATCH_SIZE = "1000"; - - - console.log("providerFactory: " + providerFactory.id); - - $scope.changed = false; - function initUserStorageSettings() { - if ($scope.create) { - $scope.changed = true; - instance.name = 'ldap'; - instance.providerId = 'ldap'; - instance.providerType = 'org.keycloak.storage.UserStorageProvider'; - instance.parentId = realm.id; - instance.config = { - - }; - instance.config['enabled'] = ["true"]; - instance.config['priority'] = ["0"]; - - $scope.fullSyncEnabled = false; - $scope.changedSyncEnabled = false; - instance.config['fullSyncPeriod'] = ['-1']; - instance.config['changedSyncPeriod'] = ['-1']; - instance.config['cachePolicy'] = ['DEFAULT']; - instance.config['evictionDay'] = ['']; - instance.config['evictionHour'] = ['']; - instance.config['evictionMinute'] = ['']; - instance.config['maxLifespan'] = ['']; - instance.config['batchSizeForSync'] = [DEFAULT_BATCH_SIZE]; - //instance.config['importEnabled'] = ['true']; - - if (providerFactory.properties) { - - for (var i = 0; i < providerFactory.properties.length; i++) { - var configProperty = providerFactory.properties[i]; - if (configProperty.defaultValue) { - instance.config[configProperty.name] = [configProperty.defaultValue]; - } else { - instance.config[configProperty.name] = ['']; - } - - } - } - - - } else { - $scope.changed = false; - $scope.fullSyncEnabled = (instance.config['fullSyncPeriod'] && instance.config['fullSyncPeriod'][0] > 0); - $scope.changedSyncEnabled = (instance.config['changedSyncPeriod'] && instance.config['changedSyncPeriod'][0]> 0); - if (!instance.config['fullSyncPeriod']) { - console.log('setting to -1'); - instance.config['fullSyncPeriod'] = ['-1']; - - } - if (!instance.config['enabled']) { - instance.config['enabled'] = ['true']; - } - if (!instance.config['changedSyncPeriod']) { - console.log('setting to -1'); - instance.config['changedSyncPeriod'] = ['-1']; - - } - if (!instance.config['cachePolicy']) { - instance.config['cachePolicy'] = ['DEFAULT']; - - } - if (!instance.config['evictionDay']) { - instance.config['evictionDay'] = ['']; - - } - if (!instance.config['evictionHour']) { - instance.config['evictionHour'] = ['']; - - } - if (!instance.config['evictionMinute']) { - instance.config['evictionMinute'] = ['']; - - } - if (!instance.config['maxLifespan']) { - instance.config['maxLifespan'] = ['']; - - } - if (!instance.config['priority']) { - instance.config['priority'] = ['0']; - } - if (!instance.config['importEnabled']) { - instance.config['importEnabled'] = ['true']; - } - - if (providerFactory.properties) { - - for (var i = 0; i < providerFactory.properties.length; i++) { - var configProperty = providerFactory.properties[i]; - if (!instance.config[configProperty.name]) { - if (configProperty.defaultValue) { - instance.config[configProperty.name] = [configProperty.defaultValue]; - } else { - instance.config[configProperty.name] = ['']; - } - } - - } - } - - for (var i=0 ; i<$scope.ldapVendors.length ; i++) { - if ($scope.ldapVendors[i].id === instance.config['vendor'][0]) { - $scope.vendorName = $scope.ldapVendors[i].name; - } - }; - - - - } - if (instance.config && instance.config['importEnabled']) { - $scope.showSync = instance.config['importEnabled'][0] == 'true'; - } else { - $scope.showSync = true; - } - - $scope.lastVendor = instance.config['vendor'][0]; - } - - initUserStorageSettings(); - $scope.instance = angular.copy(instance); - $scope.realm = realm; - - $scope.$watch('instance', function() { - if (!angular.equals($scope.instance, instance)) { - $scope.changed = true; - } - - if (!angular.equals($scope.instance.config['vendor'][0], $scope.lastVendor)) { - console.log("LDAP vendor changed. Previous=" + $scope.lastVendor + " New=" + $scope.instance.config['vendor'][0]); - $scope.lastVendor = $scope.instance.config['vendor'][0]; - - if ($scope.lastVendor === "ad") { - $scope.instance.config['usernameLDAPAttribute'][0] = "cn"; - $scope.instance.config['userObjectClasses'][0] = "person, organizationalPerson, user"; - } else { - $scope.instance.config['usernameLDAPAttribute'][0] = "uid"; - $scope.instance.config['userObjectClasses'][0] = "inetOrgPerson, organizationalPerson"; - } - - $scope.instance.config['rdnLDAPAttribute'][0] = $scope.instance.config['usernameLDAPAttribute'][0]; - - var vendorToUUID = { - rhds: "nsuniqueid", - tivoli: "uniqueidentifier", - edirectory: "guid", - ad: "objectGUID", - other: "entryUUID" - }; - $scope.instance.config['uuidLDAPAttribute'][0] = vendorToUUID[$scope.lastVendor]; - } - - - }, true); - - $scope.$watch('fullSyncEnabled', function(newVal, oldVal) { - if (oldVal == newVal) { - return; - } - - $scope.instance.config['fullSyncPeriod'][0] = $scope.fullSyncEnabled ? "604800" : "-1"; - $scope.changed = true; - }); - - $scope.$watch('changedSyncEnabled', function(newVal, oldVal) { - if (oldVal == newVal) { - return; - } - - $scope.instance.config['changedSyncPeriod'][0] = $scope.changedSyncEnabled ? "86400" : "-1"; - $scope.changed = true; - }); - - - $scope.save = function() { - $scope.changed = false; - if (!$scope.instance.config['batchSizeForSync'] || !parseInt($scope.instance.config['batchSizeForSync'][0])) { - $scope.instance.config['batchSizeForSync'] = [ DEFAULT_BATCH_SIZE ]; - } else { - $scope.instance.config['batchSizeForSync'][0] = parseInt($scope.instance.config.batchSizeForSync).toString(); - } - - if ($scope.create) { - Components.save({realm: realm.realm}, $scope.instance, function (data, headers) { - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - - $location.url("/realms/" + realm.realm + "/user-storage/providers/" + $scope.instance.providerId + "/" + id); - Notifications.success("The provider has been created."); - }); - } else { - Components.update({realm: realm.realm, - componentId: instance.id - }, - $scope.instance, function () { - $route.reload(); - Notifications.success("The provider has been updated."); - }); - } - }; - - $scope.reset = function() { - $route.reload(); - }; - - $scope.cancel = function() { - if ($scope.create) { - $location.url("/realms/" + realm.realm + "/user-federation"); - } else { - $route.reload(); - } - }; - - $scope.triggerFullSync = function() { - console.log('GenericCtrl: triggerFullSync'); - triggerSync('triggerFullSync'); - } - - $scope.triggerChangedUsersSync = function() { - console.log('GenericCtrl: triggerChangedUsersSync'); - triggerSync('triggerChangedUsersSync'); - } - - - function triggerSync(action) { - UserStorageOperations.sync.save({ action: action, realm: $scope.realm.realm, componentId: $scope.instance.id }, {}, function(syncResult) { - $route.reload(); - Notifications.success("Sync of users finished successfully. " + syncResult.status); - }, function() { - $route.reload(); - Notifications.error("Error during sync of users"); - }); - } - $scope.removeImportedUsers = function() { - UserStorageOperations.removeImportedUsers.save({ realm: $scope.realm.realm, componentId: $scope.instance.id }, {}, function(syncResult) { - $route.reload(); - Notifications.success("Remove imported users finished successfully. "); - }, function() { - $route.reload(); - Notifications.error("Error during remove"); - }); - }; - $scope.unlinkUsers = function() { - UserStorageOperations.unlinkUsers.save({ realm: $scope.realm.realm, componentId: $scope.instance.id }, {}, function(syncResult) { - $route.reload(); - Notifications.success("Unlink of users finished successfully. "); - }, function() { - $route.reload(); - Notifications.error("Error during unlink"); - }); - }; - - var initConnectionTest = function(testAction, ldapConfig) { - return { - action: testAction, - connectionUrl: ldapConfig.connectionUrl && ldapConfig.connectionUrl[0], - authType: ldapConfig.authType && ldapConfig.authType[0], - bindDn: ldapConfig.bindDn && ldapConfig.bindDn[0], - bindCredential: ldapConfig.bindCredential && ldapConfig.bindCredential[0], - useTruststoreSpi: ldapConfig.useTruststoreSpi && ldapConfig.useTruststoreSpi[0], - connectionTimeout: ldapConfig.connectionTimeout && ldapConfig.connectionTimeout[0], - startTls: ldapConfig.startTls && ldapConfig.startTls[0], - componentId: instance.id - }; - }; - - $scope.testConnection = function() { - console.log('LDAPCtrl: testConnection'); - RealmLDAPConnectionTester.save({realm: realm.realm}, initConnectionTest("testConnection", $scope.instance.config), function() { - Notifications.success("LDAP connection successful."); - }, function() { - Notifications.error("Error when trying to connect to LDAP. See server.log for details."); - }); - } - - $scope.testAuthentication = function() { - console.log('LDAPCtrl: testAuthentication'); - RealmLDAPConnectionTester.save({realm: realm.realm}, initConnectionTest("testAuthentication", $scope.instance.config), function() { - Notifications.success("LDAP authentication successful."); - }, function() { - Notifications.error("LDAP authentication failed. See server.log for details"); - }); - } - - $scope.queryAndSetLdapSupportedExtensions = function() { - console.log('LDAPCtrl: getLdapSupportedExtensions'); - const PASSWORD_MODIFY_OID = '1.3.6.1.4.1.4203.1.11.1'; - - $http.post( - authUrl + '/admin/realms/' + realm.realm + '/ldap-server-capabilities', - initConnectionTest("queryServerCapabilities", $scope.instance.config)).then( - function(response) { - Notifications.success("LDAP supported extensions successfully requested."); - const ldapOids = response.data; - if (angular.isArray(ldapOids)) { - const passwordModifyOid = ldapOids.filter(function(ldapOid) { return ldapOid.oid === PASSWORD_MODIFY_OID; }); - $scope.instance.config['usePasswordModifyExtendedOp'][0] = (passwordModifyOid.length > 0).toString(); - } - }, - function() { - Notifications.error("Error when trying to request supported extensions of LDAP. See server.log for details."); - }); - } - -}); - -module.controller('LDAPTabCtrl', function(Dialog, $scope, Current, Notifications, $location) { - $scope.removeUserFederation = function() { - Dialog.confirmDelete($scope.instance.name, 'ldap provider', function() { - $scope.instance.$remove({ - realm : Current.realm.realm, - componentId : $scope.instance.id - }, function() { - $location.url("/realms/" + Current.realm.realm + "/user-federation"); - Notifications.success("The provider has been deleted."); - }); - }); - }; -}); - - -module.controller('LDAPMapperListCtrl', function($scope, $location, Notifications, $route, Dialog, realm, provider, mappers) { - console.log('LDAPMapperListCtrl'); - - $scope.realm = realm; - $scope.provider = provider; - $scope.instance = provider; - - $scope.mappers = mappers; - -}); - -module.controller('LDAPMapperCtrl', function($scope, $route, realm, provider, mapperTypes, mapper, clients, Components, LDAPMapperSync, Notifications, Dialog, $location) { - console.log('LDAPMapperCtrl'); - $scope.realm = realm; - $scope.provider = provider; - $scope.clients = clients; - $scope.create = false; - $scope.changed = false; - - for (var i = 0; i < mapperTypes.length; i++) { - console.log('mapper.providerId: ' + mapper.providerId); - console.log('mapperTypes[i].id ' + mapperTypes[i].id); - if (mapperTypes[i].id == mapper.providerId) { - $scope.mapperType = mapperTypes[i]; - break; - } - } - - if ($scope.mapperType.properties) { - - for (var i = 0; i < $scope.mapperType.properties.length; i++) { - var configProperty = $scope.mapperType.properties[i]; - if (!mapper.config[configProperty.name]) { - if (configProperty.defaultValue) { - mapper.config[configProperty.name] = [configProperty.defaultValue]; - } else { - mapper.config[configProperty.name] = ['']; - } - } - - } - } - $scope.mapper = angular.copy(mapper); - - - $scope.$watch('mapper', function() { - if (!angular.equals($scope.mapper, mapper)) { - $scope.changed = true; - } - }, true); - - $scope.save = function() { - Components.update({realm: realm.realm, - componentId: mapper.id - }, - $scope.mapper, function () { - $route.reload(); - Notifications.success("The mapper has been updated."); - }); - }; - - $scope.reset = function() { - $scope.mapper = angular.copy(mapper); - $scope.changed = false; - }; - - $scope.remove = function() { - Dialog.confirmDelete($scope.mapper.name, 'ldap mapper', function() { - Components.remove({ - realm : realm.realm, - componentId : mapper.id - }, function() { - $location.url("/realms/" + realm.realm + '/ldap-mappers/' + provider.id); - Notifications.success("The provider has been deleted."); - }); - }); - }; - - $scope.triggerFedToKeycloakSync = function() { - triggerMapperSync("fedToKeycloak") - } - - $scope.triggerKeycloakToFedSync = function() { - triggerMapperSync("keycloakToFed"); - } - - function triggerMapperSync(direction) { - LDAPMapperSync.save({ direction: direction, realm: realm.realm, parentId: provider.id, mapperId : $scope.mapper.id }, {}, function(syncResult) { - Notifications.success("Data synced successfully. " + syncResult.status); - }, function(error) { - Notifications.error(error.data.errorMessage); - }); - } - -}); - -module.controller('LDAPMapperCreateCtrl', function($scope, realm, provider, mapperTypes, clients, Components, Notifications, Dialog, $location) { - console.log('LDAPMapperCreateCtrl'); - $scope.realm = realm; - $scope.provider = provider; - $scope.clients = clients; - $scope.create = true; - $scope.mapper = { config: {}}; - $scope.mapperTypes = mapperTypes; - $scope.mapperType = null; - $scope.changed = true; - - $scope.$watch('mapperType', function() { - if ($scope.mapperType != null) { - $scope.mapper.config = {}; - if ($scope.mapperType.properties) { - - for (var i = 0; i < $scope.mapperType.properties.length; i++) { - var configProperty = $scope.mapperType.properties[i]; - if (!$scope.mapper.config[configProperty.name]) { - if (configProperty.defaultValue) { - $scope.mapper.config[configProperty.name] = [configProperty.defaultValue]; - } else { - $scope.mapper.config[configProperty.name] = ['']; - } - } - - } - } - } - }, true); - - $scope.save = function() { - if ($scope.mapperType == null) { - Notifications.error("You need to select mapper type!"); - return; - } - - $scope.mapper.providerId = $scope.mapperType.id; - $scope.mapper.providerType = 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper'; - $scope.mapper.parentId = provider.id; - - if ($scope.mapper.config && $scope.mapper.config["role"] && !Array.isArray($scope.mapper.config["role"])) { - $scope.mapper.config["role"] = [$scope.mapper.config["role"]]; - } - - Components.save({realm: realm.realm}, $scope.mapper, function (data, headers) { - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - - $location.url("/realms/" + realm.realm + "/ldap-mappers/" + $scope.mapper.parentId + "/mappers/" + id); - Notifications.success("The mapper has been created."); - }); - }; - - $scope.reset = function() { - $location.url("/realms/" + realm.realm + '/ldap-mappers/' + provider.id); - }; - - -}); diff --git a/themes/src/main/resources/theme/base/admin/resources/js/loaders.js b/themes/src/main/resources/theme/base/admin/resources/js/loaders.js deleted file mode 100755 index 1f8985259e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/loaders.js +++ /dev/null @@ -1,587 +0,0 @@ -'use strict'; - -var module = angular.module('keycloak.loaders', [ 'keycloak.services', 'ngResource' ]); - -module.factory('Loader', function($q) { - var loader = {}; - loader.get = function(service, id) { - return function() { - var i = id && id(); - var delay = $q.defer(); - service.get(i, function(entry) { - delay.resolve(entry); - }, function() { - delay.reject('Unable to fetch ' + i); - }); - return delay.promise; - }; - }; - loader.query = function(service, id) { - return function() { - var i = id && id(); - var delay = $q.defer(); - service.query(i, function(entry) { - delay.resolve(entry); - }, function() { - delay.reject('Unable to fetch ' + i); - }); - return delay.promise; - }; - }; - return loader; -}); - -module.factory('RealmListLoader', function(Loader, Realm, $q) { - return Loader.get(Realm); -}); - -module.factory('ServerInfoLoader', function(Loader, ServerInfo) { - return function() { - return ServerInfo.promise; - }; -}); - -module.factory('RealmLoader', function(Loader, Realm, $route, $q) { - return Loader.get(Realm, function() { - return { - id : $route.current.params.realm - } - }); -}); - -module.factory('RealmKeysLoader', function(Loader, RealmKeys, $route, $q) { - return Loader.get(RealmKeys, function() { - return { - id : $route.current.params.realm - } - }); -}); - -module.factory('RealmSpecificLocalesLoader', function(Loader, RealmSpecificLocales, $route, $q) { - return Loader.get(RealmSpecificLocales, function() { - return { - id : $route.current.params.realm - } - }); -}); - -module.factory('RealmSpecificlocalizationTextLoader', function(Loader, RealmSpecificLocalizationText, $route, $q) { - return Loader.get(RealmSpecificLocalizationText, function() { - return { - realm : $route.current.params.realm, - locale : $route.current.params.locale, - key: $route.current.params.key - } - }); -}); - -module.factory('RealmEventsConfigLoader', function(Loader, RealmEventsConfig, $route, $q) { - return Loader.get(RealmEventsConfig, function() { - return { - id : $route.current.params.realm - } - }); -}); - -module.factory('UserListLoader', function(Loader, User, $route, $q) { - return Loader.query(User, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('RequiredActionsListLoader', function(Loader, RequiredActions, $route, $q) { - return Loader.query(RequiredActions, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('UnregisteredRequiredActionsListLoader', function(Loader, UnregisteredRequiredActions, $route, $q) { - return Loader.query(UnregisteredRequiredActions, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('RealmSessionStatsLoader', function(Loader, RealmSessionStats, $route, $q) { - return Loader.get(RealmSessionStats, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('RealmClientSessionStatsLoader', function(Loader, RealmClientSessionStats, $route, $q) { - return Loader.query(RealmClientSessionStats, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('ClientProtocolMapperLoader', function(Loader, ClientProtocolMapper, $route, $q) { - return Loader.get(ClientProtocolMapper, function() { - return { - realm : $route.current.params.realm, - client : $route.current.params.client, - id: $route.current.params.id - } - }); -}); - -module.factory('ClientScopeProtocolMapperLoader', function(Loader, ClientScopeProtocolMapper, $route, $q) { - return Loader.get(ClientScopeProtocolMapper, function() { - return { - realm : $route.current.params.realm, - clientScope : $route.current.params.clientScope, - id: $route.current.params.id - } - }); -}); - -module.factory('UserLoader', function(Loader, User, $route, $q) { - return Loader.get(User, function() { - return { - realm : $route.current.params.realm, - userId : $route.current.params.user - } - }); -}); - -module.factory('ComponentLoader', function(Loader, Components, $route, $q) { - return Loader.get(Components, function() { - return { - realm : $route.current.params.realm, - componentId: $route.current.params.componentId - } - }); -}); - -module.factory('LDAPMapperLoader', function(Loader, Components, $route, $q) { - return Loader.get(Components, function() { - return { - realm : $route.current.params.realm, - componentId: $route.current.params.mapperId - } - }); -}); - -module.factory('ComponentsLoader', function(Loader, Components, $route, $q) { - var componentsLoader = {}; - - componentsLoader.loadComponents = function(parent, componentType) { - return Loader.query(Components, function() { - return { - realm : $route.current.params.realm, - parent : parent, - type: componentType - } - })(); - }; - - return componentsLoader; -}); - -module.factory('SubComponentTypesLoader', function(Loader, SubComponentTypes, $route, $q) { - var componentsLoader = {}; - - componentsLoader.loadComponents = function(parent, componentType) { - return Loader.query(SubComponentTypes, function() { - return { - realm : $route.current.params.realm, - componentId : parent, - type: componentType - } - })(); - }; - - return componentsLoader; -}); - -module.factory('UserSessionStatsLoader', function(Loader, UserSessionStats, $route, $q) { - return Loader.get(UserSessionStats, function() { - return { - realm : $route.current.params.realm, - user : $route.current.params.user - } - }); -}); - -module.factory('UserSessionsLoader', function(Loader, UserSessions, $route, $q) { - return Loader.query(UserSessions, function() { - return { - realm : $route.current.params.realm, - user : $route.current.params.user - } - }); -}); - -module.factory('UserOfflineSessionsLoader', function(Loader, UserOfflineSessions, $route, $q) { - return Loader.query(UserOfflineSessions, function() { - return { - realm : $route.current.params.realm, - user : $route.current.params.user, - client : $route.current.params.client - } - }); -}); - -module.factory('UserFederatedIdentityLoader', function(Loader, UserFederatedIdentities, $route, $q) { - return Loader.query(UserFederatedIdentities, function() { - return { - realm : $route.current.params.realm, - user : $route.current.params.user - } - }); -}); - -module.factory('UserConsentsLoader', function(Loader, UserConsents, $route, $q) { - return Loader.query(UserConsents, function() { - return { - realm : $route.current.params.realm, - user : $route.current.params.user - } - }); -}); - - - -module.factory('RoleLoader', function(Loader, RoleById, $route, $q) { - return Loader.get(RoleById, function() { - return { - realm : $route.current.params.realm, - role : $route.current.params.role - } - }); -}); - -module.factory('RoleListLoader', function(Loader, Role, $route, $q) { - return Loader.query(Role, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('ClientRoleLoader', function(Loader, RoleById, $route, $q) { - return Loader.get(RoleById, function() { - return { - realm : $route.current.params.realm, - client : $route.current.params.client, - role : $route.current.params.role - } - }); -}); - -module.factory('ClientSessionStatsLoader', function(Loader, ClientSessionStats, $route, $q) { - return Loader.get(ClientSessionStats, function() { - return { - realm : $route.current.params.realm, - client : $route.current.params.client - } - }); -}); - -module.factory('ClientSessionCountLoader', function(Loader, ClientSessionCount, $route, $q) { - return Loader.get(ClientSessionCount, function() { - return { - realm : $route.current.params.realm, - client : $route.current.params.client - } - }); -}); - -module.factory('ClientOfflineSessionCountLoader', function(Loader, ClientOfflineSessionCount, $route, $q) { - return Loader.get(ClientOfflineSessionCount, function() { - return { - realm : $route.current.params.realm, - client : $route.current.params.client - } - }); -}); - -module.factory('ClientDefaultClientScopesLoader', function(Loader, ClientDefaultClientScopes, $route, $q) { - return Loader.query(ClientDefaultClientScopes, function() { - return { - realm : $route.current.params.realm, - client : $route.current.params.client - } - }); -}); - -module.factory('ClientOptionalClientScopesLoader', function(Loader, ClientOptionalClientScopes, $route, $q) { - return Loader.query(ClientOptionalClientScopes, function() { - return { - realm : $route.current.params.realm, - client : $route.current.params.client - } - }); -}); - -module.factory('ClientLoader', function(Loader, Client, $route, $q) { - return Loader.get(Client, function() { - return { - realm : $route.current.params.realm, - client : $route.current.params.client - } - }); -}); - -module.factory('ClientListLoader', function(Loader, Client, $route, $q) { - return Loader.query(Client, function() { - return { - realm : $route.current.params.realm, - first: 0, - max: 20 - } - }); -}); - -module.factory('ClientScopeLoader', function(Loader, ClientScope, $route, $q) { - return Loader.get(ClientScope, function() { - return { - realm : $route.current.params.realm, - clientScope : $route.current.params.clientScope - } - }); -}); - -module.factory('ClientScopeListLoader', function(Loader, ClientScope, $route, $q) { - return Loader.query(ClientScope, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('RealmDefaultClientScopesLoader', function(Loader, RealmDefaultClientScopes, $route, $q) { - return Loader.query(RealmDefaultClientScopes, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('RealmOptionalClientScopesLoader', function(Loader, RealmOptionalClientScopes, $route, $q) { - return Loader.query(RealmOptionalClientScopes, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('ClientServiceAccountUserLoader', function(Loader, ClientServiceAccountUser, $route, $q) { - return Loader.get(ClientServiceAccountUser, function() { - return { - realm : $route.current.params.realm, - client : $route.current.params.client - } - }); -}); - - -module.factory('RoleMappingLoader', function(Loader, RoleMapping, $route, $q) { - var realm = $route.current.params.realm || $route.current.params.client; - - return Loader.query(RoleMapping, function() { - return { - realm : realm, - role : $route.current.params.role - } - }); -}); - -module.factory('IdentityProviderLoader', function(Loader, IdentityProvider, $route, $q) { - return Loader.get(IdentityProvider, function () { - return { - realm: $route.current.params.realm, - alias: $route.current.params.alias - } - }); -}); - -module.factory('IdentityProviderFactoryLoader', function(Loader, IdentityProviderFactory, $route, $q) { - return Loader.get(IdentityProviderFactory, function () { - return { - realm: $route.current.params.realm, - provider_id: $route.current.params.provider_id - } - }); -}); - -module.factory('IdentityProviderMapperTypesLoader', function(Loader, IdentityProviderMapperTypes, $route, $q) { - return Loader.get(IdentityProviderMapperTypes, function () { - return { - realm: $route.current.params.realm, - alias: $route.current.params.alias - } - }); -}); - -module.factory('IdentityProviderMappersLoader', function(Loader, IdentityProviderMappers, $route, $q) { - return Loader.query(IdentityProviderMappers, function () { - return { - realm: $route.current.params.realm, - alias: $route.current.params.alias - } - }); -}); - -module.factory('IdentityProviderMapperLoader', function(Loader, IdentityProviderMapper, $route, $q) { - return Loader.get(IdentityProviderMapper, function () { - return { - realm: $route.current.params.realm, - alias: $route.current.params.alias, - mapperId: $route.current.params.mapperId - } - }); -}); - -module.factory('AuthenticationFlowsLoader', function(Loader, AuthenticationFlows, $route, $q) { - return Loader.query(AuthenticationFlows, function() { - return { - realm : $route.current.params.realm, - flow: '' - } - }); -}); - -module.factory('AuthenticationFormProvidersLoader', function(Loader, AuthenticationFormProviders, $route, $q) { - return Loader.query(AuthenticationFormProviders, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('AuthenticationFormActionProvidersLoader', function(Loader, AuthenticationFormActionProviders, $route, $q) { - return Loader.query(AuthenticationFormActionProviders, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('AuthenticatorProvidersLoader', function(Loader, AuthenticatorProviders, $route, $q) { - return Loader.query(AuthenticatorProviders, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('ClientAuthenticatorProvidersLoader', function(Loader, ClientAuthenticatorProviders, $route, $q) { - return Loader.query(ClientAuthenticatorProviders, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('AuthenticationFlowLoader', function(Loader, AuthenticationFlows, $route, $q) { - return Loader.get(AuthenticationFlows, function() { - return { - realm : $route.current.params.realm, - flow: $route.current.params.flow - } - }); -}); - -module.factory('AuthenticationConfigDescriptionLoader', function(Loader, AuthenticationConfigDescription, $route, $q) { - return Loader.get(AuthenticationConfigDescription, function () { - return { - realm: $route.current.params.realm, - provider: $route.current.params.provider - } - }); -}); - -module.factory('PerClientAuthenticationConfigDescriptionLoader', function(Loader, PerClientAuthenticationConfigDescription, $route, $q) { - return Loader.get(PerClientAuthenticationConfigDescription, function () { - return { - realm: $route.current.params.realm - } - }); -}); - -module.factory('ExecutionIdLoader', function($route) { - return function() { return $route.current.params.executionId; }; -}); - -module.factory('AuthenticationConfigLoader', function(Loader, AuthenticationConfig, $route, $q) { - return Loader.get(AuthenticationConfig, function () { - return { - realm: $route.current.params.realm, - config: $route.current.params.config - } - }); -}); - -module.factory('GroupListLoader', function(Loader, Groups, $route, $q) { - return Loader.query(Groups, function() { - return { - realm : $route.current.params.realm - } - }); -}); - -module.factory('GroupCountLoader', function(Loader, GroupsCount, $route, $q) { - return Loader.query(GroupsCount, function() { - return { - realm : $route.current.params.realm, - top : true - } - }); -}); - -module.factory('GroupLoader', function(Loader, Group, $route, $q) { - return Loader.get(Group, function() { - return { - realm : $route.current.params.realm, - groupId : $route.current.params.group - } - }); -}); - -module.factory('ClientInitialAccessLoader', function(Loader, ClientInitialAccess, $route) { - return Loader.query(ClientInitialAccess, function() { - return { - realm: $route.current.params.realm - } - }); -}); - -module.factory('ClientRegistrationPolicyProvidersLoader', function(Loader, ClientRegistrationPolicyProviders, $route) { - return Loader.query(ClientRegistrationPolicyProviders, function() { - return { - realm: $route.current.params.realm - } - }); -}); - -module.factory('ClientPoliciesProfilesLoader', function(Loader, ClientPoliciesProfiles, $route , $q) { - var clientPoliciesLoader = {}; - - clientPoliciesLoader.loadClientProfiles = function(includeGlobalProfiles) { - return Loader.get(ClientPoliciesProfiles, function() { - return { - realm : $route.current.params.realm, - includeGlobalProfiles : includeGlobalProfiles - } - })(); - }; - - return clientPoliciesLoader; -}); - -module.factory('ClientPoliciesLoader', function(Loader, ClientPolicies, $route) { - return Loader.get(ClientPolicies, function() { - return { - realm: $route.current.params.realm - } - }); -}); diff --git a/themes/src/main/resources/theme/base/admin/resources/js/services.js b/themes/src/main/resources/theme/base/admin/resources/js/services.js deleted file mode 100755 index aab9e142ad..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/js/services.js +++ /dev/null @@ -1,2267 +0,0 @@ -'use strict'; - -var module = angular.module('keycloak.services', [ 'ngResource', 'ngRoute' ]); - -module.service('Dialog', function($modal, $translate) { - var dialog = {}; - - var openDialog = function(title, message, btns, template) { - var controller = function($scope, $modalInstance, title, message, btns) { - $scope.title = title; - $scope.message = message; - $scope.btns = btns; - - $scope.ok = function () { - $modalInstance.close(); - }; - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - }; - - return $modal.open({ - templateUrl: resourceUrl + template, - controller: controller, - resolve: { - title: function() { - return title; - }, - message: function() { - return message; - }, - btns: function() { - return btns; - } - } - }).result; - } - - var escapeHtml = function(str) { - var div = document.createElement('div'); - div.appendChild(document.createTextNode(str)); - return div.innerHTML; - }; - - dialog.confirmDelete = function(name, type, success) { - var title = $translate.instant('dialogs.delete.title', {type: escapeHtml(type.charAt(0).toUpperCase() + type.slice(1))}); - var msg = $translate.instant('dialogs.delete.message', {type: type, name: name}); - var confirm = $translate.instant('dialogs.delete.confirm'); - - dialog.confirmWithButtonText(title, msg, confirm, success); - } - - dialog.confirmGenerateKeys = function(name, type, success) { - var title = 'Generate new keys for realm'; - var msg = 'Are you sure you want to permanently generate new keys for ' + name + '?'; - var btns = { - ok: { - label: 'Generate Keys', - cssClass: 'btn btn-danger' - }, - cancel: { - label: 'Cancel', - cssClass: 'btn btn-default' - } - } - - openDialog(title, msg, btns, '/templates/kc-modal.html').then(success); - } - - dialog.confirm = function(title, message, success, cancel) { - dialog.confirmWithButtonText(title, message, title, success, cancel); - } - - dialog.confirmWithButtonText = function(title, message, confirm, success, cancel) { - var btns = { - ok: { - label: confirm, - cssClass: 'btn btn-danger' - }, - cancel: { - label: $translate.instant('dialogs.cancel'), - cssClass: 'btn btn-default' - } - } - - openDialog(title, message, btns, '/templates/kc-modal.html').then(success, cancel); - } - - dialog.message = function(title, message, success, cancel) { - var btns = { - ok: { - label: $translate.instant('dialogs.ok'), - cssClass: 'btn btn-default' - } - } - - openDialog(title, message, btns, '/templates/kc-modal-message.html').then(success, cancel); - } - - dialog.open = function(title, message, btns, success, cancel) { - openDialog(title, message, btns, '/templates/kc-modal.html').then(success, cancel); - } - - return dialog -}); - -module.service('CopyDialog', function($modal) { - var dialog = {}; - dialog.open = function (title, suggested, success) { - var controller = function($scope, $modalInstance, title) { - $scope.title = title; - $scope.name = { value: 'Copy of ' + suggested }; - $scope.ok = function () { - console.log('ok with name: ' + $scope.name); - $modalInstance.close(); - success($scope.name.value); - }; - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - } - $modal.open({ - templateUrl: resourceUrl + '/templates/kc-copy.html', - controller: controller, - resolve: { - title: function() { - return title; - } - } - }); - }; - return dialog; -}); - -module.service('UpdateDialog', function($modal) { - var dialog = {}; - dialog.open = function (title, name, desc, success) { - var controller = function($scope, $modalInstance, title) { - $scope.title = title; - $scope.name = { value: name }; - $scope.description = { value: desc }; - $scope.ok = function () { - console.log('ok with name: ' + $scope.name + 'and description: ' + $scope.description); - $modalInstance.close(); - success($scope.name.value, $scope.description.value); - }; - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - } - $modal.open({ - templateUrl: resourceUrl + '/templates/kc-edit.html', - controller: controller, - resolve: { - title: function() { - return title; - } - } - }); - }; - return dialog; -}); - -module.factory('Notifications', function($rootScope, $timeout, $translate) { - // time (in ms) the notifications are shown - var delay = 5000; - - var notifications = {}; - notifications.current = { display: false }; - notifications.current.remove = function() { - if (notifications.scheduled) { - $timeout.cancel(notifications.scheduled); - delete notifications.scheduled; - } - delete notifications.current.type; - delete notifications.current.header; - delete notifications.current.message; - notifications.current.display = false; - console.debug("Remove message"); - } - - $rootScope.notification = notifications.current; - - notifications.message = function(type, header, message) { - notifications.current.remove(); - - notifications.current.type = type; - notifications.current.header = header; - notifications.current.message = message; - notifications.current.display = true; - - notifications.scheduled = $timeout(function() { - notifications.current.remove(); - }, delay); - - console.debug("Added message"); - } - - notifications.info = function(message) { - notifications.message("info", $translate.instant('notifications.info.header'), message); - }; - - notifications.success = function(message) { - notifications.message("success", $translate.instant('notifications.success.header'), message); - }; - - notifications.error = function(message) { - notifications.message("danger", $translate.instant('notifications.error.header'), message); - }; - - notifications.warn = function(message) { - notifications.message("warning", $translate.instant('notifications.warn.header'), message); - }; - - return notifications; -}); - - -module.factory('ComponentUtils', function() { - - function sortGroups(prop, arr) { - // sort current elements - arr.sort(function (a, b) { - if (a[prop] < b[prop]) { return -1; } - if (a[prop] > b[prop]) { return 1; } - return 0; - }); - // check sub groups - arr.forEach(function (item, index) { - if (!!item.subGroups) { - sortGroups(prop, item.subGroups); - } - }); - return arr; - }; - - var utils = {}; - - utils.sortGroups = sortGroups; - - utils.findIndexById = function(array, id) { - for (var i = 0; i < array.length; i++) { - if (array[i].id === id) return i; - } - return -1; - } - - utils.convertAllMultivaluedStringValuesToList = function(properties, config) { - if (!properties) { - return; - } - - for (var i=0 ; i 0) { - var lastVal = configVal[configVal.length - 1]; - if (lastVal === '') { - console.log('Remove empty value from config property: ' + prop.name); - configVal.splice(configVal.length - 1, 1); - } - } - - var attrVals = configVal.join("##"); - config[prop.name] = attrVals; - - } - } - } - } - - - - utils.addLastEmptyValueToMultivaluedLists = function(properties, config) { - if (!properties) { - return; - } - - for (var i=0 ; i 0) { - configProperty.push(''); - } - } - } - } - - - utils.removeLastEmptyValue = function(componentConfig) { - - for (var configPropertyName in componentConfig) { - var configVal = componentConfig[configPropertyName]; - if (configVal && configVal.length > 0) { - var lastVal = configVal[configVal.length - 1]; - if (lastVal === '') { - console.log('Remove empty value from config property: ' + configPropertyName); - configVal.splice(configVal.length - 1, 1); - } - } - } - } - - // Allows you to use ui-select2 with tag. - // In HTML you will then use property.mvOptions like this: - // Flows tab -module.service('LastFlowSelected', function() { - this.alias = null; -}); - -module.service('RealmRoleRemover', function() { - this.remove = function (role, realm, Dialog, $location, Notifications) { - Dialog.confirmDelete(role.name, 'role', function () { - role.$remove({ - realm: realm.realm, - role: role.id - }, function () { - $location.url("/realms/" + realm.realm + "/roles"); - Notifications.success("The role has been deleted."); - }); - }); - }; -}); - -module.factory('UserSessionStats', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:user/session-stats', { - realm : '@realm', - user : '@user' - }); -}); -module.factory('UserSessions', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:user/sessions', { - realm : '@realm', - user : '@user' - }); -}); -module.factory('UserOfflineSessions', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:user/offline-sessions/:client', { - realm : '@realm', - user : '@user', - client : '@client' - }); -}); - -module.factory('UserSessionLogout', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/sessions/:session', { - realm : '@realm', - session : '@session' - }); -}); - -module.factory('UserLogout', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:user/logout', { - realm : '@realm', - user : '@user' - }); -}); - -module.factory('UserFederatedIdentities', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:user/federated-identity', { - realm : '@realm', - user : '@user' - }); -}); -module.factory('UserFederatedIdentity', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:user/federated-identity/:provider', { - realm : '@realm', - user : '@user', - provider : '@provider' - }); -}); - -module.factory('UserConsents', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:user/consents/:client', { - realm : '@realm', - user : '@user', - client: '@client' - }); -}); - -module.factory('UserImpersonation', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:user/impersonation', { - realm : '@realm', - user : '@user' - }); -}); - -module.factory('UserCredentials', function($resource) { - var credentials = {}; - - credentials.getCredentials = $resource(authUrl + '/admin/realms/:realm/users/:userId/credentials', { - realm : '@realm', - userId : '@userId' - }).query; - - credentials.getConfiguredUserStorageCredentialTypes = $resource(authUrl + '/admin/realms/:realm/users/:userId/configured-user-storage-credential-types', { - realm : '@realm', - userId : '@userId' - }).query; - - credentials.deleteCredential = $resource(authUrl + '/admin/realms/:realm/users/:userId/credentials/:credentialId', { - realm : '@realm', - userId : '@userId', - credentialId : '@credentialId' - }).delete; - - credentials.updateCredentialLabel = $resource(authUrl + '/admin/realms/:realm/users/:userId/credentials/:credentialId/userLabel', { - realm : '@realm', - userId : '@userId', - credentialId : '@credentialId' - }, { - update : { - method : 'PUT', - headers: { - 'Content-Type': 'text/plain;charset=utf-8' - }, - transformRequest: function(credential, getHeaders) { - return credential.userLabel; - } - } - }).update; - - credentials.resetPassword = $resource(authUrl + '/admin/realms/:realm/users/:userId/reset-password', { - realm : '@realm', - userId : '@userId' - }, { - update : { - method : 'PUT' - } - }).update; - - credentials.removeTotp = $resource(authUrl + '/admin/realms/:realm/users/:userId/remove-totp', { - realm : '@realm', - userId : '@userId' - }, { - update : { - method : 'PUT' - } - }).update; - - credentials.disableCredentialTypes = $resource(authUrl + '/admin/realms/:realm/users/:userId/disable-credential-types', { - realm : '@realm', - userId : '@userId' - }, { - update : { - method : 'PUT' - } - }).update; - - credentials.moveCredentialAfter = $resource(authUrl + '/admin/realms/:realm/users/:userId/credentials/:credentialId/moveAfter/:newPreviousCredentialId', { - realm : '@realm', - userId : '@userId', - credentialId : '@credentialId', - newPreviousCredentialId : '@newPreviousCredentialId' - }, { - update : { - method : 'POST' - } - }).update; - - credentials.moveToFirst = $resource(authUrl + '/admin/realms/:realm/users/:userId/credentials/:credentialId/moveToFirst', { - realm : '@realm', - userId : '@userId', - credentialId : '@credentialId' - }, { - update : { - method : 'POST' - } - }).update; - - return credentials; -}); - -module.factory('UserExecuteActionsEmail', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:userId/execute-actions-email', { - realm : '@realm', - userId : '@userId', - lifespan : '@lifespan', - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('RealmRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:userId/role-mappings/realm', { - realm : '@realm', - userId : '@userId' - }); -}); - -module.factory('CompositeRealmRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:userId/role-mappings/realm/composite', { - realm : '@realm', - userId : '@userId' - }); -}); - -module.factory('AvailableRealmRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:userId/role-mappings/realm/available', { - realm : '@realm', - userId : '@userId' - }); -}); - - -module.factory('ClientRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:userId/role-mappings/clients/:client', { - realm : '@realm', - userId : '@userId', - client : "@client" - }); -}); - -module.factory('AvailableClientRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:userId/role-mappings/clients/:client/available', { - realm : '@realm', - userId : '@userId', - client : "@client" - }); -}); - -module.factory('CompositeClientRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:userId/role-mappings/clients/:client/composite', { - realm : '@realm', - userId : '@userId', - client : "@client" - }); -}); - -module.factory('ClientRealmScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/scope-mappings/realm', { - realm : '@realm', - client : '@client' - }); -}); - -module.factory('ClientAvailableRealmScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/scope-mappings/realm/available', { - realm : '@realm', - client : '@client' - }); -}); - -module.factory('ClientCompositeRealmScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/scope-mappings/realm/composite', { - realm : '@realm', - client : '@client' - }); -}); - -module.factory('ClientClientScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/scope-mappings/clients/:targetClient', { - realm : '@realm', - client : '@client', - targetClient : '@targetClient' - }); -}); - -module.factory('ClientAvailableClientScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/scope-mappings/clients/:targetClient/available', { - realm : '@realm', - client : '@client', - targetClient : '@targetClient' - }); -}); - -module.factory('ClientCompositeClientScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/scope-mappings/clients/:targetClient/composite', { - realm : '@realm', - client : '@client', - targetClient : '@targetClient' - }); -}); - - - -module.factory('RealmRoles', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/roles', { - realm : '@realm' - }); -}); - -module.factory('RoleRealmComposites', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/roles-by-id/:role/composites/realm', { - realm : '@realm', - role : '@role' - }); -}); - -module.factory('RealmPushRevocation', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/push-revocation', { - realm : '@realm' - }); -}); - -module.factory('RealmClearUserCache', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clear-user-cache', { - realm : '@realm' - }); -}); - -module.factory('RealmClearRealmCache', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clear-realm-cache', { - realm : '@realm' - }); -}); - -module.factory('RealmClearKeysCache', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clear-keys-cache', { - realm : '@realm' - }); -}); - -module.factory('RealmSessionStats', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/session-stats', { - realm : '@realm' - }); -}); - -module.factory('RealmClientSessionStats', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-session-stats', { - realm : '@realm' - }); -}); - - -module.factory('RoleClientComposites', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/roles-by-id/:role/composites/clients/:client', { - realm : '@realm', - role : '@role', - client : "@client" - }); -}); - -function clientSelectControl($scope, realm, Client) { - $scope.clientsUiSelect = { - minimumInputLength: 0, - delay: 500, - allowClear: true, - query: function (query) { - Client.query({realm: realm, search: true, clientId: query.term.trim(), max: 20}, function(response) { - query.callback({ results: response.map(function (client) { - client.text = client.clientId; - return client; - }) - }); - }); - } - }; -} - -function roleControl($scope, $route, realm, role, roles, Client, - ClientRole, RoleById, RoleRealmComposites, RoleClientComposites, - $http, $location, Notifications, Dialog, ComponentUtils) { - $scope.$watch(function () { - return $location.path(); - }, function () { - $scope.path = $location.path().substring(1).split("/"); - }); - - $scope.$watch('role', function () { - if (!angular.equals($scope.role, role)) { - $scope.changed = true; - } - }, true); - - $scope.update = function () { - RoleById.update({ - realm: realm.realm, - role: role.id - }, $scope.role, function () { - $scope.changed = false; - role = angular.copy($scope.role); - Notifications.success("Your changes have been saved to the role."); - }); - }; - - $scope.reset = function () { - $scope.role = angular.copy(role); - $scope.changed = false; - }; - - if (!role.id) return; - - $scope.compositeSwitch = role.composite; - $scope.compositeSwitchDisabled = role.composite; - $scope.realmRoles = angular.copy(roles); - $scope.selectedRealmRoles = []; - $scope.selectedRealmMappings = []; - $scope.realmMappings = []; - $scope.clientRoles = []; - $scope.selectedClientRoles = []; - $scope.selectedClientMappings = []; - $scope.clientMappings = []; - - for (var j = 0; j < $scope.realmRoles.length; j++) { - if ($scope.realmRoles[j].id == role.id) { - var realmRole = $scope.realmRoles[j]; - var idx = $scope.realmRoles.indexOf(realmRole); - $scope.realmRoles.splice(idx, 1); - break; - } - } - - - clientSelectControl($scope, $route.current.params.realm, Client); - - $scope.selectedClient = null; - - - $scope.realmMappings = RoleRealmComposites.query({realm : realm.realm, role : role.id}, function(){ - for (var i = 0; i < $scope.realmMappings.length; i++) { - var role = $scope.realmMappings[i]; - for (var j = 0; j < $scope.realmRoles.length; j++) { - var realmRole = $scope.realmRoles[j]; - if (realmRole.id == role.id) { - var idx = $scope.realmRoles.indexOf(realmRole); - if (idx != -1) { - $scope.realmRoles.splice(idx, 1); - break; - } - } - } - } - }); - - $scope.addRealmRole = function() { - $scope.compositeSwitchDisabled=true; - $scope.selectedRealmRolesToAdd = JSON.parse('[' + $scope.selectedRealmRoles + ']'); - $http.post(authUrl + '/admin/realms/' + realm.realm + '/roles-by-id/' + role.id + '/composites', - $scope.selectedRealmRolesToAdd).then(function() { - for (var i = 0; i < $scope.selectedRealmRolesToAdd.length; i++) { - var role = $scope.selectedRealmRolesToAdd[i]; - var idx = ComponentUtils.findIndexById($scope.realmRoles, role.id); - if (idx != -1) { - $scope.realmRoles.splice(idx, 1); - $scope.realmMappings.push(role); - } - } - $scope.selectedRealmRoles = []; - $scope.selectedRealmRolesToAdd = []; - Notifications.success("Role added to composite."); - }); - }; - - $scope.deleteRealmRole = function() { - $scope.compositeSwitchDisabled=true; - $scope.selectedRealmMappingsToRemove = JSON.parse('[' + $scope.selectedRealmMappings + ']'); - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/roles-by-id/' + role.id + '/composites', - {data : $scope.selectedRealmMappingsToRemove, headers : {"content-type" : "application/json"}}).then(function() { - for (var i = 0; i < $scope.selectedRealmMappingsToRemove.length; i++) { - var role = $scope.selectedRealmMappingsToRemove[i]; - var idx = ComponentUtils.findIndexById($scope.realmMappings, role.id); - if (idx != -1) { - $scope.realmMappings.splice(idx, 1); - $scope.realmRoles.push(role); - } - } - $scope.selectedRealmMappings = []; - $scope.selectedRealmMappingsToRemove = []; - Notifications.success("Role removed from composite."); - }); - }; - - $scope.addClientRole = function() { - $scope.compositeSwitchDisabled=true; - $scope.selectedClientRolesToAdd = JSON.parse('[' + $scope.selectedClientRoles + ']'); - $http.post(authUrl + '/admin/realms/' + realm.realm + '/roles-by-id/' + role.id + '/composites', - $scope.selectedClientRolesToAdd).then(function() { - for (var i = 0; i < $scope.selectedClientRolesToAdd.length; i++) { - var role = $scope.selectedClientRolesToAdd[i]; - var idx = ComponentUtils.findIndexById($scope.clientRoles, role.id); - if (idx != -1) { - $scope.clientRoles.splice(idx, 1); - $scope.clientMappings.push(role); - } - } - $scope.selectedClientRoles = []; - $scope.selectedClientRolesToAdd = []; - Notifications.success("Client role added."); - }); - }; - - $scope.deleteClientRole = function() { - $scope.compositeSwitchDisabled=true; - $scope.selectedClientMappingsToRemove = JSON.parse('[' + $scope.selectedClientMappings + ']'); - $http.delete(authUrl + '/admin/realms/' + realm.realm + '/roles-by-id/' + role.id + '/composites', - {data : $scope.selectedClientMappingsToRemove, headers : {"content-type" : "application/json"}}).then(function() { - for (var i = 0; i < $scope.selectedClientMappingsToRemove.length; i++) { - var role = $scope.selectedClientMappingsToRemove[i]; - var idx = ComponentUtils.findIndexById($scope.clientMappings, role.id); - if (idx != -1) { - $scope.clientMappings.splice(idx, 1); - $scope.clientRoles.push(role); - } - } - $scope.selectedClientMappings = []; - $scope.selectedClientMappingsToRemove = []; - Notifications.success("Client role removed."); - }); - }; - - - $scope.changeClient = function(client) { - console.log("selected client: ", client); - if (!client || !client.id) { - $scope.selectedClient = null; - return; - } - $scope.selectedClient = client; - $scope.clientRoles = ClientRole.query({realm : realm.realm, client : client.id}, function() { - $scope.clientMappings = RoleClientComposites.query({realm : realm.realm, role : role.id, client : client.id}, function(){ - for (var i = 0; i < $scope.clientMappings.length; i++) { - var role = $scope.clientMappings[i]; - for (var j = 0; j < $scope.clientRoles.length; j++) { - var realmRole = $scope.clientRoles[j]; - if (realmRole.id == role.id) { - var idx = $scope.clientRoles.indexOf(realmRole); - if (idx != -1) { - $scope.clientRoles.splice(idx, 1); - break; - } - } - } - } - }); - for (var j = 0; j < $scope.clientRoles.length; j++) { - if ($scope.clientRoles[j] == role.id) { - var appRole = $scope.clientRoles[j]; - var idx = $scope.clientRoles.indexof(appRole); - $scope.clientRoles.splice(idx, 1); - break; - } - } - } - ); - }; - - - - -} - - -module.factory('Role', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/roles/:role', { - realm : '@realm', - role : '@role' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('RoleById', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/roles-by-id/:role', { - realm : '@realm', - role : '@role' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('ClientRole', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/roles/:role', { - realm : '@realm', - client : "@client", - role : '@role' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('ClientDefaultClientScopes', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/default-client-scopes/:clientScopeId', { - realm : '@realm', - client : "@client", - clientScopeId : '@clientScopeId' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('ClientOptionalClientScopes', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/optional-client-scopes/:clientScopeId', { - realm : '@realm', - client : "@client", - clientScopeId : '@clientScopeId' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('ClientEvaluateProtocolMappers', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/evaluate-scopes/protocol-mappers?scope=:scopeParam', { - realm : '@realm', - client : "@client", - scopeParam : "@scopeParam" - }); -}); - -module.factory('ClientEvaluateGrantedRoles', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/evaluate-scopes/scope-mappings/:roleContainer/granted?scope=:scopeParam', { - realm : '@realm', - client : "@client", - roleContainer : "@roleContainer", - scopeParam : "@scopeParam" - }); -}); - -module.factory('ClientEvaluateNotGrantedRoles', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/evaluate-scopes/scope-mappings/:roleContainer/not-granted?scope=:scopeParam', { - realm : '@realm', - client : "@client", - roleContainer : "@roleContainer", - scopeParam : "@scopeParam" - }); -}); - -module.factory('ClientEvaluateGenerateExampleAccessToken', function($resource) { - return buildClientEvaluateGenerateExampleUrl('generate-example-access-token'); -}); - -module.factory('ClientEvaluateGenerateExampleIDToken', function($resource) { - return buildClientEvaluateGenerateExampleUrl('generate-example-id-token'); -}); - -module.factory('ClientEvaluateGenerateExampleUserInfo', function($resource) { - return buildClientEvaluateGenerateExampleUrl('generate-example-userinfo'); -}); - -function buildClientEvaluateGenerateExampleUrl(subPath) { - var urlTemplate = authUrl + '/admin/realms/:realm/clients/:client/evaluate-scopes/' + subPath + '?scope=:scopeParam&userId=:userId'; - return { - url: function (parameters) { - return urlTemplate - .replace(':realm', parameters.realm) - .replace(':client', parameters.client) - .replace(':scopeParam', parameters.scopeParam) - .replace(':userId', parameters.userId); - } - } -} - -module.factory('ClientProtocolMappersByProtocol', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/protocol-mappers/protocol/:protocol', { - realm : '@realm', - client : "@client", - protocol : "@protocol" - }); -}); - -module.factory('ClientScopeProtocolMappersByProtocol', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-scopes/:clientScope/protocol-mappers/protocol/:protocol', { - realm : '@realm', - clientScope : "@clientScope", - protocol : "@protocol" - }); -}); - -module.factory('ClientScopeRealmScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-scopes/:clientScope/scope-mappings/realm', { - realm : '@realm', - clientScope : '@clientScope' - }); -}); - -module.factory('ClientScopeAvailableRealmScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-scopes/:clientScope/scope-mappings/realm/available', { - realm : '@realm', - clientScope : '@clientScope' - }); -}); - -module.factory('ClientScopeCompositeRealmScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-scopes/:clientScope/scope-mappings/realm/composite', { - realm : '@realm', - clientScope : '@clientScope' - }); -}); - -module.factory('ClientScopeClientScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-scopes/:clientScope/scope-mappings/clients/:targetClient', { - realm : '@realm', - clientScope : '@clientScope', - targetClient : '@targetClient' - }); -}); - -module.factory('ClientScopeAvailableClientScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-scopes/:clientScope/scope-mappings/clients/:targetClient/available', { - realm : '@realm', - clientScope : '@clientScope', - targetClient : '@targetClient' - }); -}); - -module.factory('ClientScopeCompositeClientScopeMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-scopes/:clientScope/scope-mappings/clients/:targetClient/composite', { - realm : '@realm', - clientScope : '@clientScope', - targetClient : '@targetClient' - }); -}); - - -module.factory('ClientSessionStats', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/session-stats', { - realm : '@realm', - client : "@client" - }); -}); - -module.factory('ClientSessionStatsWithUsers', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/session-stats?users=true', { - realm : '@realm', - client : "@client" - }); -}); - -module.factory('ClientSessionCount', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/session-count', { - realm : '@realm', - client : "@client" - }); -}); - -module.factory('ClientUserSessions', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/user-sessions', { - realm : '@realm', - client : "@client" - }); -}); - -module.factory('ClientOfflineSessionCount', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/offline-session-count', { - realm : '@realm', - client : "@client" - }); -}); - -module.factory('ClientOfflineSessions', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/offline-sessions', { - realm : '@realm', - client : "@client" - }); -}); - -module.factory('RealmLogoutAll', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/logout-all', { - realm : '@realm' - }); -}); - -module.factory('ClientPushRevocation', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/push-revocation', { - realm : '@realm', - client : "@client" - }); -}); - -module.factory('ClientClusterNode', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/nodes/:node', { - realm : '@realm', - client : "@client" - }); -}); - -module.factory('ClientTestNodesAvailable', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/test-nodes-available', { - realm : '@realm', - client : "@client" - }); -}); - -module.factory('ClientCertificate', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/certificates/:attribute', { - realm : '@realm', - client : "@client", - attribute: "@attribute" - }); -}); - -module.factory('ClientCertificateGenerate', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/certificates/:attribute/generate', { - realm : '@realm', - client : "@client", - attribute: "@attribute" - }, - { - generate : { - method : 'POST' - } - }); -}); - -module.factory('ClientCertificateDownload', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/certificates/:attribute/download', { - realm : '@realm', - client : "@client", - attribute: "@attribute" - }, - { - download : { - method : 'POST', - responseType: 'arraybuffer' - } - }); -}); - -module.factory('Client', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client', { - realm : '@realm', - client : '@client' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('ClientScope', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-scopes/:clientScope', { - realm : '@realm', - clientScope : '@clientScope' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('RealmDefaultClientScopes', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/default-default-client-scopes/:clientScopeId', { - realm : '@realm', - clientScopeId : '@clientScopeId' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('RealmOptionalClientScopes', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/default-optional-client-scopes/:clientScopeId', { - realm : '@realm', - clientScopeId : '@clientScopeId' - }, { - update : { - method : 'PUT' - } - }); -}); - - -module.factory('ClientDescriptionConverter', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-description-converter', { - realm : '@realm' - }); -}); - -/* -module.factory('ClientInstallation', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/installation/providers/:provider', { - realm : '@realm', - client : '@client', - provider : '@provider' - }); -}); -*/ - - - -module.factory('ClientInstallation', function($resource) { - var url = authUrl + '/admin/realms/:realm/clients/:client/installation/providers/:provider'; - return { - url : function(parameters) - { - return url.replace(':realm', parameters.realm).replace(':client', parameters.client).replace(':provider', parameters.provider); - } - } -}); - -module.factory('ClientInstallationJBoss', function($resource) { - var url = authUrl + '/admin/realms/:realm/clients/:client/installation/jboss'; - return { - url : function(parameters) - { - return url.replace(':realm', parameters.realm).replace(':client', parameters.client); - } - } -}); - -module.factory('ClientSecret', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/client-secret', { - realm : '@realm', - client : '@client' - }, { - update : { - method : 'POST' - }, - invalidate: { - url: authUrl + '/admin/realms/:realm/clients/:client/client-secret/rotated', - method: 'DELETE' - } - } - ); -}); - -module.factory('ClientRegistrationAccessToken', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/registration-access-token', { - realm : '@realm', - client : '@client' - }, { - update : { - method : 'POST' - } - }); -}); - -module.factory('ClientOrigins', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/allowed-origins', { - realm : '@realm', - client : '@client' - }, { - update : { - method : 'PUT', - isArray : true - } - }); -}); - -module.factory('ClientServiceAccountUser', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/service-account-user', { - realm : '@realm', - client : '@client' - }); -}); - -module.factory('Current', function(Realm, $route, $rootScope) { - var current = { - realms: {}, - realm: null - }; - - $rootScope.$on('$routeChangeStart', function() { - current.realms = Realm.query({briefRepresentation: true}, function(realms) { - var currentRealm = null; - if ($route.current.params.realm) { - for (var i = 0; i < realms.length; i++) { - if (realms[i].realm == $route.current.params.realm) { - currentRealm = realms[i]; - } - } - } - current.realm = currentRealm; - }); - }); - - return current; -}); - -module.factory('TimeUnit', function() { - var t = {}; - - t.autoUnit = function(time) { - if (!time) { - return 'Hours'; - } - - var unit = 'Seconds'; - if (time % 60 == 0) { - unit = 'Minutes'; - time = time / 60; - if (time % 60 == 0) { - unit = 'Hours'; - time = time / 60; - if (time % 24 == 0) { - unit = 'Days'; - } - } - } - - return unit; - } - - t.toSeconds = function(time, unit) { - switch (unit) { - case 'Seconds': return time; - case 'Minutes': return time * 60; - case 'Hours': return time * 3600; - case 'Days': return time * 86400; - default: throw 'invalid unit ' + unit; - } - } - - t.toUnit = function(time, unit) { - switch (unit) { - case 'Seconds': return time; - case 'Minutes': return Math.ceil(time / 60); - case 'Hours': return Math.ceil(time / 3600); - case 'Days': return Math.ceil(time / 86400); - default: throw 'invalid unit ' + unit; - } - } - - return t; -}); - -module.factory('TimeUnit2', function() { - var t = {}; - - t.asUnit = function(time) { - - var unit = 'Minutes'; - - if (time) { - if (time == -1) { - time = -1; - } else { - if (time < 60) { - time = 60; - } - - if (time % 60 == 0) { - unit = 'Minutes'; - time = time / 60; - if (time % 60 == 0) { - unit = 'Hours'; - time = time / 60; - if (time % 24 == 0) { - unit = 'Days'; - time = time / 24; - } - } - } - } - } - - var v = { - unit: unit, - time: time, - toSeconds: function() { - switch (v.unit) { - case 'Minutes': - return v.time * 60; - case 'Hours': - return v.time * 3600; - case 'Days': - return v.time * 86400; - } - } - } - - return v; - } - - return t; -}); - -module.filter('removeSelectedPolicies', function() { - return function(policies, selectedPolicies) { - var result = []; - for(var i in policies) { - var policy = policies[i]; - var policyAvailable = true; - for(var j in selectedPolicies) { - if(policy.id === selectedPolicies[j].id && !policy.multipleSupported) { - policyAvailable = false; - } - } - if(policyAvailable) { - result.push(policy); - } - } - return result; - } -}); - -module.factory('IdentityProvider', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/identity-provider/instances/:alias', { - realm : '@realm', - alias : '@alias' - }, { - update: { - method : 'PUT' - } - }); -}); - -module.factory('IdentityProviderExport', function($resource) { - var url = authUrl + '/admin/realms/:realm/identity-provider/instances/:alias/export'; - return { - url : function(parameters) - { - return url.replace(':realm', parameters.realm).replace(':alias', parameters.alias); - } - } -}); - -module.factory('IdentityProviderFactory', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/identity-provider/providers/:provider_id', { - realm : '@realm', - provider_id : '@provider_id' - }); -}); - -module.factory('IdentityProviderMapperTypes', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/identity-provider/instances/:alias/mapper-types', { - realm : '@realm', - alias : '@alias' - }); -}); - -module.factory('IdentityProviderMappers', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/identity-provider/instances/:alias/mappers', { - realm : '@realm', - alias : '@alias' - }); -}); - -module.factory('IdentityProviderMapper', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/identity-provider/instances/:alias/mappers/:mapperId', { - realm : '@realm', - alias : '@alias', - mapperId: '@mapperId' - }, { - update: { - method : 'PUT' - } - }); -}); - -module.factory('AuthenticationFlowExecutions', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/flows/:alias/executions', { - realm : '@realm', - alias : '@alias' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('CreateExecutionFlow', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/flows/:alias/executions/flow', { - realm : '@realm', - alias : '@alias' - }); -}); - -module.factory('CreateExecution', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/flows/:alias/executions/execution', { - realm : '@realm', - alias : '@alias' - }); -}); - -module.factory('AuthenticationFlows', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/flows/:flow', { - realm : '@realm', - flow: '@flow' - }); -}); - -module.factory('AuthenticationFormProviders', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/form-providers', { - realm : '@realm' - }); -}); - -module.factory('AuthenticationFormActionProviders', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/form-action-providers', { - realm : '@realm' - }); -}); - -module.factory('AuthenticatorProviders', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/authenticator-providers', { - realm : '@realm' - }); -}); - -module.factory('ClientAuthenticatorProviders', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/client-authenticator-providers', { - realm : '@realm' - }); -}); - - -module.factory('AuthenticationFlowsCopy', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/flows/:alias/copy', { - realm : '@realm', - alias : '@alias' - }); -}); - -module.factory('AuthenticationFlowsUpdate', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/flows/:flow', { - realm : '@realm', - flow : '@flow' - }, { - update : { - method : 'PUT' - } - }); -}); - - -module.factory('AuthenticationConfigDescription', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/config-description/:provider', { - realm : '@realm', - provider: '@provider' - }); -}); -module.factory('PerClientAuthenticationConfigDescription', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/per-client-config-description', { - realm : '@realm' - }); -}); - -module.factory('AuthenticationConfig', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/config/:config', { - realm : '@realm', - config: '@config' - }, { - update: { - method : 'PUT' - } - }); -}); -module.factory('AuthenticationExecutionConfig', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/executions/:execution/config', { - realm : '@realm', - execution: '@execution' - }); -}); - -module.factory('AuthenticationExecution', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/executions/:execution', { - realm : '@realm', - execution : '@execution' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('AuthenticationExecutionRaisePriority', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/executions/:execution/raise-priority', { - realm : '@realm', - execution : '@execution' - }); -}); - -module.factory('AuthenticationExecutionLowerPriority', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/authentication/executions/:execution/lower-priority', { - realm : '@realm', - execution : '@execution' - }); -}); - - - -module.service('SelectRoleDialog', function($modal) { - var dialog = {}; - - var openDialog = function(title, message, btns) { - var controller = function($scope, $modalInstance, title, message, btns) { - $scope.title = title; - $scope.message = message; - $scope.btns = btns; - - $scope.ok = function () { - $modalInstance.close(); - }; - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - }; - - return $modal.open({ - templateUrl: resourceUrl + '/templates/kc-modal.html', - controller: controller, - resolve: { - title: function() { - return title; - }, - message: function() { - return message; - }, - btns: function() { - return btns; - } - } - }).result; - } - - var escapeHtml = function(str) { - var div = document.createElement('div'); - div.appendChild(document.createTextNode(str)); - return div.innerHTML; - }; - - dialog.confirmDelete = function(name, type, success) { - var title = 'Delete ' + escapeHtml(type.charAt(0).toUpperCase() + type.slice(1)); - var msg = 'Are you sure you want to permanently delete the ' + type + ' ' + name + '?'; - var btns = { - ok: { - label: 'Delete', - cssClass: 'btn btn-danger' - }, - cancel: { - label: 'Cancel', - cssClass: 'btn btn-default' - } - } - - openDialog(title, msg, btns).then(success); - } - - dialog.confirmGenerateKeys = function(name, type, success) { - var title = 'Generate new keys for realm'; - var msg = 'Are you sure you want to permanently generate new keys for ' + name + '?'; - var btns = { - ok: { - label: 'Generate Keys', - cssClass: 'btn btn-danger' - }, - cancel: { - label: 'Cancel', - cssClass: 'btn btn-default' - } - } - - openDialog(title, msg, btns).then(success); - } - - dialog.confirm = function(title, message, success, cancel) { - var btns = { - ok: { - label: title, - cssClass: 'btn btn-danger' - }, - cancel: { - label: 'Cancel', - cssClass: 'btn btn-default' - } - } - - openDialog(title, message, btns).then(success, cancel); - } - - return dialog -}); - -module.factory('Group', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/:groupId', { - realm : '@realm', - userId : '@groupId' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('GroupChildren', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/:groupId/children', { - realm : '@realm', - groupId : '@groupId' - }); -}); - -module.factory('GroupsCount', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/count', { - realm : '@realm' - }, - { - query: { - isArray: false, - method: 'GET', - params: {}, - transformResponse: function (data) { - return angular.fromJson(data) - } - } - }); -}); - -module.factory('Groups', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups', { - realm : '@realm' - }) -}); - -module.factory('GroupRealmRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/:groupId/role-mappings/realm', { - realm : '@realm', - groupId : '@groupId' - }); -}); - -module.factory('GroupCompositeRealmRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/:groupId/role-mappings/realm/composite', { - realm : '@realm', - groupId : '@groupId' - }); -}); - -module.factory('GroupAvailableRealmRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/:groupId/role-mappings/realm/available', { - realm : '@realm', - groupId : '@groupId' - }); -}); - - -module.factory('GroupClientRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/:groupId/role-mappings/clients/:client', { - realm : '@realm', - groupId : '@groupId', - client : "@client" - }); -}); - -module.factory('GroupAvailableClientRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/:groupId/role-mappings/clients/:client/available', { - realm : '@realm', - groupId : '@groupId', - client : "@client" - }); -}); - -module.factory('GroupCompositeClientRoleMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/:groupId/role-mappings/clients/:client/composite', { - realm : '@realm', - groupId : '@groupId', - client : "@client" - }); -}); - -module.factory('GroupMembership', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/groups/:groupId/members', { - realm : '@realm', - groupId : '@groupId' - }); -}); - -module.factory('RoleList', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/roles', { - realm : '@realm' - }); -}); - -module.factory('RoleMembership', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/roles/:role/users', { - realm : '@realm', - role : '@role' - }); -}); - -module.factory('ClientRoleList', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/roles', { - realm : '@realm', - client : '@client' - }); -}); - -module.factory('ClientRoleMembership', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/clients/:client/roles/:role/users', { - realm : '@realm', - client : '@client', - role : '@role' - }); -}); - -module.factory('UserGroupMembership', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:userId/groups', { - realm : '@realm', - userId : '@userId' - }); -}); - -module.factory('UserGroupMapping', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:userId/groups/:groupId', { - realm : '@realm', - userId : '@userId', - groupId : '@groupId' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('UserProfile', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/profile', { - realm : '@realm' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('DefaultGroups', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/default-groups/:groupId', { - realm : '@realm', - groupId : '@groupId' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('SubComponentTypes', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/components/:componentId/sub-component-types', { - realm: '@realm', - componentId: '@componentId' - }); -}); - -module.factory('Components', function($resource, ComponentUtils) { - return $resource(authUrl + '/admin/realms/:realm/components/:componentId', { - realm : '@realm', - componentId : '@componentId' - }, { - update : { - method : 'PUT', - transformRequest: function(componentInstance) { - - if (componentInstance.config) { - ComponentUtils.removeLastEmptyValue(componentInstance.config); - } - - return angular.toJson(componentInstance); - } - }, - save : { - method : 'POST', - transformRequest: function(componentInstance) { - - if (componentInstance.config) { - ComponentUtils.removeLastEmptyValue(componentInstance.config); - } - - return angular.toJson(componentInstance); - } - } - }); -}); - -module.factory('UserStorageOperations', function($resource) { - var object = {} - object.sync = $resource(authUrl + '/admin/realms/:realm/user-storage/:componentId/sync', { - realm : '@realm', - componentId : '@componentId' - }); - object.removeImportedUsers = $resource(authUrl + '/admin/realms/:realm/user-storage/:componentId/remove-imported-users', { - realm : '@realm', - componentId : '@componentId' - }); - object.unlinkUsers = $resource(authUrl + '/admin/realms/:realm/user-storage/:componentId/unlink-users', { - realm : '@realm', - componentId : '@componentId' - }); - object.simpleName = $resource(authUrl + '/admin/realms/:realm/user-storage/:componentId/name', { - realm : '@realm', - componentId : '@componentId' - }); - return object; -}); - - -module.factory('ClientStorageOperations', function($resource) { - var object = {} - object.simpleName = $resource(authUrl + '/admin/realms/:realm/client-storage/:componentId/name', { - realm : '@realm', - componentId : '@componentId' - }); - return object; -}); - - -module.factory('ClientRegistrationPolicyProviders', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-registration-policy/providers', { - realm : '@realm', - }); -}); - -module.factory('ClientPoliciesProfiles', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-policies/profiles?include-global-profiles=:includeGlobalProfiles', { - realm : '@realm', - includeGlobalProfiles : '@includeGlobalProfiles' - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('ClientPolicies', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/client-policies/policies', { - realm : '@realm', - }, { - update : { - method : 'PUT' - } - }); -}); - -module.factory('LDAPMapperSync', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/user-storage/:parentId/mappers/:mapperId/sync', { - realm : '@realm', - componentId : '@componentId', - mapperId: '@mapperId' - }); -}); - - -module.factory('UserGroupMembershipCount', function($resource) { - return $resource(authUrl + '/admin/realms/:realm/users/:userId/groups/count', { - realm : '@realm', - userId : '@userId' - }, - { - query: { - isArray: false, - method: 'GET', - params: {}, - transformResponse: function (data) { - return angular.fromJson(data) - } - } - }); -}); diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authentication-flow-bindings.html b/themes/src/main/resources/theme/base/admin/resources/partials/authentication-flow-bindings.html deleted file mode 100755 index 6bf39f3bae..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authentication-flow-bindings.html +++ /dev/null @@ -1,83 +0,0 @@ -
-

{{:: 'authentication' | translate}}

- - - -
-
- -
-
- -
-
- {{:: 'browser-flow.tooltip' | translate}} -
-
- -
-
- -
-
- {{:: 'registration-flow.tooltip' | translate}} -
-
- -
-
- -
-
- {{:: 'direct-grant-flow.tooltip' | translate}} -
- -
- -
-
- -
-
- {{:: 'reset-credentials.tooltip' | translate}} -
- -
- -
-
- -
-
- {{:: 'client-authentication.tooltip' | translate}} -
- - -
- -
-
- -
-
- {{:: 'docker-auth.tooltip' | translate}} -
- -
-
- - -
-
-
- -
- - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authentication-flows.html b/themes/src/main/resources/theme/base/admin/resources/partials/authentication-flows.html deleted file mode 100755 index eb8e72110f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authentication-flows.html +++ /dev/null @@ -1,72 +0,0 @@ -
-

{{:: 'authentication' | translate}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -    -
- - - - - - -
-
{{:: 'auth-type' | translate}}{{:: 'requirement' | translate}} 
- - - {{execution.displayName|capitalize}}({{execution.alias}}) -    - - - - - -
{{:: 'no-executions-available' | translate}}
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authenticator-config.html b/themes/src/main/resources/theme/base/admin/resources/partials/authenticator-config.html deleted file mode 100755 index 1b3440669a..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authenticator-config.html +++ /dev/null @@ -1,52 +0,0 @@ -
- - - -

{{:: 'create-authenticator-config' | translate}}

-

- {{config.alias|capitalize}} - {{config.id}} - -

- -
-
-
- -
- -
-
-
- -
- -
- {{:: 'authenticator.alias.tooltip' | translate}} -
- -
- -
-
- - -
-
- -
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/broker-permissions.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/broker-permissions.html deleted file mode 100644 index 2e389ff920..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/broker-permissions.html +++ /dev/null @@ -1,40 +0,0 @@ -
- - - - -
-
-
- -
- -
- {{:: 'permissions-enabled-role.tooltip' | translate}} -
-
-
- - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/client-permissions.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/client-permissions.html deleted file mode 100644 index 7f29fd71c7..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/client-permissions.html +++ /dev/null @@ -1,39 +0,0 @@ -
- - - - -
-
-
- -
- -
- {{:: 'permissions-enabled-role.tooltip' | translate}} -
-
-
- - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/client-role-permissions.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/client-role-permissions.html deleted file mode 100644 index c76ecec055..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/client-role-permissions.html +++ /dev/null @@ -1,40 +0,0 @@ -
- - - - -
-
-
- -
- -
- {{:: 'permissions-enabled-role.tooltip' | translate}} -
-
-
- - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/group-permissions.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/group-permissions.html deleted file mode 100644 index f2be6d99a9..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/group-permissions.html +++ /dev/null @@ -1,39 +0,0 @@ -
- - - - -
-
-
- -
- -
- {{:: 'permissions-enabled-role.tooltip' | translate}} -
-
-
- - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/realm-role-permissions.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/realm-role-permissions.html deleted file mode 100644 index e21ee63ed7..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/realm-role-permissions.html +++ /dev/null @@ -1,39 +0,0 @@ -
- - - - -
-
-
- -
- -
- {{:: 'permissions-enabled-role.tooltip' | translate}} -
-
-
- - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/users-permissions.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/users-permissions.html deleted file mode 100644 index 2665bba99a..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/mgmt/users-permissions.html +++ /dev/null @@ -1,35 +0,0 @@ -
- - - -
-
-
- -
- -
- {{:: 'permissions-enabled-users.tooltip' | translate}} -
-
-
- - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html deleted file mode 100644 index af5aace4f7..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html +++ /dev/null @@ -1,131 +0,0 @@ -
- - - -

{{:: 'authz-add-resource-permission' | translate}}

-

{{originalPolicy.name|capitalize}}

- -
-
-
- -
- -
- {{:: 'authz-permission-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-permission-description.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-permission-resource-apply-to-resource-type.tooltip' | translate}} -
-
- - -
- -
- {{:: 'authz-permission-resource-resource.tooltip' | translate}} -
-
- - -
- -
- - {{:: 'authz-permission-resource-type.tooltip' | translate}} -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
-
-
-
- -
-
{{:: 'name' | translate}}{{:: 'description' | translate}}{{:: 'actions' | translate}}
{{policy.name}}{{policy.name}}{{policy.description}} - {{:: 'remove' | translate}} -
{{:: 'authz-no-policies-assigned' | translate}}
-
- {{:: 'authz-policy-apply-policy.tooltip' | translate}} -
-
- - -
- -
- - {{:: 'authz-policy-decision-strategy.tooltip' | translate}} -
- -
- -
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-scope-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-scope-detail.html deleted file mode 100644 index bbac3446f7..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-scope-detail.html +++ /dev/null @@ -1,137 +0,0 @@ -
- - - -

{{:: 'authz-add-scope-permission' | translate}}

-

{{originalPolicy.name|capitalize}}

- -
-
-
- -
- -
- {{:: 'authz-permission-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-permission-description.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-permission-scope-apply-to-resource-type.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-permission-scope-resource.tooltip' | translate}} -
-
- -
- -
- - {{:: 'authz-permission-resource-type.tooltip' | translate}} -
-
- -
- -
- - {{:: 'authz-permission-scope-scope.tooltip' | translate}} -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
-
-
-
- -
-
{{:: 'name' | translate}}{{:: 'description' | translate}}{{:: 'actions' | translate}}
{{policy.name}}{{policy.name}}{{policy.description}} - {{:: 'remove' | translate}} -
{{:: 'authz-no-policies-assigned' | translate}}
-
- {{:: 'authz-policy-apply-policy.tooltip' | translate}} -
-
- - -
- -
- - {{:: 'authz-policy-decision-strategy.tooltip' | translate}} -
- -
-
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/resource-server-permission-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/resource-server-permission-list.html deleted file mode 100644 index 40dfacdf5a..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/resource-server-permission-list.html +++ /dev/null @@ -1,118 +0,0 @@ -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- {{:: 'filter' | translate}}:   -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
-
- -
-
-
{{:: 'name' | translate}}{{:: 'description' | translate}}{{:: 'type' | translate}}{{:: 'actions' | translate}}
-
- - - -
-
- - - {{policy.name}}{{policy.description}}{{policy.type}} - -
-
-
- -
-
-
-
-
{{:: 'authz-associated-policies' | translate}}
-
- {{:: 'authz-no-policies-available' | translate}} - {{dep.name}}{{$last ? '' : ', '}} -
-
-
-
-
-
{{:: 'no-results' | translate}}{{:: 'authz-no-permissions-available' | translate}}
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html deleted file mode 100644 index 25be65b18d..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html +++ /dev/null @@ -1,123 +0,0 @@ -
- - - -

{{:: 'authz-add-aggregated-policy' | translate}}

-

{{originalPolicy.name|capitalize}}

- -
-
-
- -
- -
- {{:: 'authz-policy-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-description.tooltip' | translate}} -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
-
-
-
- -
-
{{:: 'name' | translate}}{{:: 'description' | translate}}{{:: 'actions' | translate}}
{{policy.name}}{{policy.name}}{{policy.description}} - {{:: 'remove' | translate}} -
{{:: 'authz-no-policies-assigned' | translate}}
-
- {{:: 'authz-policy-apply-policy.tooltip' | translate}} -
-
- -
- -
- - {{:: 'authz-policy-decision-strategy.tooltip' | translate}} -
-
- - -
- -
- - {{:: 'authz-policy-logic.tooltip' | translate}} -
- -
- -
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html deleted file mode 100644 index 9c5630a00a..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html +++ /dev/null @@ -1,93 +0,0 @@ -
- - - -

{{:: 'authz-add-client-policy' | translate}}

-

{{originalPolicy.name|capitalize}}

- -
-
-
- -
- -
- {{:: 'authz-policy-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-description.tooltip' | translate}} -
-
- - -
- - -
- {{:: 'authz-policy-client-clients.tooltip' | translate}} -
-
- -
- - - - - - - - - - - - - - - - -
{{:: 'clientId' | translate}}{{:: 'actions' | translate}}
{{client.clientId}} - -
{{:: 'authz-no-clients-assigned' | translate}}
-
-
-
- - -
- -
- - {{:: 'authz-policy-logic.tooltip' | translate}} -
- -
- -
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-scope-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-scope-detail.html deleted file mode 100644 index e48f550a07..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-scope-detail.html +++ /dev/null @@ -1,126 +0,0 @@ - - -
- - - -

{{:: 'authz-add-client-scope-policy' | translate}}

-

- {{originalPolicy.name|capitalize}} -

- -
-
-
- -
- -
- {{:: 'authz-policy-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-description.tooltip' | translate}} -
-
- - -
- -
- - {{:: 'authz-policy-client-scope-client-scopes.tooltip' | translate}} -
-
- -
- - - - - - - - - - - - - - - - - - -
{{:: 'name' | translate}}{{:: 'authz-required' | translate}}{{:: 'actions' | translate}}
{{clientScope.name}} - -
{{:: 'authz-no-client-scopes-assigned' | translate}}
-
-
-
- - -
- -
- - {{:: 'authz-policy-logic.tooltip' | translate}} -
- -
-
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html deleted file mode 100644 index cc1353b830..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html +++ /dev/null @@ -1,126 +0,0 @@ - - -
- - - -

{{:: 'authz-add-group-policy' | translate}}

-

{{originalPolicy.name|capitalize}}

- -
-
-
- -
- -
- {{:: 'authz-policy-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-description.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-group-claim.tooltip' | translate}} -
-
- -
-
-
- - -
- {{:: 'authz-policy-user-users.tooltip' | translate}} -
-
- -
- - - - - - - - - - - - - - - - - - -
{{:: 'path' | translate}}Extend to Children{{:: 'actions' | translate}}
{{group.path}} - - - -
{{:: 'authz-no-groups-assigned' | translate}}
-
-
-
- - -
- -
- - {{:: 'authz-policy-logic.tooltip' | translate}} -
- -
-
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html deleted file mode 100644 index a0eb0d9238..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html +++ /dev/null @@ -1,68 +0,0 @@ -
- - - -

{{:: 'authz-add-js-policy' | translate}}

-

{{originalPolicy.name|capitalize}}

- -
-
-
- -
- -
- {{:: 'authz-policy-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-description.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-js-code.tooltip' | translate}} -
-
- - -
- -
- - {{:: 'authz-policy-logic.tooltip' | translate}} -
- -
- -
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-regex-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-regex-detail.html deleted file mode 100644 index 83c6bbf3b1..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-regex-detail.html +++ /dev/null @@ -1,100 +0,0 @@ - - -
- - - -

{{:: 'authz-add-regex-policy' | translate}}

-

- {{originalPolicy.name|capitalize}} -

- -
-
-
- -
- -
- {{:: 'authz-policy-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-description.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-target-claim.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-regex-pattern.tooltip' | translate}} -
-
- - -
- -
- - {{:: 'authz-policy-logic.tooltip' | translate}} -
- -
-
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html deleted file mode 100644 index 9448682449..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html +++ /dev/null @@ -1,169 +0,0 @@ - - -
- - - -

{{:: 'authz-add-role-policy' | translate}}

-

{{originalPolicy.name|capitalize}}

- -
-
-
- -
- -
- {{:: 'authz-policy-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-description.tooltip' | translate}} -
-
- - -
- -
- - {{:: 'authz-policy-role-realm-roles.tooltip' | translate}} -
-
- -
- - - - - - - - - - - - - - - - - - -
{{:: 'name' | translate}}{{:: 'authz-required' | translate}}{{:: 'actions' | translate}}
{{role.name}} - -
{{:: 'authz-no-roles-assigned' | translate}}
-
-
-
- - -
- -
- {{:: 'authz-policy-role-clients.tooltip' | translate}} -
-
- - -
- -
- - {{:: 'authz-policy-role-client-roles.tooltip' | translate}} -
-
- -
- - - - - - - - - - - - - - - - - - - - -
{{:: 'name' | translate}}{{:: 'client' | translate}}{{:: 'authz-required' | translate}}{{:: 'actions' | translate}}
{{role.name}}{{role.container.name}} - -
{{:: 'authz-no-roles-assigned' | translate}}
-
-
-
- - -
- -
- - {{:: 'authz-policy-logic.tooltip' | translate}} -
- -
-
-
- - -
-
- {{policyState.page.previous}} -
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html deleted file mode 100644 index 4af9014470..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html +++ /dev/null @@ -1,119 +0,0 @@ - -
- - - - -

{{:: 'authz-add-time-policy' | translate}}

-

{{originalPolicy.name|capitalize}}

- -
-
-
- -
- -
- {{:: 'authz-policy-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-description.tooltip' | translate}} -
-
- - -
- -
- {{:: 'authz-policy-time-not-before.tooltip' | translate}} -
-
- - -
- -
- {{:: 'authz-policy-time-not-on-after.tooltip' | translate}} -
-
- - -
-   to   -
- {{:: 'authz-policy-time-day-month.tooltip' | translate}} -
-
- - -
-   to   -
- {{:: 'authz-policy-time-month.tooltip' | translate}} -
-
- - -
-   to   -
- {{:: 'authz-policy-time-year.tooltip' | translate}} -
-
- - -
-   to   -
- {{:: 'authz-policy-time-hour.tooltip' | translate}} -
-
- - -
-   to   -
- {{:: 'authz-policy-time-minute.tooltip' | translate}} -
-
- - -
- -
- - {{:: 'authz-policy-logic.tooltip' | translate}} -
- -
- -
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html deleted file mode 100644 index 80d81ac583..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html +++ /dev/null @@ -1,93 +0,0 @@ -
- - - -

{{:: 'authz-add-user-policy' | translate}}

-

{{originalPolicy.name|capitalize}}

- -
-
-
- -
- -
- {{:: 'authz-policy-name.tooltip' | translate}} -
-
- -
- -
- {{:: 'authz-policy-description.tooltip' | translate}} -
-
- - -
- - -
- {{:: 'authz-policy-user-users.tooltip' | translate}} -
-
- -
- - - - - - - - - - - - - - - - -
{{:: 'username' | translate}}{{:: 'actions' | translate}}
{{user.username}} - -
{{:: 'authz-no-users-assigned' | translate}}
-
-
-
- - -
- -
- - {{:: 'authz-policy-logic.tooltip' | translate}} -
- -
- -
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-evaluate-result.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-evaluate-result.html deleted file mode 100644 index 19ff72020b..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-evaluate-result.html +++ /dev/null @@ -1,72 +0,0 @@ -
-
- {{:: 'authz-evaluation-no-result' | translate}} -
- {{result.resource.name}} - -
- - -
-
- {{result.status}} - {{result.status}} -
-
- {{:: 'authz-evaluation-result.tooltip' | translate}} -
-
- - -
- {{:: 'authz-no-scopes-available' | translate}} - -
-
    -
  • - {{scope.name}} -
  • -
-
-
- {{:: 'authz-evaluation-scopes.tooltip' | translate}} -
-
- - -
- {{:: 'authz-evaluation-no-policies-resource' | translate}} -
-
-
  • - - {{policyResult.policy.name}} - - {{policyResult.policy.description}} - - - decision was {{policyResult.status}} - {{policyResult.status}} - by {{policyResult.policy.decisionStrategy}} decision. {{policyResult.policy.scopes.length > 0 ? (policyResult.status == 'DENY' ? 'Denied Scopes:' : 'Granted Scopes:') : ''}} {{scope}}{{$last ? '' : ', '}}{{policyResult.policy.scopes.length > 0 ? '.' : ''}} - -
  • - -
    -
    - {{:: 'authz-evaluation-policies.tooltip' | translate}} -
    -
    -
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-evaluate.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-evaluate.html deleted file mode 100644 index aedbdeadf9..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-evaluate.html +++ /dev/null @@ -1,267 +0,0 @@ -
    - - - - - - - - - -
    -
    - -
    - -
    - {{:: 'authz-evaluation-authorization-data.tooltip' | translate}} -
    -
    - -
    -
    -
    -
    - {{:: 'authz-evaluation-identity-information' | translate}} - {{:: 'authz-evaluation-identity-information.tooltip' | translate}} - -
    - - -
    -
    - -
    -
    - {{:: 'authz-evaluation-client.tooltip' | translate}} -
    -
    - - -
    - - -
    - - {{:: 'authz-evaluation-user.tooltip' | translate}} -
    - -
    - - -
    - -
    - - {{:: 'authz-evaluation-role.tooltip' | translate}} -
    -
    -
    - {{:: 'authz-evaluation-contextual-info' | translate}} - {{:: 'authz-evaluation-contextual-info.tooltip' | translate}} - -
    - - -
    - - - - - - - - - - - - - - - - - - - - -
    {{:: 'key' | translate}}{{:: 'value' | translate}}{{:: 'actions' | translate}}
    {{getContextAttributeName(key)}} - - - - -
    - - - - - - - -
    -
    - - {{:: 'authz-evaluation-contextual-attributes.tooltip' | translate}} -
    -
    -
    - {{:: 'authz-permissions' | translate}} - {{:: 'authz-evaluation-permissions.tooltip' | translate}} - -
    - - -
    - -
    - {{:: 'authz-permission-resource-apply-to-resource-type.tooltip' | translate}} - -
    -
    - - -
    - -
    - {{:: 'authz-permission-resource-resource.tooltip' | translate}} -
    -
    - - -
    - -
    - - {{:: 'authz-permission-resource-type.tooltip' | translate}} -
    -
    - - -
    - -
    - - {{:: 'authz-permission-scope-scope.tooltip' | translate}} -
    -
    - - -
    - -
    - - {{:: 'authz-permission-scope-scope.tooltip' | translate}} -
    -
    - - -
    - - - - - - - - - - - - - - - - - - - -
    {{:: 'authz-resource' | translate}}{{:: 'authz-scopes' | translate}}{{:: 'actions' | translate}}
    - {{:: 'authz-no-resources' | translate}} -
    {{resource.name ? resource.name : 'authz-evaluation-any-resource-with-scopes' | translate}} - {{:: 'authz-any-scope' | translate}}. - - - {{scope.name ? scope.name : scope}} {{$last ? '' : ', '}} - - - - -
    -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-list.html deleted file mode 100644 index d142c44d6e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/resource-server-policy-list.html +++ /dev/null @@ -1,117 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - {{:: 'filter' | translate}}:   -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    {{:: 'name' | translate}}{{:: 'description' | translate}}{{:: 'type' | translate}}{{:: 'actions' | translate}}
    -
    - - - -
    -
    - - - {{policy.name}}{{policy.description}}{{policy.type}} - -
    -
    -
    - -
    -
    -
    -
    -
    Dependent Permissions
    -
    - {{:: 'authz-no-policies-available' | translate}} - {{dep.name}}{{$last ? '' : ', '}} -
    -
    -
    -
    -
    -
    {{:: 'no-results' | translate}}{{:: 'authz-no-policies-available' | translate}}
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-detail.html deleted file mode 100644 index 5bf7d88af5..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-detail.html +++ /dev/null @@ -1,77 +0,0 @@ -
    - - - - - -
    -
    -
    - -
    -
    - - -
    -
    - -
    -
    - {{:: 'authz-import-config.tooltip' | translate}} -
    -
    -
    - - -
    -
    -
    -
    -
    - -
    - -
    - {{:: 'authz-policy-enforcement-mode.tooltip' | translate}} -
    -
    - - -
    - -
    - - {{:: 'authz-server-decision-strategy.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'authz-remote-resource-management.tooltip' | translate}} -
    -
    -
    - - -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-export-settings.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-export-settings.html deleted file mode 100644 index 86505db88b..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-export-settings.html +++ /dev/null @@ -1,35 +0,0 @@ -
    - - - - - -
    -
    -
    - -
    - - - -
    - {{:: 'authz-export-settings.tooltip' | translate}} -
    -
    -
    -
    - {{:: 'download' | translate}} - -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-list.html deleted file mode 100644 index 3b4130e64f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-list.html +++ /dev/null @@ -1,49 +0,0 @@ -
    -

    - Resource Servers - Resource Servers are applications serving resources to their users. These resources can be a RESTFul API, web pages or any other kind of resource that must be managed and protected by a set of authorization policies. -

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - Create -
    -
    -
    NamePolicy Enforcement ModeAllows Remote Resource Management ?Allows Entitlement ?
    {{server.name}}{{server.policyEnforcementMode | toCamelCase}}{{server.allowRemoteResourceManagement}}{{server.allowEntitlements}}
    No resultsNo servers available
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-resource-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-resource-detail.html deleted file mode 100644 index b3d6eca3d6..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-resource-detail.html +++ /dev/null @@ -1,126 +0,0 @@ -
    - - - -

    {{:: 'authz-add-resource' | translate}}

    -

    {{originalResource.name|capitalize}}

    - -
    -
    -
    - -
    - -
    - {{:: 'authz-resource-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'authz-resource-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'authz-resource-owner.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'authz-resource-type.tooltip' | translate}} -
    -
    - -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - {{:: 'authz-resource-uri.tooltip' | translate}} -
    -
    - - -
    - -
    - - {{:: 'authz-resource-scopes.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'authz-icon-uri.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'authz-resource-user-managed-access-enabled.tooltip' | translate}} -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - -
    {{:: 'key' | translate}}{{:: 'value' | translate}}{{:: 'actions' | translate}}
    {{key}}{{:: 'delete' | translate}}
    {{:: 'add' | translate}}
    -
    - {{:: 'authz-resource-attributes.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-resource-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-resource-list.html deleted file mode 100644 index dce000e48b..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-resource-list.html +++ /dev/null @@ -1,169 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - {{:: 'filter' | translate}}:   -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    {{:: 'name' | translate}}{{:: 'type' | translate}}{{:: 'authz-uris' | translate}}{{:: 'authz-owner' | translate}}{{:: 'actions' | translate}}
    -
    - - - -
    -
    - - - - {{resource.name}} - - {{resource.type}} - {{:: 'authz-no-type-defined' | translate}} - - {{:: 'authz-no-uri-defined' | translate}} - {{resource.uris[0]}} - {{resource.uris.length}} {{:: 'authz-uris' | translate}} - {{resource.owner.name}} - -
    -
    -
    - -
    -
    -
    -
    -
    {{:: 'authz-scopes' | translate}}
    -
    - {{:: 'authz-no-scopes-assigned' | translate}} - {{scope.name}}{{$last ? '' : ', '}} -
    -
    {{:: 'authz-associated-permissions' | translate}}
    -
    - {{:: 'authz-no-permission-assigned' | translate}} - {{policy.name}}{{$last ? '' : ', '}} -
    -
    {{:: 'authz-uris' | translate}}
    -
    - {{:: 'authz-no-uri-defined' | translate}} - {{uri}}{{$last ? '' : ', '}} -
    -
    -
    -
    -
    -
    {{:: 'no-results' | translate}}{{:: 'authz-no-resources-available' | - translate}} -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-scope-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-scope-detail.html deleted file mode 100644 index d296abd733..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-scope-detail.html +++ /dev/null @@ -1,50 +0,0 @@ -
    - - - -

    {{:: 'authz-add-scope' | translate}}

    -

    {{originalScope.name|capitalize}}

    - -
    -
    -
    - -
    - -
    - {{:: 'authz-scope-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'authz-scope-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'authz-icon-uri.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-scope-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-scope-list.html deleted file mode 100644 index 22c7f388a4..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/resource-server-scope-list.html +++ /dev/null @@ -1,102 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    {{:: 'name' | translate}}{{:: 'actions' | translate}}
    -
    - - - -
    -
    - - - {{scope.name}} - -
    -
    -
    - -
    -
    -
    -
    -
    {{:: 'authz-resources' | translate}}
    -
    - {{:: 'authz-no-resources-assigned' | translate}} - {{resource.name}}{{$last ? '' : ', '}} -
    -
    {{:: 'authz-associated-permissions' | translate}}
    -
    - {{:: 'authz-no-permission-assigned' | translate}} - {{policy.name}}{{$last ? '' : ', '}} -
    -
    -
    -
    -
    -
    {{:: 'no-results' | translate}}{{:: 'authz-no-scopes-available' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/brute-force.html b/themes/src/main/resources/theme/base/admin/resources/partials/brute-force.html deleted file mode 100755 index 6ab0092391..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/brute-force.html +++ /dev/null @@ -1,114 +0,0 @@ -
    - - - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'permanent-lockout.tooltip' | translate}} -
    - -
    - - -
    - -
    - {{:: 'max-login-failures.tooltip' | translate}} -
    -
    - -
    - - -
    - {{:: 'wait-increment.tooltip' | translate}} -
    -
    - - -
    - -
    - {{:: 'quick-login-check-millis.tooltip' | translate}} -
    -
    - -
    - - -
    - {{:: 'min-quick-login-wait.tooltip' | translate}} -
    -
    - -
    - - -
    - {{:: 'max-wait.tooltip' | translate}} -
    -
    - -
    - - -
    - {{:: 'failure-reset-time.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/ciba-policy.html b/themes/src/main/resources/theme/base/admin/resources/partials/ciba-policy.html deleted file mode 100644 index bfcf5911b3..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/ciba-policy.html +++ /dev/null @@ -1,63 +0,0 @@ -
    -

    {{:: 'authentication' | translate}}

    - - -
    - -
    - -
    -
    - -
    -
    - {{:: 'ciba-backchannel-tokendelivery-mode.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'ciba-expires-in.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'ciba-interval.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'ciba-auth-requested-user-hint.tooltip' | translate}} -
    - -
    -
    - - -
    -
    -
    - -
    - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/claims.html b/themes/src/main/resources/theme/base/admin/resources/partials/claims.html deleted file mode 100755 index 27357cad94..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/claims.html +++ /dev/null @@ -1,62 +0,0 @@ -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-clustering-node.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-clustering-node.html deleted file mode 100644 index 56eb9db8d3..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-clustering-node.html +++ /dev/null @@ -1,37 +0,0 @@ -
    - - -

    {{:: 'add-node' | translate}}

    -

    - {{node.host|capitalize}} - -

    - -
    -
    - -
    - -
    -
    -
    - -
    - {{node.lastRegistration}} -
    -
    -
    -
    - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-clustering.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-clustering.html deleted file mode 100644 index 72ff437896..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-clustering.html +++ /dev/null @@ -1,76 +0,0 @@ -
    - - - - - -
    - {{:: 'basic-configuration' | translate}} -
    -
    - -
    -
    -
    - - -
    -
    -
    - {{:: 'node-reregistration-timeout.tooltip' | translate}} -
    - -
    -
    - - -
    -
    -
    - -
    - {{:: 'registered-cluster-nodes' | translate}} - - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'node-host' | translate}}{{:: 'last-registration' | translate}}{{:: 'actions' | translate}}
    {{node.host}}{{node.lastRegistration}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-registered-cluster-nodes' | translate}}
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-generic.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-generic.html deleted file mode 100644 index 39e9ebc3a5..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-generic.html +++ /dev/null @@ -1,14 +0,0 @@ -
    -
    -
    - -
    - -
    -
    - - -
    -
    -
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt.html deleted file mode 100644 index 43a3ca769f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt.html +++ /dev/null @@ -1,26 +0,0 @@ -
    - -
    - -
    -
    - -
    -
    - {{:: 'token-endpoint-auth-signing-alg.tooltip' | translate}} -
    - -
    - -
    -
    -
    {{:: 'need-to-configure-keys' | translate}}
    -
    -
    -
    - -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret-jwt.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret-jwt.html deleted file mode 100644 index 4a9ae078fd..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret-jwt.html +++ /dev/null @@ -1,55 +0,0 @@ -
    -
    -
    - -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    - -
    -
    - {{:: 'token-endpoint-auth-signing-alg.tooltip' | translate}} -
    - -
    -
    - -
    -
    - -
    -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret.html deleted file mode 100644 index d1b1b80e54..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-secret.html +++ /dev/null @@ -1,33 +0,0 @@ -
    -
    -
    - -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-x509.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-x509.html deleted file mode 100644 index 68117242df..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-x509.html +++ /dev/null @@ -1,28 +0,0 @@ -
    -
    -
    - - {{:: 'subjectdn-tooltip' | translate}} -
    -
    -
    - -
    -
    -
    -
    -
    - -
    - -
    - {{:: 'allow-regex-pattern-comparison.tooltip' | translate}} -
    -
    -
    - - -
    -
    -
    -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html deleted file mode 100755 index e6865a3e79..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html +++ /dev/null @@ -1,38 +0,0 @@ -
    - - - - - -
    -
    -
    - -
    -
    - -
    -
    - {{:: 'client-authenticator.tooltip' | translate}} -
    -
    -
    - -
    -
    - -
    - -
    -
    - -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html deleted file mode 100755 index b1dc6b8617..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html +++ /dev/null @@ -1,1080 +0,0 @@ -
    - - - - - -
    -
    -
    - -
    - -
    - {{:: 'client-id.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client.name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client.description.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'alwaysDisplayInConsole.tooltip' | translate}} -
    -
    - -
    - {{originName}} -
    - {{:: 'client-origin.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'consent-required.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client.display-on-consent-screen.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client.consent-screen-text.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'login-theme.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'client-protocol.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'access-type.tooltip' | translate}} -
    -
    - - {{:: 'standard-flow-enabled.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'implicit-flow-enabled.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'direct-access-grants-enabled.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'service-accounts-enabled.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'oauth2-device-authorization-grant-enabled.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'oidc-ciba-grant-enabled.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'authz-authorization-services-enabled.tooltip' | translate}} -
    - -
    -
    -
    - -
    - -
    - {{:: 'include-authnstatement.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'include-onetimeuse-condition.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'artifact-binding.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'sign-documents.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'sign-documents-redirect-enable-key-info-ext.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'sign-assertions.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'signature-algorithm.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'saml-signature-keyName-transformer.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'canonicalization-method.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'encrypt-assertions.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client-signature-required.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'force-post-binding.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'front-channel-logout.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'front-channel-logout-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'front-channel-logout-session-required.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'force-name-id-format.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'allow-ecp-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'name-id-format.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'root-url.tooltip' | translate}} -
    - -
    - - -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - {{:: 'valid-redirect-uris.tooltip' | translate}} -
    - -
    - - -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - {{:: 'valid-post-logout-redirect-uris.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'base-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'admin-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'master-saml-processing-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'idp-sso-url-ref.urlhint' | translate}} {{samlIdpInitiatedUrl(clientEdit.attributes.saml_idp_initiated_sso_url_name)}} -
    -
    - {{:: 'idp-sso-url-ref.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'logo-uri.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'policy-uri.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'tos-uri.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'idp-sso-relay-state.tooltip' | translate}} -
    -
    - - -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - {{:: 'web-origins.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'backchannel-logout-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'backchannel-logout-session-required.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'backchannel-logout-revoke-offline-sessions.tooltip' | translate}} -
    -
    -
    - {{:: 'fine-saml-endpoint-conf' | translate}} {{:: 'fine-saml-endpoint-conf.tooltip' | translate}} -
    - -
    - -
    - {{:: 'assertion-consumer-post-binding-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'assertion-consumer-redirect-binding-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'logout-service-post-binding-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'logout-service-redir-binding-url.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'logout-service-artifact-binding-url.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'artifact-binding-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'artifact-resolution-service-url.tooltip' | translate}} -
    -
    - -
    - {{:: 'fine-oidc-endpoint-conf' | translate}} {{:: 'fine-oidc-endpoint-conf.tooltip' | translate}} - -
    - -
    -
    - -
    -
    - {{:: 'access-token-signed-response-alg.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'id-token-signed-response-alg.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'id-token-encrypted-response-alg.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'id-token-encrypted-response-enc.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'user-info-signed-response-alg.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'user-info-encrypted-response-alg.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'user-info-encrypted-response-enc.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'request-object-signature-alg.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'request-object-encryption-alg.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'request-object-encryption-enc.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'request-object-required.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'ciba-backchannel-token-delivery-mode.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ciba-backchannel-client-notification-endpoint.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'ciba-backchannel-auth-request-signing-alg.tooltip' | translate}} -
    -
    - -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - {{:: 'request-uris.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'authorization-signed-response-alg.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'authorization-encrypted-response-alg.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'authorization-encrypted-response-enc.tooltip' | translate}} -
    -
    - -
    - {{:: 'oidc-compatibility-modes' | translate}} {{:: 'oidc-compatibility-modes.tooltip' | translate}} -
    - -
    - -
    - {{:: 'exclude-session-state-from-auth-response.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'use-refresh-tokens.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'use-refresh-token-for-client-credentials-grant.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'use-lower-case-bearer-in-token-responses.tooltip' | translate}} -
    -
    - -
    - {{:: 'advanced-client-settings' | translate}} {{:: 'advanced-client-settings.tooltip' | translate}} - -
    - - -
    - - -
    - {{:: 'access-token-lifespan.tooltip' | translate}} -
    - -
    - - -
    - - -
    - {{:: 'saml-assertion-lifespan.tooltip' | translate}} -
    - -
    - -
    - - -
    - {{:: 'client-session-idle.tooltip' | translate}} -
    - -
    - -
    - - -
    - {{:: 'client-session-max.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'client-offline-session-idle.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'client-offline-session-max.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'oauth2-device-code-lifespan.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'oauth2-device-polling-interval.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'tls-client-certificate-bound-access-tokens.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'use-idtoken-as-detached-signature.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'pkce-code-challenge-method.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'require-pushed-authorization-requests.tooltip' | translate}} -
    - -
    - -
    -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    - {{:: 'acr-loa-map-client.tooltip' | translate}} -
    - -
    - - -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - {{:: 'default-acr-values.tooltip' | translate}} -
    - -
    - -
    - {{:: 'client-flow-bindings' | translate}} {{:: 'client-flow-bindings.tooltip' | translate}} -
    - -
    -
    - -
    -
    - {{:: 'browser-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'direct-grant-flow.tooltip' | translate}} -
    -
    - - - -
    -
    - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-import.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-import.html deleted file mode 100755 index 18ec93caf7..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-import.html +++ /dev/null @@ -1,46 +0,0 @@ -
    - - - -

    {{:: 'import-client' | translate}}

    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - - -
    - - {{files[0].name}} - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-initial-access-create.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-initial-access-create.html deleted file mode 100755 index 8c0cb19258..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-initial-access-create.html +++ /dev/null @@ -1,63 +0,0 @@ -
    - - - -

    {{:: 'add-client' | translate}}

    - -
    - -
    - - -
    - - -
    - {{:: 'expiration.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'count.tooltip' | translate}} -
    - -
    -
    - - -
    -
    -
    - -
    -
    - - -
    - -
    - - {{:: 'initial-access.copyPaste.tooltip' | translate}} -
    - -
    -
    - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-initial-access.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-initial-access.html deleted file mode 100755 index b2e683d2b4..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-initial-access.html +++ /dev/null @@ -1,55 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - - -
    -
    {{:: 'id' | translate}}{{:: 'created' | translate}}{{:: 'expires' | translate}}{{:: 'count' | translate}}{{:: 'remainingCount' | translate}}{{:: 'actions' | translate}}
    {{ia.id}}{{(ia.timestamp * 1000)|date:('dateFormat' | translate)}} {{(ia.timestamp * 1000)|date:('timeFormat' | translate)}}{{((ia.timestamp + ia.expiration) * 1000)|date:('dateFormat' | translate)}} {{((ia.timestamp + ia.expiration) * 1000)|date:('timeFormat' | translate)}}{{ia.count}}{{ia.remainingCount}}{{:: 'delete' | translate}}
    {{:: 'no-results' | translate}}{{:: 'no-initial-access-available' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-installation.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-installation.html deleted file mode 100755 index d03fdd267d..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-installation.html +++ /dev/null @@ -1,36 +0,0 @@ -
    - - - - - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    - {{:: 'download' | translate}} - -
    -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-keys.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-keys.html deleted file mode 100755 index c412e27269..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-keys.html +++ /dev/null @@ -1,146 +0,0 @@ -
    - - - - - -
    -
    - {{:: 'import-keys-and-cert' | translate}} {{:: 'import-keys-and-cert.tooltip' | translate}} -
    - -
    -
    - -
    -
    - {{:: 'archive-format.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'key-alias.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'key-password.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'store-password.tooltip' | translate}} -
    -
    - - -
    -
    - - -
    -
    -
    - {{:: 'download-keys-and-cert' | translate}} Client key pair, cert, and realm certificate will be stuffed into a PKCS12 or Java keystore that you can use in your clients. -
    - -
    -
    - -
    -
    - Java keystore or PKCS12 archive format. -
    -
    - -
    - -
    - Archive alias for your private key and certificate. -
    -
    - -
    - -
    - Password to access the private key in the archive -
    -
    - -
    - -
    - Realm certificate is stored in archive too. This is the alias to it. -
    -
    - -
    - -
    - Password to access the archive itself -
    -
    -
    - -
    -
    -
    -
    - Keys and Certificate Keys and cert in PEM format. -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-list.html deleted file mode 100755 index 8c26669f4f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-list.html +++ /dev/null @@ -1,68 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-mappers-add.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-mappers-add.html deleted file mode 100755 index 653777924d..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-mappers-add.html +++ /dev/null @@ -1,53 +0,0 @@ -
    - - - -

    {{:: 'add-builtin-protocol-mapper' | translate}}

    - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    {{:: 'name' | translate}}{{:: 'category' | translate}}{{:: 'type' | translate}}{{:: 'add' | translate}}
    {{mapper.name}}{{mapperTypes[mapper.protocolMapper].category}}{{mapperTypes[mapper.protocolMapper].name}}
    {{:: 'no-mappers-available' | translate}}
    - -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-mappers.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-mappers.html deleted file mode 100755 index 83123c2780..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-mappers.html +++ /dev/null @@ -1,55 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'name' | translate}}{{:: 'category' | translate}}{{:: 'type' | translate}}{{:: 'priority-order' | translate}}{{:: 'actions' | translate}}
    {{mapper.name}}{{mapperTypes[mapper.protocolMapper].category}}{{mapperTypes[mapper.protocolMapper].name}}{{mapperTypes[mapper.protocolMapper].priority}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-mappers-available' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-offline-sessions.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-offline-sessions.html deleted file mode 100644 index 3d2aaf7a1b..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-offline-sessions.html +++ /dev/null @@ -1,59 +0,0 @@ -
    - - - - - -
    -
    -
    - -
    - -
    - {{:: 'offline-tokens.tooltip' | translate}} -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'user' | translate}}{{:: 'from-ip' | translate}}{{:: 'token-issued' | translate}}{{:: 'last-refresh' | translate}}
    -
    - - - -
    -
    {{session.username}}{{session.ipAddress}}{{session.start | date:'medium'}}{{session.lastAccess | date:'medium'}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-key-export.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-key-export.html deleted file mode 100644 index b293cdc94c..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-key-export.html +++ /dev/null @@ -1,57 +0,0 @@ -
    - - - -

    {{:: 'generate-private-key' | translate}}

    - -
    -
    -
    - -
    -
    - -
    -
    - {{:: 'archive-format.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'key-alias.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'key-password.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'store-password.tooltip' | translate}} -
    -
    -
    - - -
    -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-key-import.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-key-import.html deleted file mode 100644 index 1b91e43913..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-key-import.html +++ /dev/null @@ -1,62 +0,0 @@ -
    - - - -

    {{:: 'import-client-certificate' | translate}}

    - -
    -
    -
    - -
    -
    - -
    -
    - {{:: 'archive-format.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'jwt-import.key-alias.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'store-password.tooltip' | translate}} -
    -
    - -
    -
    - - -
    - - {{files[0].name}} - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-keys.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-keys.html deleted file mode 100644 index c1d4d09a31..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-oidc-keys.html +++ /dev/null @@ -1,108 +0,0 @@ -
    - - - - - -
    -
    - -
    - -
    - {{:: 'use-jwks-url.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'jwks-url.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'use-jwks-string.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'jwks-string.tooltip' | translate}} -
    - -
    - -
    - - {{:: 'certificate.tooltip' | translate}} - -
    - -
    -
    - -
    - - {{:: 'publicKey.tooltip' | translate}} - -
    - -
    -
    - -
    - - {{:: 'kid.tooltip' | translate}} - -
    -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    {{:: 'no-client-certificate-configured' | translate}}
    -
    -
    -
    - -
    - -
    -
    - - - - -
    -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-json.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-json.html deleted file mode 100644 index a6150df5ad..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-json.html +++ /dev/null @@ -1,60 +0,0 @@ - - -
    - - - - - - -
    - - -
    -
    -
    - -
    -
    -
    - -
    -
    - - -
    -
    -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-list.html deleted file mode 100644 index 087510568f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-list.html +++ /dev/null @@ -1,74 +0,0 @@ - - -
    - - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'name' | translate}}{{:: 'description' | translate}}{{:: 'enabled' | translate}}{{:: 'actions' | translate}}
    {{clientPolicy.name}}{{clientPolicy.description}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    -
    - -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-policy-edit-condition.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-policy-edit-condition.html deleted file mode 100644 index 45c0a8a673..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-policy-edit-condition.html +++ /dev/null @@ -1,65 +0,0 @@ - - -
    - - - -

    {{conditionType.id|capitalize}}

    -

    {{:: 'create-condition' | translate}}

    - -
    -
    -
    - -
    -
    - -
    -
    - {{conditionType.helpText}} -
    -
    - -
    - -
    - {{conditionType.helpText}} -
    - -
    - -
    -
    - - -
    -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-policy-edit.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-policy-edit.html deleted file mode 100644 index 41476f6d4f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-policy-edit.html +++ /dev/null @@ -1,140 +0,0 @@ - - -
    - - - -

    {{:: 'create-client-policy' | translate}}

    -

    {{editedPolicy.name|capitalize}}

    - -
    - -
    - -
    - -
    - -
    - {{:: 'client-policy-name.tooltip' | translate}} -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    - {{:: 'client-policy-enabled.tooltip' | translate}} -
    - -
    - -
    - -
    -
    - - -
    -
    - -
    - -
    - - {{:: 'conditions' | translate}} {{:: 'client-policy-conditions.tooltip' | translate}} - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'type' | translate}}{{:: 'actions' | translate}}
    {{condition.condition}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-conditions-available' | translate}}
    - -
    - -
    - {{:: 'client-profiles' | translate}}{{:: 'client-profiles.tooltip' | translate}} - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    {{:: 'name' | translate}}{{:: 'actions' | translate}}
    {{profileName}}{{:: 'delete' | translate}}
    {{:: 'no-client-profiles-configured' | translate}}
    -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-edit-executor.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-edit-executor.html deleted file mode 100644 index 5bf8da6640..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-edit-executor.html +++ /dev/null @@ -1,65 +0,0 @@ - - -
    - - - -

    {{executorType.id|capitalize}}

    -

    {{:: 'create-executor' | translate}}

    - -
    -
    -
    - -
    -
    - -
    -
    - {{executorType.helpText}} -
    -
    - -
    - -
    - {{executorType.helpText}} -
    - -
    - -
    -
    - - -
    -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-edit.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-edit.html deleted file mode 100644 index 1e3e71e675..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-edit.html +++ /dev/null @@ -1,97 +0,0 @@ - - -
    - - - -

    {{:: 'create-client-profile' | translate}}

    -

    {{editedProfile.name|capitalize}}

    - -
    - -
    - -
    - -
    - -
    - {{:: 'client-profile-name.tooltip' | translate}} -
    - -
    - -
    - -
    -
    -
    - -
    - -
    -
    - - -
    -
    - -
    - -
    - - {{:: 'executors' | translate}} {{:: 'client-profile-executors.tooltip' | translate}} - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'type' | translate}}{{:: 'actions' | translate}}
    {{executor.executor}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-executors-available' | translate}}
    - -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-json.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-json.html deleted file mode 100644 index e2fae4aea0..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-json.html +++ /dev/null @@ -1,60 +0,0 @@ - - -
    - - - - - - -
    - - -
    -
    -
    - -
    -
    -
    - -
    -
    - - -
    -
    -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-list.html deleted file mode 100644 index a0b9f89032..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-policies-profiles-list.html +++ /dev/null @@ -1,80 +0,0 @@ - - -
    - - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'name' | translate}}{{:: 'description' | translate}}{{:: 'global' | translate}}{{:: 'actions' | translate}}
    {{clientProfile.name}}{{clientProfile.description}}{{:: 'true' | translate}}{{:: 'edit' | translate}}
    {{clientProfile.name}}{{clientProfile.description}}{{:: 'false' | translate}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    -
    - -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-protocol-mapper-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-protocol-mapper-detail.html deleted file mode 100755 index b2af24a932..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-protocol-mapper-detail.html +++ /dev/null @@ -1,13 +0,0 @@ -
    - - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-policies.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-policies.html deleted file mode 100644 index 9ca912fcbf..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-policies.html +++ /dev/null @@ -1,106 +0,0 @@ - - -
    - - - - -
    - -
    - {{:: 'anonymous-policies' | translate}}{{:: 'anonymous-policies.tooltip' | translate}} - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    {{:: 'policy-name' | translate}}{{:: 'provider-id' | translate}}{{:: 'actions' | translate}}
    {{instance.name}}{{instance.providerId}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-client-reg-policies-configured' | translate}}
    -
    - -
    - {{:: 'auth-policies' | translate}}{{:: 'auth-policies.tooltip' | translate}} - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    {{:: 'policy-name' | translate}}{{:: 'provider-id' | translate}}{{:: 'actions' | translate}}
    {{instance.name}}{{instance.providerId}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-client-reg-policies-configured' | translate}}
    -
    - - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-policy-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-policy-detail.html deleted file mode 100644 index 91a8ed9d17..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-policy-detail.html +++ /dev/null @@ -1,68 +0,0 @@ - - -
    - - - -
    -
    - {{headerTitle}}{{:: providerType.helpText | translate}} -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'client-reg-policy.name.tooltip' | translate}} -
    -
    - -
    - -
    - {{providerType.helpText}} -
    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    -
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-trusted-host-create.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-trusted-host-create.html deleted file mode 100644 index cb07613a58..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-trusted-host-create.html +++ /dev/null @@ -1,55 +0,0 @@ - - -
    - - - -

    {{:: 'add-client-reg-trusted-host' | translate}}

    - -
    - -
    - -
    - -
    - {{:: 'client-reg-hostname.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'client-reg-count.tooltip' | translate}} -
    - -
    -
    - - -
    -
    -
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-trusted-host-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-trusted-host-detail.html deleted file mode 100644 index 5644fc1dd9..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-reg-trusted-host-detail.html +++ /dev/null @@ -1,64 +0,0 @@ - - -
    - - - -

    {{hostName}}

    - -
    - -
    - -
    - -
    - {{:: 'client-reg-hostname.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'client-reg-count.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'client-reg-remainingCount.tooltip' | translate}} -
    - -
    -
    - - - -
    -
    -
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-registration-access-token.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-registration-access-token.html deleted file mode 100644 index 327b70d9ad..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-registration-access-token.html +++ /dev/null @@ -1,18 +0,0 @@ -
    -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    - {{:: 'registrationAccessToken.tooltip' | translate}} -
    -
    -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-revocation.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-revocation.html deleted file mode 100755 index 95db767ae5..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-revocation.html +++ /dev/null @@ -1,30 +0,0 @@ -
    - - - - - -
    -
    -
    - -
    - -
    - {{:: 'client-revoke.not-before.tooltip' | translate}} -
    -
    -
    -
    - - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-role-attributes.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-role-attributes.html deleted file mode 100755 index 47ef4167e3..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-role-attributes.html +++ /dev/null @@ -1,45 +0,0 @@ -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    {{:: 'key' | translate}}{{:: 'value' | translate}}{{:: 'actions' | translate}}
    {{key}}{{:: 'delete' | translate}}
    {{:: 'add' | translate}}
    - -
    -
    - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-role-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-role-detail.html deleted file mode 100755 index 8877dbeea8..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-role-detail.html +++ /dev/null @@ -1,140 +0,0 @@ -
    - - - - - -
    - -
    -
    - - -
    - -
    -
    -
    - - -
    - - -
    -
    -
    - -
    - -
    - {{:: 'composite-roles.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    -
    -
    - - -
    -
    - -
    - {{:: 'composite-roles' | translate}} - -
    - - -
    -
    -
    - - {{:: 'composite.available-realm-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'composite.associated-realm-roles.tooltip' | translate}} - - -
    -
    -
    -
    - -
    - -
    - - -
    - - -
    -
    -
    - - {{:: 'available-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'client.associated-roles.tooltip' | translate}} - - -
    -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html deleted file mode 100755 index 4feff0ae03..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html +++ /dev/null @@ -1,64 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - - -
    -
    {{:: 'role-name' | translate}}{{:: 'composite' | translate}}{{:: 'description' | translate}}{{:: 'actions' | translate}}
    {{role.name}}{{role.description}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-results' | translate}}{{:: 'no-client-roles-available' | translate}}
    -
    - - - -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-role-users.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-role-users.html deleted file mode 100644 index 5349171328..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-role-users.html +++ /dev/null @@ -1,52 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {{:: 'username' | translate}}{{:: 'last-name' | translate}}{{:: 'first-name' | translate}}{{:: 'email' | translate}}
    -
    - - - -
    -
    {{user.username}}{{user.lastName}}{{user.firstName}}{{user.email}}{{:: 'edit' | translate}}
    {{:: 'no-role-members' | translate}}{{:: 'no-role-members' | translate}}
    - -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-saml-key-export.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-saml-key-export.html deleted file mode 100755 index 7610192196..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-saml-key-export.html +++ /dev/null @@ -1,63 +0,0 @@ -
    - - - -

    {{:: 'export-saml-key' | translate}} {{client.clientId|capitalize}}

    - -
    -
    -
    - -
    -
    - -
    -
    - {{:: 'archive-format.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'key-alias.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'key-password.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'realm-certificate-alias.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'store-password.tooltip' | translate}} -
    -
    -
    - -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-saml-key-import.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-saml-key-import.html deleted file mode 100755 index f37ac7a14c..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-saml-key-import.html +++ /dev/null @@ -1,62 +0,0 @@ -
    - - - -

    {{:: 'import-saml-key' | translate}} {{client.clientId|capitalize}}

    - -
    -
    -
    - -
    -
    - -
    -
    - {{:: 'archive-format.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'key-alias.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'store-password.tooltip' | translate}} -
    -
    - -
    -
    - - -
    - - {{files[0].name}} - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-saml-keys.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-saml-keys.html deleted file mode 100755 index 776349d5be..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-saml-keys.html +++ /dev/null @@ -1,66 +0,0 @@ -
    - - - - - -
    -
    - {{:: 'signing-key' | translate}} {{:: 'saml-signing-key' | translate}} -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    -
    - - - -
    -
    -
    -
    - {{:: 'encryption-key' | translate}} {{:: 'saml-encryption-key.tooltip' | translate}} -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-detail.html deleted file mode 100755 index 9f1ba99aee..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-detail.html +++ /dev/null @@ -1,102 +0,0 @@ -
    - - - - - -
    -
    -
    - -
    - -
    - {{:: 'client-scope.name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client-scope.is-dynamic-scope.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client-scope.dynamic-scope-regexp.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client-scope.description.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'client-scope.protocol.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'client-scope.display-on-consent-screen.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client-scope.consent-screen-text.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client-scope.include-in-token-scope.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client-scope.gui-order.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-list.html deleted file mode 100755 index 1f945fcc2b..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-list.html +++ /dev/null @@ -1,60 +0,0 @@ -
    -

    - {{:: 'client-scopes' | translate}} - {{:: 'client-scopes.tooltip' | translate}} -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - - -
    -
    {{:: 'name' | translate}}{{:: 'protocol' | translate}}{{:: 'gui-order' | translate}}{{:: 'actions' | translate}}
    {{clientScope.name}}{{clientScope.protocol}}{{clientScope.attributes['gui.order']}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-results' | translate}}{{:: 'no-clients-available' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappers-add.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappers-add.html deleted file mode 100755 index 413c065541..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappers-add.html +++ /dev/null @@ -1,53 +0,0 @@ -
    - - - -

    {{:: 'add-builtin-protocol-mapper' | translate}}

    - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    {{:: 'name' | translate}}{{:: 'category' | translate}}{{:: 'type' | translate}}{{:: 'add' | translate}}
    {{mapper.name}}{{mapperTypes[mapper.protocolMapper].category}}{{mapperTypes[mapper.protocolMapper].name}}
    {{:: 'no-mappers-available' | translate}}
    - -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappers.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappers.html deleted file mode 100755 index 3b95910913..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappers.html +++ /dev/null @@ -1,55 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'name' | translate}}{{:: 'category' | translate}}{{:: 'type' | translate}}{{:: 'priority-order' | translate}}{{:: 'actions' | translate}}
    {{mapper.name}}{{mapperTypes[mapper.protocolMapper].category}}{{mapperTypes[mapper.protocolMapper].name}}{{mapperTypes[mapper.protocolMapper].priority}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-mappers-available' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html deleted file mode 100755 index d389642329..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html +++ /dev/null @@ -1,127 +0,0 @@ -
    - - - - - -

    {{client.clientId}} {{:: 'scope-mappings' | translate}}

    -

    -
    -
    -
    - - {{:: 'full-scope-allowed.tooltip' | translate}} -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - - {{:: 'scope.available-roles.tooltip' | translate}} - - - -
    -
    - - {{:: 'assigned-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'realm.effective-roles.tooltip' | translate}} - -
    -
    -
    -
    - -
    - -
    - - -
    - -
    -
    -
    - - {{:: 'assign.available-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'client.assigned-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'client.effective-roles.tooltip' | translate}} - -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-protocol-mapper-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-protocol-mapper-detail.html deleted file mode 100755 index 0f6cb5c80d..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-protocol-mapper-detail.html +++ /dev/null @@ -1,13 +0,0 @@ -
    - - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-scope-mappings.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-scope-mappings.html deleted file mode 100755 index 3180826b7d..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-scope-mappings.html +++ /dev/null @@ -1,116 +0,0 @@ -
    - - - - - -

    {{clientScope.name}} {{:: 'scope-mappings' | translate}}

    -

    - -
    -
    - -
    -
    -
    - - {{:: 'scope.available-roles.tooltip' | translate}} - - - -
    -
    - - {{:: 'assigned-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'realm.effective-roles.tooltip' | translate}} - -
    -
    -
    -
    - -
    - -
    - - -
    - -
    -
    -
    - - {{:: 'assign.available-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'client.assigned-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'client.effective-roles.tooltip' | translate}} - -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-evaluate.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-evaluate.html deleted file mode 100644 index e8702ad2a7..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-evaluate.html +++ /dev/null @@ -1,268 +0,0 @@ - - -
    - - - - - - - -
    -
    -
    - -
    - -
    - {{:: 'scope-parameter.tooltip' | translate}} -
    -
    - -
    - - {{:: 'client-scopes.evaluate.scopes.tooltip' | translate}} - -
    -
    -
    - - {{:: 'client-scopes.evaluate.scopes.available.tooltip' | translate}} - - -
    -
    - - {{:: 'client-scopes.evaluate.scopes.assigned.tooltip' | translate}} - - -
    -
    - - {{:: 'client-scopes.evaluate.scopes.effective.tooltip' | translate}} - -
    -
    -
    -
    - -
    - - -
    - - -
    - - {{:: 'client-scopes.evaluate.user.tooltip' | translate}} -
    - -
    -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    {{:: 'name' | translate}}{{:: 'parent-client-scope' | translate}}{{:: 'category' | translate}}{{:: 'type' | translate}}{{:: 'priority-order' | translate}}
    {{mapper.mapperName}}{{mapper.containerName}}{{mapperTypes[mapper.protocolMapper].category}}{{mapperTypes[mapper.protocolMapper].name}}{{mapperTypes[mapper.protocolMapper].priority}}
    {{:: 'no-mappers-available' | translate}}
    - - - -
    -
    - -
    -
    -
    - - {{:: 'client-scopes.evaluate.not-granted-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'client-scopes.evaluate.granted-realm-effective-roles.tooltip' | translate}} - -
    -
    -
    -
    - -
    - -
    - - -
    - -
    -
    -
    - - {{:: 'client-scopes.evaluate.not-granted-roles.tooltip' | translate}} - -
    -
    - - {{:: 'client-scopes.evaluate.granted-realm-effective-roles.tooltip' | translate}} - -
    -
    -
    -
    -
    - - - -
    -
    -
    - -
    -
    -
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-realm-default.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-realm-default.html deleted file mode 100644 index e30570aeef..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-realm-default.html +++ /dev/null @@ -1,99 +0,0 @@ -
    -

    - {{:: 'default-client-scopes' | translate}} - {{:: 'default-client-scopes.tooltip' | translate}} -

    - - - -
    -
    - - {{:: 'default-client-scopes.default.tooltip' | translate}} - -
    -
    -
    - - {{:: 'default-client-scopes.default.available.tooltip' | translate}} - - -
    -
    - - {{:: 'default-client-scopes.default.assigned.tooltip' | translate}} - - -
    -
    -
    -
    - -
    - - {{:: 'default-client-scopes.optional.tooltip' | translate}} - -
    -
    -
    - - {{:: 'default-client-scopes.optional.available.tooltip' | translate}} - - -
    -
    - - {{:: 'default-client-scopes.optional.assigned.tooltip' | translate}} - - -
    -
    -
    -
    - -
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-setup.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-setup.html deleted file mode 100644 index 50f10b6a4e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scopes-setup.html +++ /dev/null @@ -1,123 +0,0 @@ - - -
    - - - - - - - -
    -
    - - {{:: 'client-scopes.default.tooltip' | translate}} - -
    -
    -
    - - {{:: 'client-scopes.default.available.tooltip' | translate}} - - -
    -
    - - {{:: 'client-scopes.default.assigned.tooltip' | translate}} - - -
    -
    -
    -
    - -
    - - {{:: 'client-scopes.optional.tooltip' | translate}} - -
    -
    -
    - - {{:: 'client-scopes.optional.available.tooltip' | translate}} - - -
    -
    - - {{:: 'client-scopes.optional.assigned.tooltip' | translate}} - - -
    -
    -
    -
    - -
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-service-account-roles.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-service-account-roles.html deleted file mode 100644 index 36905a7b2f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-service-account-roles.html +++ /dev/null @@ -1,140 +0,0 @@ -
    - - - - - -
    - -

    {{:: 'service-account' | translate}}

    - -
    - - - {{:: 'service-account.user.tooltip' | translate}} -
    -

    - - -

    {{:: 'service-account.roles' | translate}}

    -

    - -
    - -
    -
    -
    - - {{:: 'service-account.available-roles.tooltip' | translate}} - - - -
    -
    - - {{:: 'service-account.assigned-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'realm.effective-roles.tooltip' | translate}} - -
    -
    -
    -
    - -
    - -
    - - -
    - -
    -
    -
    - - {{:: 'assign.available-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'client.assigned-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'client.effective-roles.tooltip' | translate}} - -
    -
    -
    -
    -
    - -
    - -
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-sessions.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-sessions.html deleted file mode 100755 index 5dbb2afdda..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-sessions.html +++ /dev/null @@ -1,57 +0,0 @@ -
    - - - - - -
    -
    -
    - -
    - -
    - {{:: 'active-sessions.tooltip' | translate}} -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'user' | translate}}{{:: 'from-ip' | translate}}{{:: 'session-start' | translate}}
    -
    - - - -
    -
    {{session.username}}{{session.ipAddress}}{{session.start | date:'medium'}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-storage-generic.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-storage-generic.html deleted file mode 100755 index 90ed088ef2..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-storage-generic.html +++ /dev/null @@ -1,207 +0,0 @@ -
    - - -
    -
    - {{:: 'required-settings' | translate}} -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'client-storage.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'console-display-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'priority.tooltip' | translate}} -
    - - - -
    - -
    - {{:: 'client-storage-cache-policy' | translate}} -
    - -
    -
    - -
    -
    - {{:: 'clientStorage.cachePolicy.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'clientStorage.cachePolicy.evictionDay.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'clientStorage.cachePolicy.evictionHour.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'clientStorage.cachePolicy.evictionMinute.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'clientStorage.cachePolicy.maxLifespan.tooltip' | translate}} -
    -
    - - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-storage-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-storage-list.html deleted file mode 100755 index c111eaa14d..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-storage-list.html +++ /dev/null @@ -1,67 +0,0 @@ -
    - - - -
    -
    - -
    -

    - {{:: 'client-storage' | translate}} -

    - {{:: 'client-storage-list-no-entries' | translate}} -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    {{:: 'id' | translate}}{{:: 'enabled' | translate}}{{:: 'provider-name' | translate}}{{:: 'priority' | translate}}{{:: 'actions' | translate}}
    {{getInstanceName(instance)}}{{isProviderEnabled(instance)}}{{getInstanceProvider(instance) | capitalize}}{{getInstancePriority(instance)}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-client-storage-providers-configured' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/create-client.html b/themes/src/main/resources/theme/base/admin/resources/partials/create-client.html deleted file mode 100755 index 0c47b312f3..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/create-client.html +++ /dev/null @@ -1,72 +0,0 @@ -
    - - - - - -
    -
    -
    - - -
    - - -
    - -
    - - -
    -
    - -
    - -
    - -
    - {{:: 'client-id.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'client-protocol.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'root-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'master-saml-processing-url.tooltip' | translate}} -
    -
    -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/create-execution.html b/themes/src/main/resources/theme/base/admin/resources/partials/create-execution.html deleted file mode 100755 index d68dc9c919..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/create-execution.html +++ /dev/null @@ -1,31 +0,0 @@ -
    - -
    -

    {{:: 'create-authenticator-execution' | translate}}

    -

    {{:: 'create-authenticator-execution' | translate}}

    -

    {{:: 'create-form-action-execution' | translate}}

    -
    - -
    -
    - -
    -
    - -
    -
    - {{provider.description}} -
    -
    -
    - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/create-flow-execution.html b/themes/src/main/resources/theme/base/admin/resources/partials/create-flow-execution.html deleted file mode 100755 index 195a7ff051..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/create-flow-execution.html +++ /dev/null @@ -1,55 +0,0 @@ -
    -

    {{:: 'create-execution-flow' | translate}}

    - - - -
    -
    - -
    - -
    - {{:: 'flow.alias.tooltip' | translate}} -
    -
    - - -
    - -
    -
    -
    - -
    -
    - -
    -
    - {{:: 'flow-type.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{provider.description}} -
    -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/create-flow.html b/themes/src/main/resources/theme/base/admin/resources/partials/create-flow.html deleted file mode 100755 index efd34e99d7..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/create-flow.html +++ /dev/null @@ -1,43 +0,0 @@ -
    -

    {{:: 'create-top-level-form' | translate}}

    - - - -
    -
    - -
    - -
    - {{:: 'flow.alias.tooltip' | translate}} -
    -
    - - -
    - -
    -
    -
    - -
    -
    - -
    -
    - {{:: 'top-level-flow-type.tooltip' | translate}} -
    -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/create-group.html b/themes/src/main/resources/theme/base/admin/resources/partials/create-group.html deleted file mode 100755 index 255cf32a7f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/create-group.html +++ /dev/null @@ -1,25 +0,0 @@ -
    -
    -

    {{:: 'create-group' | translate}}

    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/default-groups.html b/themes/src/main/resources/theme/base/admin/resources/partials/default-groups.html deleted file mode 100755 index 8d0866e7ae..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/default-groups.html +++ /dev/null @@ -1,91 +0,0 @@ -
    - - -
    -
    - - -
    -
    -
    - - - - - - - - - - - -
    -
    - - {{:: 'default-groups.tooltip' | translate}} - -
    - -
    -
    -
    - -
    -
    -
    - - - - - - - - - - - -
    -
    -
    - - {{:: 'available-groups.tooltip' | translate}} -
    -
    -
    - -
    - -
    -
    -
    -   - -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/defense-headers.html b/themes/src/main/resources/theme/base/admin/resources/partials/defense-headers.html deleted file mode 100755 index 0c974030ad..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/defense-headers.html +++ /dev/null @@ -1,71 +0,0 @@ -
    - - - - -
    -
    -
    - -
    - -
    - {{:: 'x-frame-options-tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'content-sec-policy-tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'content-sec-policy-report-only-tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'content-type-options-tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'robots-tag-tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'x-xss-protection-tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'strict-transport-security-tooltip' | translate}} -
    -
    -
    -
    - - -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/forbidden.html b/themes/src/main/resources/theme/base/admin/resources/partials/forbidden.html deleted file mode 100755 index b40f2e7fca..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/forbidden.html +++ /dev/null @@ -1,7 +0,0 @@ -
    -
    -

    Forbidden

    -

    You don't have access to the requested resource.

    - Go to the home page » -
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/group-attributes.html b/themes/src/main/resources/theme/base/admin/resources/partials/group-attributes.html deleted file mode 100755 index e12c553d03..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/group-attributes.html +++ /dev/null @@ -1,41 +0,0 @@ -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    {{:: 'key' | translate}}{{:: 'value' | translate}}{{:: 'actions' | translate}}
    {{key}}{{:: 'delete' | translate}}
    {{:: 'add' | translate}}
    - -
    -
    - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/group-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/group-detail.html deleted file mode 100755 index 8fd6461792..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/group-detail.html +++ /dev/null @@ -1,28 +0,0 @@ -
    - - - -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/group-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/group-list.html deleted file mode 100755 index 3412e6a2d9..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/group-list.html +++ /dev/null @@ -1,50 +0,0 @@ -
    - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/group-members.html b/themes/src/main/resources/theme/base/admin/resources/partials/group-members.html deleted file mode 100755 index ffdf3623c8..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/group-members.html +++ /dev/null @@ -1,48 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {{:: 'username' | translate}}{{:: 'last-name' | translate}}{{:: 'first-name' | translate}}{{:: 'email' | translate}}
    -
    - - - -
    -
    {{user.username}}{{user.lastName}}{{user.firstName}}{{user.email}}{{:: 'edit' | translate}}
    {{:: 'no-group-members' | translate}}{{:: 'no-group-members' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/group-role-mappings.html b/themes/src/main/resources/theme/base/admin/resources/partials/group-role-mappings.html deleted file mode 100755 index fc3f6ee361..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/group-role-mappings.html +++ /dev/null @@ -1,111 +0,0 @@ -
    - - - - -
    -
    - - -
    -
    -
    - - - - {{:: 'group.add-selected.tooltip' | translate}} -
    -
    - - {{:: 'group.assigned-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'group.effective-roles.tooltip' | translate}} - -
    -
    -
    -
    - -
    - -
    - - -
    -
    -
    -
    - - {{:: 'group.available-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'group.assigned-roles-client.tooltip' | translate}} - - -
    -
    - - {{:: 'group.effective-roles-client.tooltip' | translate}} - -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/home.html b/themes/src/main/resources/theme/base/admin/resources/partials/home.html deleted file mode 100755 index dc2471b758..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/home.html +++ /dev/null @@ -1,4 +0,0 @@ -
    -
    -
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mapper-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mapper-detail.html deleted file mode 100755 index 7e62b1449b..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mapper-detail.html +++ /dev/null @@ -1,84 +0,0 @@ -
    - - -

    {{mapper.name|capitalize}}

    -

    {{:: 'add-identity-provider-mapper' | translate}}

    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'mapper.name.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'sync-mode-override.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{mapperType.helpText}} -
    -
    - -
    - -
    - {{mapperType.helpText}} -
    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mappers.html b/themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mappers.html deleted file mode 100755 index 23705c08e9..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mappers.html +++ /dev/null @@ -1,49 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    {{:: 'name' | translate}}{{:: 'category' | translate}}{{:: 'type' | translate}}
    {{mapper.name}}{{mapperTypes[mapper.identityProviderMapper].category}}{{mapperTypes[mapper.identityProviderMapper].name}}
    {{:: 'no-mappers-available' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/menu.html b/themes/src/main/resources/theme/base/admin/resources/partials/menu.html deleted file mode 100755 index dc413236dc..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/menu.html +++ /dev/null @@ -1,26 +0,0 @@ - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/modal/group-selector.html b/themes/src/main/resources/theme/base/admin/resources/partials/modal/group-selector.html deleted file mode 100644 index d6dfa4d24f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/modal/group-selector.html +++ /dev/null @@ -1,50 +0,0 @@ - -
    -
    - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/modal/realm-events-admin-auth.html b/themes/src/main/resources/theme/base/admin/resources/partials/modal/realm-events-admin-auth.html deleted file mode 100644 index c8da93e209..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/modal/realm-events-admin-auth.html +++ /dev/null @@ -1,8 +0,0 @@ -
    - - - - - -
    {{:: 'realm' | translate}}{{event.authDetails.realmId}}
    {{:: 'client' | translate}}{{event.authDetails.clientId}}
    {{:: 'user' | translate}}{{event.authDetails.userId}}
    {{:: 'ip-address' | translate}}{{event.authDetails.ipAddress}}
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/modal/realm-events-admin-representation.html b/themes/src/main/resources/theme/base/admin/resources/partials/modal/realm-events-admin-representation.html deleted file mode 100644 index 837a164ec3..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/modal/realm-events-admin-representation.html +++ /dev/null @@ -1,3 +0,0 @@ -
    -
    
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/modal/role-selector.html b/themes/src/main/resources/theme/base/admin/resources/partials/modal/role-selector.html deleted file mode 100755 index b4dd43fe73..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/modal/role-selector.html +++ /dev/null @@ -1,39 +0,0 @@ - -
    -
    -
    - - {{:: 'realm-roles.tooltip' | translate}} - - -
    -
    - - - - - -
    -
    -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/modal/unregistered-required-action-selector.html b/themes/src/main/resources/theme/base/admin/resources/partials/modal/unregistered-required-action-selector.html deleted file mode 100755 index bc9995ff6e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/modal/unregistered-required-action-selector.html +++ /dev/null @@ -1,21 +0,0 @@ - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/modal/user-credential-data.html b/themes/src/main/resources/theme/base/admin/resources/partials/modal/user-credential-data.html deleted file mode 100644 index 342b3f6ae4..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/modal/user-credential-data.html +++ /dev/null @@ -1,8 +0,0 @@ -
    - - - - - -
    {{key}}{{credentialData[key]}}
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/modal/view-key.html b/themes/src/main/resources/theme/base/admin/resources/partials/modal/view-key.html deleted file mode 100644 index 5d53d3ff79..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/modal/view-key.html +++ /dev/null @@ -1,18 +0,0 @@ - - -
    {{key}}
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/modal/view-object.html b/themes/src/main/resources/theme/base/admin/resources/partials/modal/view-object.html deleted file mode 100644 index ee50aee653..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/modal/view-object.html +++ /dev/null @@ -1,3 +0,0 @@ -
    -
    
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/notfound.html b/themes/src/main/resources/theme/base/admin/resources/partials/notfound.html deleted file mode 100755 index 62a1a5bd4c..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/notfound.html +++ /dev/null @@ -1,7 +0,0 @@ -
    -
    -

    -

    {{:: 'resource-not-found.instruction' | translate}}

    - -
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/otp-policy.html b/themes/src/main/resources/theme/base/admin/resources/partials/otp-policy.html deleted file mode 100755 index 4de910c448..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/otp-policy.html +++ /dev/null @@ -1,108 +0,0 @@ -
    -

    {{:: 'authentication' | translate}}

    - - - -
    -
    - -
    -
    - -
    -
    - {{:: 'otp-type.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'otp-hash-algorithm.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'otp.number-of-digits.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'otp.look-ahead-window.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'otp.look-around-window.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'otp.initial-counter.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'otp-token-period.tooltip' | translate}} -
    - -
    - -
    - - {{:: key | translate}}, - -
    - {{:: 'otp-supported-applications.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'otp-reusable-code.tooltip' | translate}} -
    - - -
    -
    - - -
    -
    -
    - -
    - - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/pagenotfound.html b/themes/src/main/resources/theme/base/admin/resources/partials/pagenotfound.html deleted file mode 100755 index c15a051257..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/pagenotfound.html +++ /dev/null @@ -1,7 +0,0 @@ -
    -
    -

    -

    {{:: 'page-not-found.instruction' | translate}}

    - -
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/partial-export.html b/themes/src/main/resources/theme/base/admin/resources/partials/partial-export.html deleted file mode 100644 index 1ceed8c198..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/partial-export.html +++ /dev/null @@ -1,34 +0,0 @@ -
    - -

    - {{:: 'partial-export' | translate}} - {{:: 'partial-export.tooltip' | translate}} -

    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/partial-import.html b/themes/src/main/resources/theme/base/admin/resources/partials/partial-import.html deleted file mode 100644 index 4df12073b7..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/partial-import.html +++ /dev/null @@ -1,130 +0,0 @@ -
    - -

    - {{:: 'partial-import' | translate}} - {{:: 'partial-import.tooltip' | translate}} -

    - -
    -
    -
    - - -
    - - -
    - -
    - - -
    -
    - -
    - -
    -
    - -
    -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    -
    - -
    -
    - {{:: 'if-resource-exists.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - -
    - {{successMessage()}} - - - - - - - - - - - - - - - - - - - -
    {{:: 'action' | translate}}{{:: 'type' | translate}}{{:: 'name' | translate}}{{:: 'id' | translate}}
    {{result.action}}{{result.action}}{{result.action}}{{result.resourceType}}{{result.resourceName}}{{result.id}}
    - -
    - - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/password-policy.html b/themes/src/main/resources/theme/base/admin/resources/partials/password-policy.html deleted file mode 100755 index f211dba29e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/password-policy.html +++ /dev/null @@ -1,51 +0,0 @@ -
    -

    {{:: 'authentication' | translate}}

    - - - -
    - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    {{:: 'policy-type' | translate}}{{:: 'policy-value' | translate}}{{:: 'actions' | translate}}
    {{p.displayName}} - - {{:: 'delete' | translate}}
    - -
    -
    - - -
    -
    -
    - -
    - - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/protocol-mapper-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/protocol-mapper-detail.html deleted file mode 100755 index e555aafb42..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/protocol-mapper-detail.html +++ /dev/null @@ -1,64 +0,0 @@ -

    {{:: 'create-protocol-mapper' | translate}}

    -

    {{model.mapper.name|capitalize}}

    - -
    - -
    -
    - -
    - -
    - {{:: 'protocol.tooltip' | translate}} -
    -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'mapper.name.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{model.mapperType.helpText}} -
    -
    - -
    - -
    - {{model.mapperType.helpText}} -
    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-cache-settings.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-cache-settings.html deleted file mode 100755 index 53a7987f1e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-cache-settings.html +++ /dev/null @@ -1,30 +0,0 @@ -
    - - -
    -
    - -
    - -
    - - {{:: 'realm-cache-clear.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'user-cache-clear.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'keys-cache-clear.tooltip' | translate}} -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-create.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-create.html deleted file mode 100755 index f156c3b92f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-create.html +++ /dev/null @@ -1,45 +0,0 @@ -
    - -

    {{:: 'add-realm' | translate}}

    - -
    -
    -
    - - -
    - - -
    - -
    - - -
    -
    - -
    - - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-default-roles.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-default-roles.html deleted file mode 100755 index 41cb09b214..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-default-roles.html +++ /dev/null @@ -1,88 +0,0 @@ -
    -

    {{:: 'roles' | translate}}

    - - -
    -
    - - -
    -
    -
    - - {{:: 'default.available-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'realm-default-roles.tooltip' | translate}} - - -
    -
    -
    -
    - -
    - -
    - - -
    -
    -
    -
    - - {{:: 'default.available-roles-client.tooltip' | translate}} - - -
    -
    - - {{:: 'client-default-roles.tooltip' | translate}} - - -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-detail.html deleted file mode 100755 index 5ae2af8dfe..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-detail.html +++ /dev/null @@ -1,90 +0,0 @@ -
    - - -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    - {{:: 'realm-detail.frontendUrl.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'realm-detail.hostname.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'realm-detail.enabled.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'realm-detail.userManagedAccess.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'userProfileEnabled.tooltip' | translate}} -
    - -
    - - - {{:: 'realm-detail.protocol-endpoints.tooltip' | translate}} -
    - -
    -
    - - -
    - -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-events-admin.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-events-admin.html deleted file mode 100755 index d7279762e3..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-events-admin.html +++ /dev/null @@ -1,134 +0,0 @@ -
    -

    - {{:: 'admin-events' | translate}} - {{:: 'admin-events.tooltip' | translate}} -

    - - -

    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - - {{:: 'resource-path.tooltip' | translate}} -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - -
    - {{:: 'authentication-details' | translate}} - -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    {{:: 'time' | translate}}{{:: 'operation-type' | translate}}{{:: 'resource-type' | translate}}{{:: 'resource-path' | translate}}{{:: 'details' | translate}}
    - - - -
    {{event.time|date:('dateFormat' | translate)}}
    {{event.time|date:('timeFormat' | translate)}}
    {{event.operationType}}{{event.resourceType}}{{event.resourcePath}} - - -
    -
    -
    - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-events-config.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-events-config.html deleted file mode 100755 index 03cb51bd22..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-events-config.html +++ /dev/null @@ -1,117 +0,0 @@ -
    -

    - {{:: 'events-config' | translate}} - {{:: 'events-config.tooltip' | translate}} -

    - - -
    -

    {{:: 'events-config' | translate}}

    - -
    - -
    -
    - - {{:: 'event-listeners.tooltip' | translate}} -
    - -
    -
    -
    - -
    - {{:: 'login-events-settings' | translate}} - -
    - - {{:: 'login.save-events.tooltip' | translate}} -
    - -
    -
    - -
    - - {{:: 'saved-types.tooltip' | translate}} -
    - -
    -
    - -
    - - {{:: 'clear-events.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'events.expiration.tooltip' | translate}} -
    - - -
    -
    -
    - - -
    - {{:: 'admin-events-settings' | translate}} - -
    - - {{:: 'admin.save-events.tooltip' | translate}} -
    - -
    -
    - -
    - - {{:: 'include-representation.tooltip' | translate}} -
    - -
    -
    - -
    - - {{:: 'clear-admin-events.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'events.expiration.tooltip' | translate}} -
    - - -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-events.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-events.html deleted file mode 100755 index 91c7aab761..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-events.html +++ /dev/null @@ -1,124 +0,0 @@ -
    -

    - {{:: 'events' | translate}} - {{:: 'events.tooltip' | translate}} -

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - -
    - -
    -
    - -
    -
    {{:: 'time' | translate}}{{:: 'event-type' | translate}}{{:: 'details' | translate}}
    - - - -
    {{event.time|date:('dateFormat' | translate)}}
    {{event.time|date:('timeFormat' | translate)}}
    {{event.type}} - - - - - - - - - - - - - -
    {{:: 'client' | translate}}{{event.clientId}}
    {{:: 'user' | translate}}{{event.userId}}
    {{:: 'ip-address' | translate}}{{event.ipAddress}}
    {{:: 'error' | translate}}{{event.error}}
    {{:: 'details' | translate}} - - - - - - -
    {{key}}{{value}}
    -
    {{:: 'representation' | translate}} - -
    {{event.representation}}
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-bitbucket.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-bitbucket.html deleted file mode 100755 index fab751e2c6..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-bitbucket.html +++ /dev/null @@ -1,142 +0,0 @@ -
    - - - - -
    -
    -
    - -
    - -
    - {{:: 'redirect-uri.tooltip' | translate}} -
    -
    -
    -
    - -
    - -
    - {{:: 'bitbucket.key.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'bitbucket.secret.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'bitbucket.default-scopes.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.store-tokens.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.stored-tokens-readable.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'trust-email.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'link-only.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'hide-on-login-page.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'gui-order.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'first-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'post-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'sync-mode.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-facebook-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-facebook-ext.html deleted file mode 100755 index c8f111ae60..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-facebook-ext.html +++ /dev/null @@ -1,7 +0,0 @@ -
    - -
    - -
    - {{:: 'identity-provider.facebook-fetchedFields.tooltip' | translate}} -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-facebook.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-facebook.html deleted file mode 100755 index a4630ac786..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-facebook.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-github-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-github-ext.html deleted file mode 100755 index 8c9e30feb8..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-github-ext.html +++ /dev/null @@ -1,14 +0,0 @@ -
    - -
    - -
    - {{:: 'identity-provider.base-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.api-url.tooltip' | translate}} -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-github.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-github.html deleted file mode 100755 index a4630ac786..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-github.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-gitlab.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-gitlab.html deleted file mode 100755 index 6efcc19d86..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-gitlab.html +++ /dev/null @@ -1,142 +0,0 @@ -
    - - - - -
    -
    -
    - -
    - -
    - {{:: 'redirect-uri.tooltip' | translate}} -
    -
    -
    -
    - -
    - -
    - {{:: 'gitlab.application-id.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'gitlab.application-secret.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'gitlab.default-scopes.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.store-tokens.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.stored-tokens-readable.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'trust-email.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'link-only.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'hide-on-login-page.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'gui-order.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'first-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'post-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'sync-mode.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-google-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-google-ext.html deleted file mode 100755 index 4f313a8b24..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-google-ext.html +++ /dev/null @@ -1,21 +0,0 @@ -
    - -
    - -
    - {{:: 'identity-provider.google-hostedDomain.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.google-userIp.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.google-offlineAccess.tooltip' | translate}} -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-google.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-google.html deleted file mode 100755 index a4630ac786..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-google.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-instagram-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-instagram-ext.html deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-instagram.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-instagram.html deleted file mode 100644 index a4630ac786..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-instagram.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-keycloak-oidc.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-keycloak-oidc.html deleted file mode 100755 index d3807496c2..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-keycloak-oidc.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-linkedin-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-linkedin-ext.html deleted file mode 100755 index 4bd2ea716e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-linkedin-ext.html +++ /dev/null @@ -1,11 +0,0 @@ -
    - -
    - -
    - {{:: 'identity-provider.linkedin-profileProjection.tooltip' | translate}} -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-linkedin.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-linkedin.html deleted file mode 100755 index a4630ac786..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-linkedin.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-microsoft-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-microsoft-ext.html deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-microsoft.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-microsoft.html deleted file mode 100755 index a4630ac786..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-microsoft.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-oidc.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-oidc.html deleted file mode 100755 index 15edcfac4a..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-oidc.html +++ /dev/null @@ -1,395 +0,0 @@ -
    - - - - -
    -
    -
    - -
    - -
    - {{:: 'redirect-uri.tooltip' | translate}} -
    -
    -
    -
    - -
    - -
    - {{:: 'identity-provider.alias.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.display-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.store-tokens.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.stored-tokens-readable.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'trust-email.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'link-only.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'hide-on-login-page.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'gui-order.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'first-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'post-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'sync-mode.tooltip' | translate}} -
    -
    -
    - {{:: 'openid-connect-config' | translate}} {{:: 'openid-connect-config.tooltip' | translate}} -
    - -
    - -
    - {{:: 'authorization-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'loginHint.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'passMaxAge.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'uiLocales.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'token-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.logout-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'backchannel-logout.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.disableUserInfo.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'user-info-url.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'client-auth.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.client-id.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client-secret.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'client-assertion-signing-algorithm.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'issuer.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.default-scopes.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'prompt.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'accepts-prompt-none-forward-from-client.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.validate-signatures.tooltip' | translate}} -
    - -
    - -
    - -
    - -
    - {{:: 'identity-provider.use-jwks-url.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'identity-provider.jwks-url.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'identity-provider.validating-public-key.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'identity-provider.validating-public-key-id.tooltip' | translate}} -
    - -
    - -
    - -
    - -
    - {{:: 'pkce-enabled.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'pkce-method.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'identity-provider.allowed-clock-skew.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.forwarded-query-parameters.tooltip' | translate}} -
    -
    -
    - {{:: 'import-external-idp-config' | translate}} {{:: 'import-external-idp-config.tooltip' | translate}} -
    - -
    - -
    - {{:: 'identity-provider.import-from-url.tooltip' | translate}} -
    -
    - -
    - -
    -
    -
    - - {{:: 'identity-provider.import-from-file.tooltip' | translate}} -
    -
    - - -
    - - {{files[0].name}} - -
    -
    - -
    - -
    -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    - - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v3-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v3-ext.html deleted file mode 100644 index b1c27defef..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v3-ext.html +++ /dev/null @@ -1,7 +0,0 @@ -
    - -
    - -
    - {{:: 'openshift.base-url.tooltip' | translate}} -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v3.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v3.html deleted file mode 100755 index eb42ba1fb9..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v3.html +++ /dev/null @@ -1,164 +0,0 @@ -
    - - - - -
    -
    -
    - -
    - -
    - {{:: 'redirect-uri.tooltip' | translate}} -
    -
    -
    -
    - -
    - -
    - {{:: 'identity-provider.alias.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.display-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'social.client-id.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'social.client-secret.tooltip' | translate}} -
    -
    -
    - -
    - -
    - {{:: 'social.default-scopes.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.store-tokens.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.stored-tokens-readable.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.disableUserInfo.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'trust-email.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'link-only.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'hide-on-login-page.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'gui-order.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'first-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'post-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'sync-mode.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v4-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v4-ext.html deleted file mode 100644 index 46254be4ad..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v4-ext.html +++ /dev/null @@ -1,7 +0,0 @@ -
    - -
    - -
    - {{:: 'openshift4.base-url.tooltip' | translate}} -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v4.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v4.html deleted file mode 100755 index 9e14154287..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-openshift-v4.html +++ /dev/null @@ -1,164 +0,0 @@ -
    - - - - -
    -
    -
    - -
    - -
    - {{:: 'redirect-uri.tooltip' | translate}} -
    -
    -
    -
    - -
    - -
    - {{:: 'identity-provider.alias.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.display-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'social.client-id.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'social.client-secret.tooltip' | translate}} -
    -
    -
    - -
    - -
    - {{:: 'social.default-scopes.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.store-tokens.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.stored-tokens-readable.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.disableUserInfo.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'trust-email.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'linkOnly.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'hide-on-login-page.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'gui-order.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'first-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'post-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'sync-mode.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-paypal-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-paypal-ext.html deleted file mode 100644 index 692a078b90..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-paypal-ext.html +++ /dev/null @@ -1,7 +0,0 @@ -
    - -
    - -
    - {{:: 'identity-provider.paypal-sandbox.tooltip' | translate}} -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-paypal.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-paypal.html deleted file mode 100644 index 62e97badb2..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-paypal.html +++ /dev/null @@ -1 +0,0 @@ -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-saml.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-saml.html deleted file mode 100755 index 2cbbf27747..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-saml.html +++ /dev/null @@ -1,447 +0,0 @@ -
    - - - - -
    -
    -
    - -
    - -
    - {{:: 'redirect-uri.tooltip' | translate}} -
    -
    -
    -
    - -
    - -
    - {{:: 'identity-provider.alias.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.display-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.store-tokens.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.stored-tokens-readable.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'trust-email.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'link-only.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'hide-on-login-page.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'gui-order.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'first-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'post-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'sync-mode.tooltip' | translate}} -
    -
    - - - {{:: 'identity-provider.saml.protocol-endpoints.saml.tooltip' | translate}} -
    -
    -
    - {{:: 'saml-config' | translate}} {{:: 'identity-provider.saml-config.tooltip' | translate}} - -
    - -
    - -
    - {{:: 'identity-provider.saml.entity-id.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.saml.idp-entity-id.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'saml.single-signon-service-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'saml.single-logout-service-url.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'backchannel-logout.tooltip' | translate}} -
    -
    - -
    - - -
    - {{:: 'nameid-policy-format.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'saml.principal-type.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'saml.principal-attribute.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'saml.allow-create.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'http-post-binding-response.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'http-post-binding-for-authn-request.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'http-post-binding-logout.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'want-authn-requests-signed.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'want-assertions-signed.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'want-assertions-encrypted.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'signature-algorithm.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'saml-encryption-algorithm.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'saml-signature-keyName-transformer.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.force-authentication.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'saml.validate-signature.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'validating-x509-certificate.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.saml.sign-sp-metadata.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'saml.loginHint.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.allowed-clock-skew.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.saml.attribute-consuming-service-index.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.saml.attribute-consuming-service-name.tooltip' | translate}} -
    -
    -
    - {{:: 'identity-provider.saml.requested-authncontext' | translate}} {{:: 'identity-provider.saml.requested-authncontext.tooltip' | translate}} - -
    - -
    -
    - -
    -
    - {{:: 'identity-provider.saml.authncontext-comparison-type.tooltip' | translate}} -
    -
    - -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - {{:: 'identity-provider.saml.authncontext-class-ref.tooltip' | translate}} -
    -
    - -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - {{:: 'identity-provider.saml.authncontext-decl-ref.tooltip' | translate}} -
    -
    -
    - {{:: 'import-external-idp-config' | translate}} {{:: 'import-external-idp-config.tooltip' | translate}} -
    - -
    - -
    - {{:: 'saml.import-from-url.tooltip' | translate}} -
    -
    - -
    - -
    -
    -
    - -
    -
    - - -
    - - {{files[0].name}} - -
    -
    - -
    - -
    -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-social.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-social.html deleted file mode 100755 index b745634801..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-social.html +++ /dev/null @@ -1,157 +0,0 @@ -
    - - - - -
    -
    -
    - -
    - -
    - {{:: 'redirect-uri.tooltip' | translate}} -
    -
    -
    -
    - -
    - -
    - {{:: 'social.client-id.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'social.client-secret.tooltip' | translate}} -
    -
    -
    - -
    - -
    - {{:: 'social.default-scopes.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.store-tokens.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.stored-tokens-readable.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'accepts-prompt-none-forward-from-client.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider.disableUserInfo.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'trust-email.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'link-only.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'hide-on-login-page.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'gui-order.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'first-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'post-broker-login-flow.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'sync-mode.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-stackoverflow-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-stackoverflow-ext.html deleted file mode 100755 index 5e478f60b2..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-stackoverflow-ext.html +++ /dev/null @@ -1,7 +0,0 @@ -
    - -
    - -
    - {{:: 'stackoverflow.key.tooltip' | translate}} -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-stackoverflow.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-stackoverflow.html deleted file mode 100755 index a4630ac786..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-stackoverflow.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-twitter-ext.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-twitter-ext.html deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-twitter.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-twitter.html deleted file mode 100755 index a4630ac786..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-twitter.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider.html deleted file mode 100755 index 3422752962..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider.html +++ /dev/null @@ -1,81 +0,0 @@ -
    -

    {{:: 'identity-providers' | translate}}

    -
    -
    - -
    -

    - {{:: 'identity-providers' | translate}} -

    -

    - Through Identity Brokering it's easy to allow users to authenticate to Keycloak using external Identity Providers or Social Networks.
    We have built-in support for OpenID Connect and SAML 2.0 as well as a number of social networks such as Google, GitHub, Facebook and Twitter. -

    -

    To get started select a provider from the dropdown below:

    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'name' | translate}}{{:: 'provider' | translate}}{{:: 'enabled' | translate}}{{:: 'hidden' | translate}}{{:: 'link-only-column' | translate}}{{:: 'gui-order' | translate}}{{:: 'actions' | translate}}
    - - {{identityProvider.displayName}} - {{identityProvider.provider.name}} - {{identityProvider.alias}} - - {{identityProvider.providerId}}{{identityProvider.config.guiOrder}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-disabled.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-disabled.html deleted file mode 100755 index 242c841dc9..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-disabled.html +++ /dev/null @@ -1,70 +0,0 @@ - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    {{:: 'algorithm' | translate}}{{:: 'type' | translate}}{{:: 'kid' | translate}}{{:: 'priority' | translate}}{{:: 'provider' | translate}}{{:: 'publicKeys' | translate}}
    {{key.algorithm}}{{key.type}}{{key.kid}}{{key.providerPriority}}{{key.provider.name}}{{:: 'publicKey' | translate}}{{:: 'certificate' | translate}}
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-generic.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-generic.html deleted file mode 100755 index dd2017ace8..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-generic.html +++ /dev/null @@ -1,69 +0,0 @@ - - -
    - - - - - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'console-display-name.tooltip' | translate}} -
    - - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-passive.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-passive.html deleted file mode 100755 index 65f934a487..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-passive.html +++ /dev/null @@ -1,70 +0,0 @@ - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    {{:: 'algorithm' | translate}}{{:: 'type' | translate}}{{:: 'kid' | translate}}{{:: 'priority' | translate}}{{:: 'provider' | translate}}{{:: 'publicKeys' | translate}}
    {{key.algorithm}}{{key.type}}{{key.kid}}{{key.providerPriority}}{{key.provider.name}}{{:: 'publicKey' | translate}}{{:: 'certificate' | translate}}
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-providers.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-providers.html deleted file mode 100755 index c303a38bc2..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys-providers.html +++ /dev/null @@ -1,75 +0,0 @@ - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    {{:: 'name' | translate}}{{:: 'provider' | translate}}{{:: 'providerHelpText' | translate}}{{:: 'priority' | translate}}{{:: 'actions' | translate}}
    {{instance.name}}{{instance.providerId}}{{instance.provider.helpText}}{{instance.config['priority'][0]}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    - -
    - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys.html deleted file mode 100755 index ef05d458b7..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-keys.html +++ /dev/null @@ -1,73 +0,0 @@ - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    {{:: 'algorithm' | translate}}{{:: 'type' | translate}}{{:: 'kid' | translate}}{{:: 'use' | translate}}{{:: 'priority' | translate}}{{:: 'provider' | translate}}{{:: 'publicKeys' | translate}}
    {{key.algorithm}}{{key.type}}{{key.kid}}{{key.use}}{{key.providerPriority}}{{key.provider.name}}{{:: 'publicKey' | translate}}{{:: 'certificate' | translate}}
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-list.html deleted file mode 100755 index 099fe6d51b..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-list.html +++ /dev/null @@ -1,20 +0,0 @@ -
    - -

    {{:: 'realms' | translate}}

    - - - - - - - - - - - - -
    {{:: 'realm' | translate}}
    {{r.realm}}
    -
    - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-localization-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-localization-detail.html deleted file mode 100644 index c790256574..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-localization-detail.html +++ /dev/null @@ -1,50 +0,0 @@ -
    - - - -
    -
    -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-localization-upload.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-localization-upload.html deleted file mode 100644 index a15352c498..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-localization-upload.html +++ /dev/null @@ -1,37 +0,0 @@ -
    - - - - -
    -
    - -
    - -
    -
    -
    - -
    -
    - - -
    - - {{files[0].name}} - -
    -
    -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-localization.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-localization.html deleted file mode 100644 index 04f9bd6f9f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-localization.html +++ /dev/null @@ -1,61 +0,0 @@ -
    - - - - -
    -
    - -
    - -
    -
    - {{:: 'no-localizations-configured' | translate}} -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'key' | translate}}{{:: 'value' | translate}}{{:: 'actions' | translate}}
    {{pair[0]}}{{pair[1]}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-login-settings.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-login-settings.html deleted file mode 100755 index 7f6837322f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-login-settings.html +++ /dev/null @@ -1,107 +0,0 @@ -
    - - -
    -
    -
    - -
    - -
    - {{:: 'registrationAllowed.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'registrationEmailAsUsername.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'editUsernameAllowed.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'resetPasswordAllowed.tooltip' |translate}} -
    -
    - -
    - -
    - {{:: 'rememberMe.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'verifyEmail.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'loginWithEmailAllowed.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'duplicateEmailsAllowed.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'sslRequired.tooltip' | translate}} -
    -
    - -
    -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    - {{:: 'acr-loa-map.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-role-users.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-role-users.html deleted file mode 100644 index 11cbbc6840..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-role-users.html +++ /dev/null @@ -1,50 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {{:: 'username' | translate}}{{:: 'last-name' | translate}}{{:: 'first-name' | translate}}{{:: 'email' | translate}}
    -
    - - - -
    -
    {{user.username}}{{user.lastName}}{{user.firstName}}{{user.email}}{{:: 'edit' | translate}}
    {{:: 'no-role-members' | translate}}{{:: 'no-role-members' | translate}}
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-smtp.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-smtp.html deleted file mode 100755 index 7533071dec..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-smtp.html +++ /dev/null @@ -1,96 +0,0 @@ -
    - - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'fromDisplayName.tooltip' | translate}} -
    -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'replyToDisplayName.tooltip' | translate}} -
    -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'envelopeFrom.tooltip' | translate}} -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'smtp-password.tooltip' | translate}} -
    - -
    -
    - - -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-theme-settings.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-theme-settings.html deleted file mode 100755 index be74a2af8c..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-theme-settings.html +++ /dev/null @@ -1,97 +0,0 @@ -
    - - -
    -
    -
    - -
    -
    - -
    -
    - {{:: 'login-theme.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{ 'account-theme.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'select-theme-admin-console' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'select-theme-email' | translate}} -
    -
    - -
    - -
    -
    -
    - - -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-tokens.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-tokens.html deleted file mode 100755 index c5243a0058..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-tokens.html +++ /dev/null @@ -1,409 +0,0 @@ -
    - - -
    - -
    - - -
    - -
    - - {{:: 'default-signature-algorithm.tooltip' | translate}} - -
    - -
    - - -
    - -
    - - {{:: 'revoke-refresh-token.tooltip' | translate}} - -
    - -
    - - -
    - -
    - - {{:: 'refresh-token-max-reuse.tooltip' | translate}} - -
    - -
    - - -
    - - -
    - {{:: 'sso-session-idle.tooltip' | translate}} - -
    - -
    - - -
    - - -
    - {{:: 'sso-session-max.tooltip' | translate}} -
    - -
    - - -
    - - -
    - {{:: 'sso-session-idle-remember-me.tooltip' | translate}} -
    - -
    - - -
    - - -
    - {{:: 'sso-session-max-remember-me.tooltip' | translate}} -
    - -
    - - -
    - - -
    - {{:: 'offline-session-idle.tooltip' | translate}} -
    - - -
    - -
    - -
    - {{:: 'offline-session-max-limited.tooltip' | translate}} -
    -
    - -
    - - -
    - {{:: 'offline-session-max.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'client-offline-session-idle.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'client-offline-session-max.tooltip' | translate}} -
    - -
    - -
    - - -
    - {{:: 'client-session-idle.tooltip' | translate}} -
    - -
    - -
    - - -
    - {{:: 'client-session-max.tooltip' | translate}} -
    - -
    - - -
    - - -
    - {{:: 'access-token-lifespan.tooltip' | translate}} -
    - -
    - - -
    - - -
    - {{:: 'access-token-lifespan-for-implicit-flow.tooltip' | translate}} -
    - -
    - - -
    - - -
    - {{:: 'client-login-timeout.tooltip' | translate}} -
    - -
    - - -
    - - -
    - {{:: 'login-timeout.tooltip' | translate}} -
    - -
    - - -
    - - -
    - - {{:: 'login-action-timeout.tooltip' | translate}} - -
    - -
    - - -
    - - -
    - - {{:: 'action-token-generated-by-user-lifespan.tooltip' | translate}} - -
    - -
    - - -
    - - -
    - - {{:: 'action-token-generated-by-admin-lifespan.tooltip' | translate}} - -
    - -
    - - -
    - - -
    - - {{:: 'request-uri-lifespan.tooltip' | translate}} - -
    - -
    - -
    - - - - -
    - - {{:: 'action-token-generated-by-user.tooltip' | translate}} - -
    - -
    - - -
    - - -
    - {{:: 'oauth2-device-code-lifespan.tooltip' | translate}} -
    - -
    - - -
    - -
    - {{:: 'oauth2-device-polling-interval.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'short-verification-uri.tooltip' | translate}} -
    - -
    -
    - - -
    -
    - -
    - -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/realm-user-profile.html b/themes/src/main/resources/theme/base/admin/resources/partials/realm-user-profile.html deleted file mode 100755 index 842369cc28..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/realm-user-profile.html +++ /dev/null @@ -1,372 +0,0 @@ -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    - - -
    -
    -
    - -
    - -
    -

    - {{:: 'user.profile.attribute' | translate}} {{currentAttribute.name}} {{:: 'configuration' | translate}} - -

    - - {{:: 'user.profile.attribute.name.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'user.profile.attribute.displayName.tooltip' | translate}} -
    - -
    -
    - -
    - -
    -
    - -
    -
    - {{:: 'user.profile.attribute.group.tooltip' | translate}} -
    - -
    - - {{:: 'user.profile.attribute.selector.scopes.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'user.profile.attribute.required.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'user.profile.attribute.required.roles.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'user.profile.attribute.required.scopes.tooltip' | translate}} -
    - -
    -
    -
    - {{:: 'user.profile.attribute.permission' | translate}} -
    - - {{:: 'user.profile.attribute.canUserView.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'user.profile.attribute.canAdminView.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'user.profile.attribute.canUserEdit.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'user.profile.attribute.canAdminEdit.tooltip' | translate}} -
    - -
    -
    -
    -
    - {{:: 'user.profile.attribute.validation' | translate}} -
    - - {{:: 'user.profile.attribute.validation.add.validator.tooltip' | translate}} -
    - -
    -
    - -

    -

    -
    - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    -
    - {{:: 'user.profile.attribute.annotation' | translate}} -
    - - - - - - - - - - - - - - - - - - - - -
    {{:: 'key' | translate}}{{:: 'value' | translate}}{{:: 'actions' | translate}}
    {{key}}{{:: 'delete' | translate}}
    {{:: 'add' | translate}} -
    -
    -
    -
    -

    -

    - - -
    -
    -
    - -
    -

    - {{:: 'user.profile.attributegroup' | translate}} {{currentAttributeGroup.name}} {{:: 'configuration' | translate}} - -

    - - {{:: 'user.profile.attributegroup.name.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'user.profile.attributegroup.displayHeader.tooltip' | translate}} -
    - -
    -
    -
    - - {{:: 'user.profile.attributegroup.displayDescription.tooltip' | translate}} -
    - -
    -
    - -
    - {{:: 'user.profile.attributegroup.annotation' | translate}} -
    - - - - - - - - - - - - - - - - - - - - -
    {{:: 'key' | translate}}{{:: 'value' | translate}}{{:: 'actions' | translate}}
    {{key}}{{:: 'delete' | translate}}
    {{:: 'add' | translate}} -
    -
    -
    -
    -

    -

    - - -
    -
    -
    - -
    - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/required-actions.html b/themes/src/main/resources/theme/base/admin/resources/partials/required-actions.html deleted file mode 100755 index ab16456c9e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/required-actions.html +++ /dev/null @@ -1,38 +0,0 @@ -
    -

    {{:: 'authentication' | translate}}

    - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    -
    {{:: 'required-action' | translate}}{{:: 'enabled' | translate}}{{:: 'default-action' | translate}}
    - - - {{requiredAction.name}} -
    {{:: 'no-required-actions-configured' | translate}}
    - -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/role-attributes.html b/themes/src/main/resources/theme/base/admin/resources/partials/role-attributes.html deleted file mode 100755 index b9cbbd7e87..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/role-attributes.html +++ /dev/null @@ -1,41 +0,0 @@ -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    {{:: 'key' | translate}}{{:: 'value' | translate}}{{:: 'actions' | translate}}
    {{key}}{{:: 'delete' | translate}}
    {{:: 'add' | translate}}
    - -
    -
    - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/role-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/role-detail.html deleted file mode 100755 index 7595f65550..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/role-detail.html +++ /dev/null @@ -1,135 +0,0 @@ -
    - - - - - -
    -
    -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    - -
    - -
    - {{:: 'composite-roles.tooltip' | translate}} -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    - {{:: 'composite-roles' | translate}} -
    - - -
    -
    -
    - - {{:: 'composite.available-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'composite.associated-roles.tooltip' | translate}} - - -
    -
    -
    -
    - -
    - -
    - - -
    - - -
    -
    -
    - - {{:: 'composite.available-roles-client.tooltip' | translate}} - - -
    -
    - - {{:: 'composite.associated-roles-client.tooltip' | translate}} - - -
    -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/role-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/role-list.html deleted file mode 100755 index 6329cccdc3..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/role-list.html +++ /dev/null @@ -1,63 +0,0 @@ -
    -

    Roles

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - - -
    -
    {{:: 'role-name' | translate}}{{:: 'composite' | translate}}{{:: 'description' | translate}}{{:: 'actions' | translate}}
    {{role.name}}{{role.description}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-results' | translate}}{{:: 'no-realm-roles-available' | translate}}
    -
    - - - -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/role-mappings.html b/themes/src/main/resources/theme/base/admin/resources/partials/role-mappings.html deleted file mode 100755 index 184a849a7e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/role-mappings.html +++ /dev/null @@ -1,119 +0,0 @@ -
    - - - - -
    -
    - - -
    -
    -
    - - - - {{:: 'user.add-selected.tooltip' | translate}} -
    -
    - - {{:: 'user.assigned-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'user.effective-roles.tooltip' | translate}} - -
    -
    -
    -
    - -
    - -
    - - -
    - - -
    -
    -
    - - {{:: 'user.available-roles.tooltip' | translate}} - - -
    -
    - - {{:: 'user.assigned-roles-client.tooltip' | translate}} - - -
    -
    - - {{:: 'user.effective-roles-client.tooltip' | translate}} - -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/server-info-providers.html b/themes/src/main/resources/theme/base/admin/resources/partials/server-info-providers.html deleted file mode 100755 index be741c124d..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/server-info-providers.html +++ /dev/null @@ -1,55 +0,0 @@ -
    -

    - {{:: 'server-info' | translate}} - -

    - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -
    -
    -
    {{:: 'spi' | translate}}{{:: 'providers' | translate}}
    {{spi.name}} -
    - {{providerName}} - - - - - - - -
    {{key}}{{value}}
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/server-info.html b/themes/src/main/resources/theme/base/admin/resources/partials/server-info.html deleted file mode 100755 index 6d2441971a..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/server-info.html +++ /dev/null @@ -1,135 +0,0 @@ -
    -

    - {{:: 'server-info' | translate}} - -

    - - - - - - - - - - - - - - - - -
    {{:: 'server-version' | translate}}{{serverInfo.systemInfo.version}}
    {{:: 'server-time' | translate}}{{serverInfo.systemInfo.serverTime}}
    {{:: 'server-uptime' | translate}}{{serverInfo.systemInfo.uptime}}
    - - - {{:: 'profile' | translate}} - - - - - - - - - - - - - - - - - - -
    {{:: 'server-profile' | translate}}{{serverInfo.profileInfo.name | capitalize}}
    - {{:: 'server-disabled' | translate}} - {{:: 'server-disabled.tooltip' | translate}} - {{serverInfo.profileInfo.disabledFeatures.sort().join(', ')}}
    - {{:: 'server-preview' | translate}} - {{:: 'server-preview.tooltip' | translate}} - {{serverInfo.profileInfo.previewFeatures.sort().join(', ')}}
    - {{:: 'server-experimental' | translate}} - {{:: 'server-experimental.tooltip' | translate}} - {{serverInfo.profileInfo.experimentalFeatures.sort().join(', ')}}
    - -
    - {{:: 'memory' | translate}} - - - - - - - - - - - - - -
    {{:: 'total-memory' | translate}}{{serverInfo.memoryInfo.totalFormated}}
    {{:: 'free-memory' | translate}}{{serverInfo.memoryInfo.freeFormated}} ({{serverInfo.memoryInfo.freePercentage}}%)
    {{:: 'used-memory' | translate}}{{serverInfo.memoryInfo.usedFormated}}
    -
    - -
    - {{:: 'system' | translate}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {{:: 'current-working-directory' | translate}}{{serverInfo.systemInfo.userDir}}
    {{:: 'java-version' | translate}}{{serverInfo.systemInfo.javaVersion}}
    {{:: 'java-vendor' | translate}}{{serverInfo.systemInfo.javaVendor}}
    {{:: 'java-runtime' | translate}}{{serverInfo.systemInfo.javaRuntime}}
    {{:: 'java-vm' | translate}}{{serverInfo.systemInfo.javaVm}}
    {{:: 'java-vm-version' | translate}}{{serverInfo.systemInfo.javaVmVersion}}
    {{:: 'java-home' | translate}}{{serverInfo.systemInfo.javaHome}}
    {{:: 'user-name' | translate}}{{serverInfo.systemInfo.userName}}
    {{:: 'user-timezone' | translate}}{{serverInfo.systemInfo.userTimezone}}
    {{:: 'user-locale' | translate}}{{serverInfo.systemInfo.userLocale}}
    {{:: 'system-encoding' | translate}}{{serverInfo.systemInfo.fileEncoding}}
    {{:: 'operating-system' | translate}}{{serverInfo.systemInfo.osName}} {{serverInfo.systemInfo.osVersion}}
    {{:: 'os-architecture' | translate}}{{serverInfo.systemInfo.osArchitecture}}
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/session-realm.html b/themes/src/main/resources/theme/base/admin/resources/partials/session-realm.html deleted file mode 100755 index 79232a05b0..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/session-realm.html +++ /dev/null @@ -1,34 +0,0 @@ -
    -

    {{:: 'sessions' | translate}}

    - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'client' | translate}}{{:: 'active-sessions' | translate}}{{:: 'offline-sessions' | translate}}
    {{data.clientId}}{{data.active}}{{data.offline}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/session-revocation.html b/themes/src/main/resources/theme/base/admin/resources/partials/session-revocation.html deleted file mode 100755 index 03c6864582..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/session-revocation.html +++ /dev/null @@ -1,30 +0,0 @@ -
    -

    {{:: 'sessions' | translate}}

    - - - -
    -
    -
    - -
    - -
    - {{:: 'not-before.tooltip' | translate}} -
    -
    - -
    -
    - - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html deleted file mode 100755 index 10e3d8fcfe..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html +++ /dev/null @@ -1,41 +0,0 @@ -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    {{:: 'key' | translate}}{{:: 'value' | translate}}{{:: 'actions' | translate}}
    {{key}}{{:: 'delete' | translate}}
    {{:: 'add' | translate}}
    - -
    -
    - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-consents.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-consents.html deleted file mode 100644 index 76eb0a85af..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-consents.html +++ /dev/null @@ -1,41 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    {{:: 'client' | translate}}{{:: 'granted-client-scopes' | translate}}{{:: 'additional-grants' | translate}}{{:: 'consent-created-date' | translate}}{{:: 'consent-last-updated-date' | translate}}{{:: 'action' | translate}}
    {{consent.clientId}} - - , {{clientScope}} - - - - , {{additionalGrant.key}} - - {{consent.createdDate | date :'short'}}{{consent.lastUpdatedDate | date :'short'}}{{:: 'revoke' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-credentials.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-credentials.html deleted file mode 100755 index 737b4b18ad..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-credentials.html +++ /dev/null @@ -1,173 +0,0 @@ -
    - - - - -
    - -
    - - {{:: 'supported-user-storage-credential-types' | translate}} - {{:: 'supported-user-storage-credential-types.tooltip' | translate}} - - - - - - - - - - - - - -
    - -
    - - {{:: 'manage-credentials' | translate}} - {{:: 'manage-credentials.tooltip' | translate}} - - - {{:: 'manage-credentials' | translate}} - - - - - - - - - - - - - - - - - - - - -
    - -
    - {{ (hasPassword ? 'reset-password' : 'set-password') | translate }} -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    - {{:: 'credentials.temporary.tooltip' | translate}} -
    - -
    -
    - -
    -
    -
    - -
    - {{:: 'disable-credentials' | translate}} -
    - - -
    - -
    - {{:: 'credentials.disableable.tooltip' | translate}} -
    -
    - - -
    - -
    - {{:: 'credentials.disable.tooltip' | translate}} -
    -
    - -
    - {{:: 'credential-reset-actions' | translate}} -
    - - -
    - -
    - {{:: 'credentials.reset-actions.tooltip' | translate}} -
    -
    - - -
    - - -
    - {{:: 'credential-reset-actions-timeout.tooltip' | translate}} -
    -
    - - -
    - -
    - {{:: 'credentials.reset-actions-email.tooltip' | translate}} -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-detail.html deleted file mode 100755 index 10ca22c03d..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-detail.html +++ /dev/null @@ -1,186 +0,0 @@ -
    - - - - -
    - -
    -
    - -
    - -
    -
    - -
    - -
    - {{user.createdTimestamp|date:('dateFormat' | translate)}} {{user.createdTimestamp|date:('timeFormat' | translate)}} -
    -
    - -
    - -
    - - -
    -
    - - -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    - -
    - -
    - -
    - {{:: 'user-enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'user-temporarily-locked.tooltip' | translate}} -
    - -
    -
    -
    - - - {{:: 'user-link.tooltip' | translate}} -
    -
    - - - {{:: 'user-origin.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'email-verified.tooltip' | translate}} -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -
    -
    -
    {{:: 'groups-joining-path' | translate}}{{:: 'actions' | translate}}
    {{group.path}} - {{:: 'remove' | translate}} -
    {{:: 'groups-joining-no-selected' | translate}}
    -
    - {{:: 'groups-joining.tooltip' | translate}} -
    -
    - - -
    - -
    - {{:: 'required-user-actions.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    -
    - -
    - - -
    - -
    - {{:: 'impersonate-user.tooltip' | translate}} -
    - -
    - -
    -
    - - -
    - -
    - - -
    -
    - -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-federated-identity-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-federated-identity-detail.html deleted file mode 100644 index aa5d04953e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-federated-identity-detail.html +++ /dev/null @@ -1,53 +0,0 @@ -
    - - -

    {{:: 'add-identity-provider-link' | translate}}

    - - - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    - -
    - {{:: 'identity-provider-user-id.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'identity-provider-username.tooltip' | translate}} -
    - -
    - - -
    -
    - - -
    -
    - -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-federated-identity-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-federated-identity-list.html deleted file mode 100644 index 82f96f68e0..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-federated-identity-list.html +++ /dev/null @@ -1,41 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'identity-provider-alias' | translate}}{{:: 'provider-user-id' | translate}}{{:: 'provider-username' | translate}}{{:: 'action' | translate}}
    {{identity.identityProvider}}{{identity.userId}}{{identity.userName}}{{:: 'remove' | translate}}
    {{:: 'no-identity-provider-links-available' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-federation.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-federation.html deleted file mode 100755 index 3e702f399b..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-federation.html +++ /dev/null @@ -1,69 +0,0 @@ -
    -

    - {{:: 'user-federation' | translate}} -

    - -
    -
    - -
    -

    - {{:: 'user-federation' | translate}} -

    -

    Keycloak can federate external user databases. Out of the box we have support for LDAP and Active Directory.

    -

    To get started select a provider from the dropdown below:

    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    {{:: 'id' | translate}}{{:: 'enabled' | translate}}{{:: 'provider-name' | translate}}{{:: 'priority' | translate}}{{:: 'actions' | translate}}
    {{getInstanceName(instance)}}{{isProviderEnabled(instance)}}{{getInstanceProvider(instance) | capitalize}}{{getInstancePriority(instance)}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-user-federation-providers-configured' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-group-membership.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-group-membership.html deleted file mode 100755 index abfb237fe8..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-group-membership.html +++ /dev/null @@ -1,114 +0,0 @@ -
    - - - - -
    -
    - - -
    -
    -
    - - - - - - - - - - - -
    -
    -
    - - {{:: 'group-membership.tooltip' | translate}} -
    -
    -
    - -
    - -
    -
    -
    -   - -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - - - - - - - - - - -
    - -
    -
    - - {{:: 'membership.available-groups.tooltip' | translate}} -
    -
    -
    - -
    - -
    -
    -
    -   - -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-list.html deleted file mode 100755 index b9b170a89f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-list.html +++ /dev/null @@ -1,69 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - - -
    - - {{:: 'add-user' | translate}} -
    -
    -
    {{:: 'id' | translate}}{{:: 'username' | translate}}{{:: 'email' | translate}}{{:: 'last-name' | translate}}{{:: 'first-name' | translate}}{{:: 'actions' | translate}}
    -
    - - - -
    -
    {{user.id}}{{user.username}}{{user.email}}{{user.lastName}}{{user.firstName}}{{:: 'edit' | translate}}{{:: 'impersonate' | translate}}{{:: 'delete' | translate}}
    {{:: 'users.instruction' | translate}}{{:: 'no-results' | translate}}{{:: 'no-users-available' | translate}}
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-offline-sessions.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-offline-sessions.html deleted file mode 100644 index 0194bca6ee..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-offline-sessions.html +++ /dev/null @@ -1,35 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - -
    {{:: 'ip-address' | translate}}{{:: 'started' | translate}}{{:: 'last-refresh' | translate}}
    {{session.ipAddress}}{{session.start | date:'medium'}}{{session.lastAccess | date:'medium'}}
    - -
    -
    - -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-sessions.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-sessions.html deleted file mode 100755 index 02c195940c..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-sessions.html +++ /dev/null @@ -1,43 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    {{:: 'ip-address' | translate}}{{:: 'started' | translate}}{{:: 'last-access' | translate}}{{:: 'clients' | translate}}{{:: 'action' | translate}}
    {{session.ipAddress}}{{session.start | date:'medium'}}{{session.lastAccess | date:'medium'}} - - - {{:: 'logout' | translate}}
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-generic.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-generic.html deleted file mode 100755 index 2b2456c883..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-generic.html +++ /dev/null @@ -1,246 +0,0 @@ -
    - - - - -
    -
    - {{:: 'required-settings' | translate}} -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'user-storage.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'console-display-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'priority.tooltip' | translate}} -
    - - - -
    - -
    - {{:: 'sync-settings' | translate}} -
    - -
    - -
    - {{:: 'periodic-full-sync.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'full-sync-period.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'periodic-changed-users-sync.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'changed-users-sync-period.tooltip' | translate}} -
    -
    - - -
    - {{:: 'user-storage-cache-policy' | translate}} -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.evictionDay.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.evictionHour.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.evictionMinute.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'userStorage.cachePolicy.maxLifespan.tooltip' | translate}} -
    -
    - - -
    -
    - - -
    -
    - -
    -
    - - - - - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-kerberos.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-kerberos.html deleted file mode 100644 index b7fa6efe05..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-kerberos.html +++ /dev/null @@ -1,264 +0,0 @@ -
    - - - - -
    -
    - {{:: 'required-settings' | translate}} -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'user-storage.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'console-display-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'priority.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'kerberos-realm.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'server-principal.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'keytab.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'debug.tooltip' | translate}} -
    - -
    - -
    - -
    - {{:: 'allow-password-authentication.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'edit-mode.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'update-profile-first-login.tooltip' | translate}} -
    - -
    - -
    - {{:: 'user-storage-cache-policy' | translate}} -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.evictionDay.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.evictionHour.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.evictionMinute.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'userStorage.cachePolicy.maxLifespan.tooltip' | translate}} -
    -
    - - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap-mapper-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap-mapper-detail.html deleted file mode 100644 index 88de0ffd80..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap-mapper-detail.html +++ /dev/null @@ -1,64 +0,0 @@ -
    - - -

    {{mapper.name|capitalize}}

    -

    {{:: 'add-user-federation-mapper' | translate}}

    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'mapper.name.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{mapperType.helpText}} -
    -
    - -
    - -
    - {{mapperType.helpText}} -
    - - - -
    - -
    -
    - - - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap-mappers.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap-mappers.html deleted file mode 100644 index 794e83e567..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap-mappers.html +++ /dev/null @@ -1,46 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    {{:: 'name' | translate}}{{:: 'type' | translate}}
    {{mapper.name}}{{mapper.providerId}}
    {{:: 'no-mappers-available' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap.html deleted file mode 100755 index c1c1b490d1..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage-ldap.html +++ /dev/null @@ -1,568 +0,0 @@ -
    - - - - -
    -
    - {{:: 'required-settings' | translate}} -
    - -
    - -
    -
    -
    - -
    - -
    - {{:: 'user-storage.enabled.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'console-display-name.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'priority.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.import-enabled.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'ldap.edit-mode.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.sync-registrations.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - -
    -
    - {{:: 'ldap.vendor.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'username-ldap-attribute.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'rdn-ldap-attribute.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'uuid-ldap-attribute.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.user-object-classes.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.connection-url.tooltip' | translate}} - -
    -
    - -
    - -
    - {{:: 'ldap.users-dn.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.custom-user-ldap-filter.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'ldap.search-scope.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'ldap.authentication-type.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.bind-dn.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.bind-credential.tooltip' | translate}} - -
    -
    - -
    - {{:: 'advanced-ldap-settings' | translate}} -
    - -
    - -
    - {{:: 'ldap.startTls.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.usePasswordModifyExtendedOp.tooltip' | translate}} -
    - - {{:: 'ldap-query-supported-extensions.tooltip' | translate}} -
    -
    -
    - -
    - -
    - {{:: 'ldap.validate-password-policy.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'trust-email.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'ldap.use-truststore-spi.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.connection-timeout.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.read-timeout.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.pagination.tooltip' | translate}} -
    -
    - -
    - {{:: 'connection-pooling' | translate}} -
    - -
    - -
    - {{:: 'ldap.connection-pooling.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.connection-pooling.authentication.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.connection-pooling.debug.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.connection-pooling.initsize.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.connection-pooling.maxsize.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.connection-pooling.prefsize.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.connection-pooling.protocol.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.connection-pooling.timeout.tooltip' | translate}} -
    -
    - -
    - {{:: 'kerberos-integration' | translate}} -
    - -
    - -
    - {{:: 'ldap.allow-kerberos-authentication.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'kerberos-realm.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'server-principal.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'keytab.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'debug.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.use-kerberos-for-password-authentication.tooltip' | translate}} -
    -
    - -
    - {{:: 'sync-settings' | translate}} -
    - -
    - -
    - {{:: 'ldap.batch-size.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.periodic-full-sync.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'full-sync-period.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.periodic-changed-users-sync.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'ldap.changed-users-sync-period.tooltip' | translate}} -
    -
    - -
    - {{:: 'user-storage-cache-policy' | translate}} -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.evictionDay.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.evictionHour.tooltip' | translate}} -
    -
    - -
    -
    - -
    -
    - {{:: 'userStorage.cachePolicy.evictionMinute.tooltip' | translate}} -
    -
    - -
    - -
    - {{:: 'userStorage.cachePolicy.maxLifespan.tooltip' | translate}} -
    -
    - - -
    -
    - - -
    -
    - -
    -
    - - - - - - -
    -
    -
    -
    - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage.html b/themes/src/main/resources/theme/base/admin/resources/partials/user-storage.html deleted file mode 100755 index 93ca5a9b6a..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/user-storage.html +++ /dev/null @@ -1,45 +0,0 @@ -
    -

    - {{:: 'user-storage' | translate}} -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    {{:: 'id' | translate}}{{:: 'provider-name' | translate}}{{:: 'enabled' | translate}}{{:: 'priority' | translate}}{{:: 'actions' | translate}}
    {{instance.name}}{{instance.providerId|capitalize}}{{instance.config['enabled'][0]}}{{instance.config['priority'][0]}}{{:: 'edit' | translate}}{{:: 'delete' | translate}}
    {{:: 'no-user-storage-providers-configured' | translate}}
    -
    - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/webauthn-policy-passwordless.html b/themes/src/main/resources/theme/base/admin/resources/partials/webauthn-policy-passwordless.html deleted file mode 100644 index b15dfec6e4..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/webauthn-policy-passwordless.html +++ /dev/null @@ -1,177 +0,0 @@ - - -
    -

    {{:: 'authentication' | translate}}

    - - - - -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-rp-entity-name.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-signature-algorithms.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-rp-id.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-attestation-conveyance-preference.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-authenticator-attachment.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-require-resident-key.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-user-verification-requirement.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-create-timeout.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-avoid-same-authenticator-register.tooltip' | translate}} -
    - -
    - -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - {{:: 'webauthn-acceptable-aaguids.tooltip' | translate}} -
    - -
    -
    - - -
    -
    -
    - -
    - - - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/webauthn-policy.html b/themes/src/main/resources/theme/base/admin/resources/partials/webauthn-policy.html deleted file mode 100644 index e8f785f143..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/partials/webauthn-policy.html +++ /dev/null @@ -1,159 +0,0 @@ -
    -

    {{:: 'authentication' | translate}}

    - - - - -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-rp-entity-name.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-signature-algorithms.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-rp-id.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-attestation-conveyance-preference.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-authenticator-attachment.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-require-resident-key.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-user-verification-requirement.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-create-timeout.tooltip' | translate}} -
    - -
    - -
    -
    - -
    -
    - {{:: 'webauthn-avoid-same-authenticator-register.tooltip' | translate}} -
    - -
    - -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - {{:: 'webauthn-acceptable-aaguids.tooltip' | translate}} -
    - -
    -
    - - -
    -
    -
    - -
    - - - diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/authz/kc-authz-modal.html b/themes/src/main/resources/theme/base/admin/resources/templates/authz/kc-authz-modal.html deleted file mode 100644 index 18acf86b2e..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/authz/kc-authz-modal.html +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/authz/kc-tabs-resource-server.html b/themes/src/main/resources/theme/base/admin/resources/templates/authz/kc-tabs-resource-server.html deleted file mode 100755 index bd20270358..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/authz/kc-tabs-resource-server.html +++ /dev/null @@ -1,14 +0,0 @@ - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-component-config.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-component-config.html deleted file mode 100755 index 840ab1ee66..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-component-config.html +++ /dev/null @@ -1,67 +0,0 @@ -
    -
    - - -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - - -
    - -
    -
    - - - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    - -
    -
    - -
    - - {{:: option.helpText | translate}} -
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-copy.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-copy.html deleted file mode 100755 index d92b2d4be5..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-copy.html +++ /dev/null @@ -1,18 +0,0 @@ - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-dropdown.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-dropdown.html deleted file mode 100644 index 13874ca039..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-dropdown.html +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-edit.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-edit.html deleted file mode 100644 index 0b98b294f5..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-edit.html +++ /dev/null @@ -1,22 +0,0 @@ - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-menu.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-menu.html deleted file mode 100755 index 4edc768413..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-menu.html +++ /dev/null @@ -1,65 +0,0 @@ - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-modal-message.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-modal-message.html deleted file mode 100755 index fc3270828c..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-modal-message.html +++ /dev/null @@ -1,10 +0,0 @@ - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-modal.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-modal.html deleted file mode 100644 index 25eee9682f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-modal.html +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-paging.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-paging.html deleted file mode 100644 index 653e4a58c9..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-paging.html +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-provider-config.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-provider-config.html deleted file mode 100755 index 88bf771e44..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-provider-config.html +++ /dev/null @@ -1,104 +0,0 @@ -
    -
    - - -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - - -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - -
    {{:: 'key' | translate}}{{:: 'value' | translate}}{{:: 'actions' | translate}}
    {{mapEntry['key']}}{{:: 'delete' | translate}} -
    {{:: 'add' | translate}} -
    -
    - - {{:: option.helpText | translate}} -
    -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-switch.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-switch.html deleted file mode 100644 index 7f28598d34..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-switch.html +++ /dev/null @@ -1,12 +0,0 @@ - -
    - - -
    -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-authentication.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-authentication.html deleted file mode 100755 index 98ad23f11d..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-authentication.html +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client-role.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client-role.html deleted file mode 100755 index 20f05a9b3f..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client-role.html +++ /dev/null @@ -1,17 +0,0 @@ -
    -

    {{:: 'add-role' | translate}}

    -

    {{role.name|capitalize}}

    - - -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client-scope.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client-scope.html deleted file mode 100755 index 72f59e94e5..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client-scope.html +++ /dev/null @@ -1,20 +0,0 @@ -
    - -

    {{:: 'add-client-scope' | translate}}

    -

    - {{clientScope.name|capitalize}} - -

    - - -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client.html deleted file mode 100755 index 41486878c5..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client.html +++ /dev/null @@ -1,65 +0,0 @@ -
    - -

    {{:: 'add-client' | translate}}

    -

    - {{client.clientId|capitalize}} - -

    - - -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-clients.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-clients.html deleted file mode 100755 index 8cf318a8f1..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-clients.html +++ /dev/null @@ -1,16 +0,0 @@ -
    -

    - {{:: 'clients' | translate}} -

    - - -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-group-list.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-group-list.html deleted file mode 100755 index 5b67035954..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-group-list.html +++ /dev/null @@ -1,11 +0,0 @@ -
    -

    - {{:: 'user-groups' | translate}} -

    - - -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-group.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-group.html deleted file mode 100755 index da0825214c..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-group.html +++ /dev/null @@ -1,17 +0,0 @@ -
    -

    - {{group.name|capitalize}} - -

    - - -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-identity-provider.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-identity-provider.html deleted file mode 100644 index 94b2604474..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-identity-provider.html +++ /dev/null @@ -1,16 +0,0 @@ -
    -

    - {{identityProvider.displayName}} - {{provider.name}} - {{identityProvider.alias}} - - -

    -

    {{:: 'add-identity-provider' | translate}}

    - - -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-ldap.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-ldap.html deleted file mode 100644 index a4f17a8a5c..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-ldap.html +++ /dev/null @@ -1,12 +0,0 @@ -
    -

    - {{instance.name|capitalize}} - -

    -

    {{:: 'add-user-federation-provider' | translate}}

    - - -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-realm.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-realm.html deleted file mode 100755 index e0608aab58..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-realm.html +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-role.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-role.html deleted file mode 100755 index f00515b442..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-role.html +++ /dev/null @@ -1,16 +0,0 @@ -
    -

    {{role.name|capitalize}}

    -

    {{:: 'add-role' | translate}}

    - - -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user-storage.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user-storage.html deleted file mode 100644 index 03e1ddc606..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user-storage.html +++ /dev/null @@ -1,11 +0,0 @@ -
    -

    - {{instance.name|capitalize}} - -

    -

    {{:: 'add-user-storage-provider' | translate}}

    - - -
    diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user.html deleted file mode 100755 index 9c372e3b1d..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user.html +++ /dev/null @@ -1,18 +0,0 @@ - \ No newline at end of file diff --git a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-users.html b/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-users.html deleted file mode 100755 index e5771a0c00..0000000000 --- a/themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-users.html +++ /dev/null @@ -1,11 +0,0 @@ -
    -

    {{:: 'users' | translate}}

    - - -
    \ No newline at end of file diff --git a/themes/src/main/resources/theme/keycloak/admin/resources/css/styles.css b/themes/src/main/resources/theme/keycloak/admin/resources/css/styles.css deleted file mode 100755 index bb85710007..0000000000 --- a/themes/src/main/resources/theme/keycloak/admin/resources/css/styles.css +++ /dev/null @@ -1,505 +0,0 @@ -html,body { - height: 100%; -} - -form { - margin-top: 20px; -} - -table { - margin-top: 20px; -} - -.required { - color: #f00; -} - -.tooltip-inner { - min-width: 200px; -} - -.margin-top { - margin-top: 20px; -} - -.no-margin-top { - margin-top: 0px !important; -} - -table { - max-width: 100%; -} - -td.clip { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - max-width: 0; -} - -th.w-10 { - width: 10%; -} - -th.w-15 { - width: 15%; -} - -th.w-20 { - width: 20%; -} - - -th.w-25 { - width: 25%; -} - -th.w-30 { - width: 30%; -} - - -th.w-35 { - width: 35%; -} - -th.w-40 { - width: 40%; -} - -/*********** Loading ***********/ - -.loading { - background-color: #f5f5f5; - border: 1px solid #eee; - position: absolute; - bottom: 0px; - left: 0px; - padding: 2px 200px 2px 5px; -} - -/*********** Feedback ***********/ - -.feedback-aligner { - position: fixed; - top: 15px; - text-align: center; - width: 100%; - height: 0; - z-index: 100; -} -.feedback-aligner .alert { - border-radius: 2px; - border-width: 1px; - display: inline-block; - position: relative; -} - -/*********** On-Off Switch ***********/ - -.onoffswitch { - -moz-user-select: none; - height: 26px; - position: relative; - width: 62px; -} -.onoffswitch .onoffswitch-checkbox { - display: none; -} -.onoffswitch .onoffswitch-label { - border: 1px solid #bbb; - border-radius: 2px; - cursor: pointer; - display: block; - overflow: hidden; - width: 62px; -} -.onoffswitch .onoffswitch-inner { - display: block; - margin-left: -100%; - transition: margin 0.3s ease-in 0s; - width: 200%; -} -.onoffswitch .onoffswitch-inner > span { - -moz-box-sizing: border-box; - color: white; - float: left; - font-size: 11px; - font-family: "Open Sans", sans-serif; - font-weight: bold; - height: 24px; - line-height: 24px; - padding: 0; - width: 50%; -} -.onoffswitch .onoffswitch-switch { - background-image: linear-gradient(top, #fafafa 0%, #ededed 100%); - background-image: -o-linear-gradient(top, #fafafa 0%, #ededed 100%); - background-image: -moz-linear-gradient(top, #fafafa 0%, #ededed 100%); - background-image: -webkit-linear-gradient(top, #fafafa 0%, #ededed 100%); - background-image: -ms-linear-gradient(top, #fafafa 0%, #ededed 100%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fafafa), color-stop(1, 0, #ededed)); - border: 1px solid #aaa; - border-radius: 2px; - bottom: 0; - margin: 0; - position: absolute; - right: 39px; - top: 0; - transition: all 0.3s ease-in 0s; - -webkit-transition: all 0.3s ease-in 0s; - width: 23px; -} -.onoffswitch .onoffswitch-inner .onoffswitch-active { - background-image: linear-gradient(top, #00a9ec 0%, #009bd3 100%); - background-image: -o-linear-gradient(top, #00a9ec 0%, #009bd3 100%); - background-image: -moz-linear-gradient(top, #00a9ec 0%, #009bd3 100%); - background-image: -webkit-linear-gradient(top, #00a9ec 0%, #009bd3 100%); - background-image: -ms-linear-gradient(top, #00a9ec 0%, #009bd3 100%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #00a9ec), color-stop(1, 0, #009bd3)); - color: #FFFFFF; - padding-left: 10px; -} -.onoffswitch-checkbox:disabled + .onoffswitch-label .onoffswitch-inner .onoffswitch-active, -.onoffswitch-checkbox:disabled + .onoffswitch-label .onoffswitch-inner .onoffswitch-inactive { - background-image: none; - background-color: #e5e5e5; - color: #9d9fa1; -} -.onoffswitch .onoffswitch-inner .onoffswitch-inactive { - background: linear-gradient(#fefefe, #e8e8e8) repeat scroll 0 0 transparent; - color: #4d5258; - padding-right: 10px; - text-align: right; -} -.onoffswitch .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner { - margin-left: 0; -} -.onoffswitch .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { - right: 0; -} - - -/*********** Select 2 ***********/ - -.select2-container { - width: 100%; -} - -.select2-container-multi .select2-choices .select2-search-field { - height: 26px; -} - -.select2-container-single { - padding: 0; - margin: 0; -} - -.select2-container-single .form-group { - width: 100%; - margin: 0; -} - -.select2-container-single .form-group .input-group { - width: 100%; -} - -/*********** html select ********/ -.overflow-select { - overflow: auto; -} - - -/*********** New Menu ***********/ - - -.sidebar-pf-left{ - background: #292e34; -} - -.sidebar-pf .nav-pills > li a i, .sidebar-pf .nav-pills > li a span{ - color: #72767b; - display: inline-block; - margin-right: 10px; -} -.sidebar-pf .nav-pills > li > a{ - color: #dbdada; - padding: 0px 20px 0 30px!important; - line-height: 30px; - border-left-width: 12px; - border-left-style: solid; - border-left-color: #292e34; - margin-left: -6px; -} - -.sidebar-pf .nav-pills > li > a:hover{ - background: #393f44; - border-color:#292e34; - border-left-color: #393f44; - color: #fff; -} - -.sidebar-pf .nav-pills > li > a:after{ - display: none!important; -} - - -.sidebar-pf .nav-pills > li.active > a { - color: #fff; - background: #393f44!important; - border-bottom: 1px solid #000!important; - border-top: 1px solid #000!important; - border-left-color: #39a5dc!important; -} - -.sidebar-pf .nav-pills > li.active a i, .sidebar-pf .nav-pills > li.active a span{ - color: #39a5dc; -} - -/*********** Realm selector ***********/ - -.realm-selector{ - color: #fff; - margin: 0 -20px; - position: relative; -} - -.realm-dropmenu{ - display: none; - cursor: pointer; - position: absolute; - top: 60px; - left: 0; - right: 0; - z-index: 999; - background: #fff; -} - -.realm-selector:hover .realm-dropmenu{ - display: block; -} - -.realm-add{ - padding: 10px; -} - -.realm-selector h2{ - font-size: 16px; - line-height: 60px; - padding: 0 20px; - margin: 0; - border-bottom: 1px solid #d5d5d6; -} - -.realm-selector h2 i{ - display: inline-block; - float: right; - line-height: 60px; -} - - -.realm-selector ul{ - padding-left: 0; - margin: 0; - list-style: none; - max-height: 200px; - overflow-y:auto; -} - - -.realm-selector ul li a{ - line-height: 60px; - padding: 0 20px; - border-bottom: 1px solid #d5d5d6; - line-height: 39px; - display: block; - font-size: 14px; -} - - -/*********** Overwrites header defaults ***********/ - -.navbar-pf{ - border-top: none!important; -} - -.navbar-pf .navbar-brand { - padding: 0; - height: 56px; - line-height: 56px; - background-position: center center; - background-image: url('../img/keyclok-logo.png'); - background-size: 148px 30px; - background-repeat: no-repeat; - width: 148px; -} - -.navbar-pf .navbar-utility .dropdown-toggle { - padding: 23px !important; -} - -.clickable { - cursor: pointer; -} - -h1 i { - color: #999999; - font-size: 18px; - margin-left: 10px; -} - -/* Action cell */ -.kc-action-cell { - background-color: #eeeeee; - background-image: linear-gradient(to bottom, #fafafa 0%, #ededed 100%); - background-repeat: repeat-x; - - text-align: center; - vertical-align: middle; - - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - - cursor:pointer; -} - -.kc-action-cell:hover { - background-color: #eeeeee; - background-image: none; -} - -.kc-action-cell-disabled { - background-color: #fafafa; - color: #8b8d8f; - background-image: none; - cursor: not-allowed; -} - -.kc-sorter span { - margin-left: 10px; -} - - -/* Time selector */ - -.time-selector input { - display: inline-block; - width: 120px; - padding-right: 0; - margin-right: 0; -} - -.time-selector select { - display: inline-block; - width: 80px; - margin-left: 0; - padding-left: 0; -} - -.ace_editor { - height: 600px; - width: 100%; -} - -.kc-button-input-file input { - float: left; - width: 73%; -} - -.kc-button-input-file label { - float: left; - margin-left: 2%; - width: 25%; -} - -table.kc-authz-table-expanded { - margin-top: 0px !important; -} - -.no-gutter > [class*='col-'] { - padding-right:0!important; - padding-left:0!important; -} - -.password-conceal { - font-family: 'text-security-disc'; - font-size: 14px; -} - -.input-map input.form-control { - width: 50%; -} - -/* Deactivation styles for user-group membership tree models */ - -div[tree-model] li .deactivate { - color: #4a5053; - opacity: 0.4; -} - -div[tree-model] li .deactivate_selected { - background-color: #dcdcdc; - font-weight: bold; - padding: 1px 5px; -} - -/* search highlighting */ - -div[tree-model] li .highlight { - background-color: #aaddff; -} - -/* Manage credentials */ -table.credentials-table { - margin-top: 0; - margin-bottom: 20px; -} - -table.credentials-table td { - vertical-align: middle !important; -} - -table.credentials-table input[type='text'] { - width: 100%; -} - -td.credential-arrows-cell { - width: 75px; -} - -td.credential-label-cell { - padding: 5px !important; -} - -td.credential-action-cell { - padding: 0px !important; -} - -td.credential-action-cell div.kc-action-cell { - width: 100%; - height: 36px; - line-height: 34px; -} - -td.credential-action-cell.expanded div.kc-action-cell { - border-bottom: 1px solid #d1d1d1; -} - -table.credential-data-table td { - word-break: break-all; -} - -table.credential-data-table tr:first-child td { - border-top: 0; -} - -table.credential-data-table td:first-child { - width: 150px; -} - -table.credential-data-table td.key { - text-align: right; - font-weight: bold; -} - diff --git a/themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.png b/themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.png deleted file mode 100644 index ca53f0a04ba97029b387ada299ae4b454b54ccd4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5268 zcmV;F6l?2=P){$d zBI3acD}JD{GrP)qpooZzy()ry3V5L60fOQI>;eXegdi>+fPkQa7hb3cuIw-{-P7H# zsxrSnUUyG-PY>*Y5$p!P2$+6V`7*PzvNE%(x(WM1|Ni}F02sbMy8S>zWa#3>i|72C zd=B9t2kon~U%!4QDy7~7pbmhnAB{1cmo8np_W8NCbyV0w=sPFRMRMSb`lF4o9$acK|@?@|VzL-SS-C z1N-&s*JsI+CCd)fAP(W+L4yc&$t9O`1aMPs`_2|^@wYPH$C`T)e1Cjz?C5wx7R{$U zFUH5^U7%`y0sz$Zx&*ekX+xn(O|Go03>=UV9Ku0`1~t^|*|R?;qGK}KqVWX6wI$eT z2t^7|U5`h^EkqZu26xnK1OUY0;=1xPVL>=vYT-0(0RZSyy$$F8ZF8EJ=Xr2k7lon1 zt%Ze!wSc7im?7J?eckuM3oqz3)>?8L=P#$6 za>|N#-+lL1B04IQR%=^hjMq#=SZhs0P92dH1pB>c7z-O~>@FfKx7I!|bm-6>DcTob ze6fO=@9;d2l~PV=Y3bO30|(aZZ=ytm9)JAt%dO?XEPMh)NfL9W;qkHVA{vqv2*kH0D%AL&<<Rnwu&l^ajMhY|7+6aIw zhuW}V!*BpIlu}84YELK>x-&WOJCsso0AQ^JGs9X95rI+)j^l#aLWJOX-e>?dj^kXH z(&hBi&)f^(o=ka*7A@-QIL?G5|5Ql;5uy3>=RYDM*AY>2aS9X>m{0+ryX(3)&zUo4 zMny%%?|S#{ZM4>1MdbPYK%`X82l{+H?T2&1F6dZw9ZFcR8&;VY_3l|6VVy~X@|P;#v5B%YuAdP zJUNF(Ydt8P@@CGQ89MH`$;w`7QzgGLYaN*)~y==U`9q$bubv{*1dc8 z-N|RMmf?9i?NBMFWfr)ulOh8E^y$-Qsfc`3Z#dlb)?06trJh%=T8RP3v#1wA&9G;hewRXg`Y10;@HEY|p?UGQL&W&erRfpvV2I!l@TYRyz=~yx zaebMu@K+wthWyW;YX@(~9OR<0GYf02E7CA}zxUpIy#SiWED!-i!~_C?Gkf&t@k5Hn z7-Rjh3*aB7{vR_xCL)gsVX_r@Oeyt%h)fFxgNdZPORcpQ0EpnkVzF5%evwGzZXzl* z#v*Cc>jw=QWV?0i_PB_gk~5-BR%8O8#xr9c{PhF?V3sDkckj->f*QeNk3H7GaoxGh zCYaIuj^?{)CCR#;xkIH`oOmla-)7o$hOLqSH(lnVQqFvdV@tw7oC zws!5>)Ey&6jF^x?@+E+kQ>Q+BgVy>X zUmtM_SY7~dRwgeNnWR09T!_diW5+rWpE`BQt!W(rpmXQWZ#a%hPPPBPu@>Xr-v$;zP!V>u^m#OOfRQcgqlbvV7=x7O zy8uR)c>sV~O9&YMb2Tfx7SGCF4IIkajHs01XY1Cj>)<%fdqm^_05h|Q{JKYv9;+Kz zD9czB-B*7m;_-MT0G%2SDK$G1i9Bz#35hU>NQ#OIF9!h6^TuVq%WN;rbtV9)s;b%( ziA1`ELZOaTRaJZH^%5}qa-z{_-atKP&YUuB^y#T*Qfh6EGo^9UO*cHOl=EK3$j=Ce z!=j{EGh&knArs5l$|*jgy%01*87>z}Zx+MkaeN4CKlT42fEd&B# z28;jq%plOK(8a2li{*6+eM=1LL}7BZixUnL92u;)VMeWi)PMm<%A=Gbhgmi-OOToU zf|_X58K<50=X^#;GZ2Bby4Q*oEAGl~ES`D61s8mqdLA%fK<#U=%N-47zfWASdx z+^wD;Uh3Po?-xm}d)IqB{WN&+;1!MOQB_r?0sKAnY>WXjr^l|8%DXeGuC6{G8C8KW zkIP3_KOTD*fThW?Q*m+eSpb#*fVJ``&r7%|neljhNGKF~)>`~Bk%&Vnb!|8tz9}3I z$1{0~2m*m1JTC!&9!^2|&I2`_<~x;Q3%v>gD@q9A|| zOAiMCbPO;CmugsM#1kG8i8!?OV6lM68{^FXQ_B7yyn05YG2cDRoBfJ8RagdB9lvRU(l{ zr*QFITN|T)pC%+^6v+5&f4b}o#+bYjiikS+b)qk@sHkZDzWBJV`(92{Hvo9};fD*X z)kD&mfau-(?z?YCB9R#Dd4Bc~5m#&dyL^1>H#D{+TR$v%^2sL~AxZL;~@6 z+;530FvLHDa5&6fB2nqf z6c8ytA~KI2G-%MC4AQhxB9iyE;U7U(iq8Qv8-YNCVXeXL-MjZEr!ez@h-v{~ZzNKs zwQd3cN-1d1y9EHoj~~C@aojBcrJ`ouNG`$%1{>}~t+ls|7%}3c+;;W;`x~y-+DnIF z04R18Za$_pI<#z#)hI!cO#lG4TL;VIL1?WZ@N=vmX&NeW|HnI_S)fQkD%wK;1PQpQ zq^{m*mJyG~5vz;A7!6^D>$*@%xk^zoLZq3e!!ePxt*AKSp?n5N@lEb}zC$As3c$Ph z-W@n_;0k~~2LPoAL=@S)d2_ZbkzMt=P>06!*f%IM#pi+hDMXSb2oMYg&)F9@Yi;jr z73EU^uv(8(O8E;|8v$s_m@#8FjTtj`lQFt|>NLPw+idjc(fu-cIBvENE2R<{{E5i< z%dla?vI=8&`0(NLR;^m~eR+BL5%t83fo;pMJlG0f#esLC3a6JC?1hW@u@Fuyil8Lv zfPSrFl81&4L6p2ms*t4sG#1`?oAt7sb%l@zaRs`Dw*3%o)}Kj#D3WQU$xU z7LMcmdDpI8!&|m&`2&C^e!pD*=9_Q6e9k%Nyp=g17D=RxL`3V)JMX+d?Q0_PLw*3z zIT?Lxa!;U%Xc4pA=$~`h@)uux@z;X~4}Lixr>CBJs#S4uu^lpG$gX_-jl(P_A`xLq z+I5nM%p;-(%QqYjD{Ez}QUpK%qC_+reS6%vaTkbC3u83=l7R_8&&DJYId>vich%I? zproV(fj|%}j6g706RWE`AruPT&CElMvGBZT+fb-*9)SKS9tr?9Zrpforj~vc@1U}b zK>!j0)M|e{#6EViX^E{+#gnt$J z4iEt#8jViW+LKg-vDVI+J$rVaT)HQoc;X}xd{I|dw|>^FSuHaAGR_I};)WY;NC?qF zAYJvgn>uys%y2lIrPSQHbDg51;#th5t1*6k%a&gVhr@=Hxco;?SO$Ve7}(Z=-ZbyoT!dG+emcZkS%07>K7RcD`lcKWpU_1BmGsI^zF zl!5@C6V&V0Y63F0BlRC1yy&8fzRJ~U;lhQBKy)zx7_Gm*{PN2i927qP{PPn;B>ja! zB7(K{Q)b>mL>@DrYAqkdY>7xgDfLrnX-S*f+S*<$@`llVJT>{a%{A9l1OkC= z)>_wbT?n&b<|Ced`sp9jNpk)A^%u2k*FG8uxXBgZ``RtdJS>kos1w3xb&T>NhCtyZ zuN0%*>?^3Hfqbpd1J6J9=l3bWSafv?NN&k(B@%IFyK#3i~@y zX3m?cuDa@~F)zIEQiZkp>f}2x#&iYHwVn^B|B5&d4H`7aKJ&~oX@@2v7*Ai7v-1W( zP)e1B!{NnKrcCK+jM*T9LhU=@;Q;=arX+!7f1?CY4YNJvfd?LlhQr}W)>?!@g^0!K z#C6@@O`JIK@5qBOW5x~#_?G}+jJ>$Bva)Gvkt?MD5MrK}4yiL{%=jT0l@<~yu&~P_ zZv*I@4xiz0IKE}e=5)Q0GDa&`P}$61P2U=YX4V(sA7^H(z>9mIZqp$2t4AzrAKW z04SxzKQL5Ccpg&DL`2D5rNF-*^NIoB=9_Q+#BrP>MEI`_H6YmJuG?|kziRDuy7%6D zx88c|t;Nhdz~>9NZg9nf2@~=*sy!Eh_1Zy%DbO??zyW%q0rHp>ESrfL+i4WvC}EU>ImZ(#TwQP zU{Q^rV8<2^5n@7ExZN+RJ2Y>K&EoH3&xrm2{mlpXydVf|3|!X*1Sl#h{5}u}L_E(k zj^nrhU`1>+8vR84EksB}qDoPNA2sys*>mrbB};x43gwua0emAO_W`IN zq6T|i20)Gz6DuKWZ45x(n|ZByIjB9YGv3JMM&pr2S z88vFu9j@!9Qu`OtXtb`duy~s5x|Gy$ZSH&3)z#M(6&39zB4OrYrIgbkWc2ITuY*!* z3xKTc;LZ-mW8JSR0RV^p_$68&eGJMLJb}Vb>(ARhIQlev*SaH$j_ibJvvRmPj^59Q z5vpt86Cbx})8_bm2V;lupN$6Fm?cY=d<9@?ZhPymHlgKrp8^1WC_f7LXl<4=0YKMp zHln3Vh&C$+0CZmWYCdNIGmkvvO#hw8d(3^s6<0Kg$K#(N&-cpzZGl7!UU}t}OAj>P zLpV5)_n>9oym=838S^v9^O$+`&%pN(4iYr_BhJN(7e5D}K_T{U;(nW2Z6Z&~Nho%hBkKJpgRox^+jFE?wFKIALFO{{Tcpe*fyLukQ0J7>Dqm akN*dX+`h$pZtd{^0000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/themes/src/main/resources/theme/keycloak/admin/resources/img/select-arrow.png b/themes/src/main/resources/theme/keycloak/admin/resources/img/select-arrow.png deleted file mode 100644 index a865a6fa7324e054cffa6e1878d69438780b20c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1154 zcmbVMTWHfz7>p*_>aXo9GTd$y`I14I@;lVM5JhweKRY3LHQC7fY1b^;WQwQUZl zZ_DPjwq`A+Q}I<~jVEFP6CjoJ%#!7boBlvw?V=p`?Z&9uZobt9Ob)oP#nEs*8W&c;ICuXx!@E2M)bdlwvIE#@G8ws*Pl;dI?8%xx(sU$BXLTpf}aEyknRX9Ex zim)s%ggGwB*G7`bSSXr`29=P4X)D;YTqMb3NA3NLQ&>ArT2 zA9uH-Ywx;_@dpP62I76EH_hHudfZ-m_3_D@=eypgs=j~y@N$1<+s2d9fz493b7t>b zdi$;G;Cc4Oy<=aF_s6}ZOI9R~$+;sl=AP@Cwm_P2^Y!O