2017-11-28 12:49:48 +00:00
<div class="view-customize">
2018-12-13 12:24:16 +00:00
<form>
2018-09-04 17:19:26 +01:00
<div class="widget-list-picker widget-list-picker-horiz">
2018-09-03 17:36:54 +01:00
<ul class="options">
2018-12-08 20:54:19 +00:00
<li class="option {{ if isDocumizeProvider "selected" }} " {{ action "onDocumize" }} >
2018-09-03 17:36:54 +01:00
<div class="text-header">Documize</div>
<div class="text">Built-in email/password</div>
{{ # if isDocumizeProvider }}
2018-12-21 11:15:59 +00:00
<i class="dicon {{ constants .Icon .Tick }} " />
2018-09-03 17:36:54 +01:00
{{ / if }}
</li>
2018-12-08 20:54:19 +00:00
<li class="option {{ if isKeycloakProvider "selected" }} " {{ action "onKeycloak" }} >
2018-09-03 17:36:54 +01:00
<div class="text-header">Keycloak</div>
<div class="text">Via authentication server</div>
{{ # if isKeycloakProvider }}
2018-12-21 11:15:59 +00:00
<i class="dicon {{ constants .Icon .Tick }} " />
2018-09-03 17:36:54 +01:00
{{ / if }}
</li>
2018-12-08 20:54:19 +00:00
<li class="option {{ if isLDAPProvider "selected" }} " {{ action "onLDAP" }} >
2018-09-03 17:36:54 +01:00
<div class="text-header">LDAP</div>
<div class="text">Connect to LDAP/ Active Directory</div>
{{ # if isLDAPProvider }}
2018-12-21 11:15:59 +00:00
<i class="dicon {{ constants .Icon .Tick }} " />
2018-09-03 17:36:54 +01:00
{{ / if }}
</li>
</ul>
2017-11-28 12:49:48 +00:00
</div>
2017-03-14 17:19:53 +00:00
2018-12-13 12:24:16 +00:00
{{ ui / ui-spacer size = 3 0 0 }}
2018-09-04 17:19:26 +01:00
2017-11-28 12:49:48 +00:00
{{ # if isKeycloakProvider }}
2018-12-13 12:24:16 +00:00
<div class="form-group">
<label for="keycloak-url">Keycloak Server URL</label>
{{ focus-input id = "keycloak-url" type = "text" value = keycloakConfig .url class = ( if KeycloakUrlError "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">e.g. http://localhost:8888/auth</small>
</div>
<div class="form-group">
<label for="keycloak-realm">Keycloak Realm</label>
{{ in put id = "keycloak-realm" type = "text" value = keycloakConfig .realm class = ( if KeycloakRealmError "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">e.g. main</small>
</div>
<div class="form-group">
<label for="keycloak-publicKey">Keycloak Realm Public Key</label>
{{ textarea id = "keycloak-publicKey" type = "text" value = keycloakConfig .publicKey rows = 7 class = ( if KeycloakPublicKeyError "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Copy the RSA Public Key from Realm Settings → Keys</small>
</div>
<div class="form-group">
<label for="keycloak-clientId">Keycloak OIDC Client ID</label>
{{ in put id = "keycloak-clientId" type = "text" value = keycloakConfig .clientId class = ( if KeycloakClientIdError "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">e.g. account</small>
</div>
<div class="form-group">
<label for="keycloak-group">Keycloak Group ID (Optional)</label>
{{ in put id = "keycloak-group" type = "text" value = keycloakConfig .group class = "form-control" }}
<small class="form-text text-muted">If you want to sync users in a particular Group (e.g. "Documize Users"), provide the Group ID (e.g. 511d8b61-1ec8-45f6-bc8d-5de64d54c9d2)</small>
</div>
<div class="form-group">
<label for="keycloak-admin-user">Keycloak Username</label>
{{ in put id = "keycloak-admin-user" type = "text" value = keycloakConfig .adminUser class = ( if KeycloakAdminUserError "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Used to connect with Keycloak and sync users with Documize (create user under Master Realm and assign 'view-users' role
against Realm specified above)</small>
</div>
<div class="form-group">
<label for="keycloak-admin-password">Keycloak Password</label>
{{ in put id = "keycloak-admin-password" type = "password" value = keycloakConfig .adminPassword class = ( if KeycloakAdminPasswordError "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Used to connect with Keycloak and sync users with Documize</small>
</div>
<div class="form-group">
<label>Disable Logout</label>
{{ x-toggle value = keycloakConfig .disableLogout size = "medium" theme = "light" onToggle = ( action ( mut keycloakConfig .disableLogout ) ) }}
</div>
<div class="form-group">
<label for="ldap-defaultPermissionAddSpace">Can Create Spaces</label>
{{ x-toggle value = keycloakConfig .defaultPermissionAddSpace size = "medium" theme = "light" onToggle = ( action ( mut keycloakConfig .defaultPermissionAddSpace ) ) }}
2018-09-03 17:36:54 +01:00
</div>
{{ / if }}
{{ # if isLDAPProvider }}
2018-12-13 12:24:16 +00:00
<div class="form-group">
<label for="ldap-host">LDAP Server</label>
{{ focus-input id = "ldap-host" type = "text" value = ldapConfig .serverHost class = ( if ldapErrorServerHost "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">IP or host address, e.g. ldap.example.org, 127.0.0.1</small>
</div>
<div class="form-group">
<label for="ldap-port">LDAP Server Port</label>
{{ in put id = "ldap-port" type = "number" value = ldapConfig .serverPort class = ( if ldapErrorServerPort "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Port number, e.g. 389</small>
</div>
<div class="form-group">
<label for="ldap-encryption">Encryption</label>
<select onchange= {{ action "onLDAPEncryption" value = "target.value" }} class="form-control">
<option value= {{ constants .AuthProvider .EncryptionTypeNone }} selected= {{ is-equal ldapConfig .encryptionType constants .AuthProvider .EncryptionTypeNone }} >
{{ constants .AuthProvider .EncryptionTypeNone }}
</option>
<option value= {{ constants .AuthProvider .EncryptionTypeStartTLS }} selected= {{ is-equal ldapConfig .encryptionType constants .AuthProvider .EncryptionTypeStartTLS }} >
{{ constants .AuthProvider .EncryptionTypeStartTLS }}
</option>
</select>
</div>
<div class="form-group">
<label for="ldap-baseDN">Base DN</label>
{{ in put id = "ldap-baseDN" type = "text" value = ldapConfig .baseDN class = "form-control" }}
<small class="form-text text-muted">Starting point for search filters, e.g. ou=users,dc=example,dc=com</small>
</div>
<div class="form-group">
<label for="ldap-bindDN">Bind DN</label>
{{ in put id = "ldap-bindDN" type = "text" value = ldapConfig .bindDN class = ( if ldapErrorBindDN "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">login credentials for LDAP server</small>
</div>
<div class="form-group">
<label for="ldap-bindPassword">Bind Password</label>
{{ in put id = "ldap-bindPassword" type = "password" value = ldapConfig .bindPassword class = ( if ldapErrorBindPassword "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">login credentials for LDAP server</small>
</div>
<div class="form-group">
<label for="ldap-userFilter">User Filter</label>
{{ in put id = "ldap-userFilter" type = "text" value = ldapConfig .userFilter class = ( if ldapErrorNoFilter "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Search filter for finding users, e.g. (|(objectClass=person)(objectClass=user)(objectClass=inetOrgPerson))</small>
<small class="form-text text-muted highlight">Specify User Filter and/or Group Filter</small>
</div>
<div class="form-group">
<label for="ldap-groupFilter">Group Filter</label>
{{ in put id = "ldap-groupFilter" type = "text" value = ldapConfig .groupFilter class = ( if ldapErrorNoFilter "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Search filter for finding users via groups, e.g. (&(objectClass=group)(|(cn=ship_crew)(cn=admin_staff)))</small>
2018-09-03 17:36:54 +01:00
</div>
2018-12-13 12:24:16 +00:00
<div class="form-group">
<label for="ldap-attributeUserRDN">User Attribute RDN</label>
{{ in put id = "ldap-attributeUserRDN" type = "text" value = ldapConfig .attributeUserRDN class = ( if ldapErrorAttributeUserRDN "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Username/login attribute, e.g. uid in LDAP, sAMAccountName in Active Directory</small>
<small class="form-text text-muted highlight">User Attributes used to retreive data when using User Filter</small>
</div>
<div class="form-group">
<label for="ldap-attributeUserFirstname">User Attribute Firstname</label>
{{ in put id = "ldap-attributeUserFirstname" type = "text" value = ldapConfig .attributeUserFirstname class = ( if ldapErrorAttributeUserFirstname "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Firstname attribute, e.g. givenName</small>
</div>
<div class="form-group">
<label for="ldap-attributeUserLastname">User Attribute Lastname</label>
{{ in put id = "ldap-attributeUserLastname" type = "text" value = ldapConfig .attributeUserLastname class = ( if ldapErrorAttributeUserLastname "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Lastname attribute, e.g. sn</small>
</div>
<div class="form-group">
<label for="ldap-attributeUserEmail">User Attribute Email</label>
{{ in put id = "ldap-attributeUserEmail" type = "text" value = ldapConfig .attributeUserEmail class = ( if ldapErrorAttributeUserEmail "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Email attribute, e.g. mail</small>
</div>
<div class="form-group">
<label for="ldap-attributeGroupMember">Group Attribute Member</label>
{{ in put id = "ldap-attributeGroupMember" type = "text" value = ldapConfig .attributeGroupMember class = ( if ldapErrorAttributeGroupMember "form-control is-invalid" "form-control" ) }}
<small class="form-text text-muted">Attribute that identifies individual group member, e.g. member or uniqueMember</small>
<small class="form-text text-muted highlight">Group Attributes used to retreive data when using Group Filter</small>
</div>
<div class="form-group">
<label for="ldap-disableLogout">Disable Logout</label>
{{ x-toggle value = ldapConfig .disableLogout size = "medium" theme = "light" onToggle = ( action ( mut ldapConfig .disableLogout ) ) }}
</div>
<div class="form-group">
<label for="ldap-defaultPermissionAddSpace">Can Create Spaces</label>
{{ x-toggle value = ldapConfig .defaultPermissionAddSpace size = "medium" theme = "light" onToggle = ( action ( mut ldapConfig .defaultPermissionAddSpace ) ) }}
</div>
2019-05-13 16:14:11 +01:00
<div class="form-group">
<label for="ldap-allowFormsAuth">Dual Login</label>
{{ x-toggle value = ldapConfig .allowFormsAuth size = "medium" theme = "light" onToggle = ( action ( mut ldapConfig .allowFormsAuth ) ) }}
<small class="form-text text-muted">Enable login via LDAP and regular Documize email/password (useful for testing LDAP)</small>
</div>
2018-12-13 12:24:16 +00:00
{{ ui / ui-button color = constants .Color .Yellow light = true label = "Test →" onClick = ( action "onLDAPPreview" ) }}
{{ ui / ui-button-gap }}
2017-11-28 12:49:48 +00:00
{{ / if }}
2018-09-03 17:36:54 +01:00
2018-12-14 11:52:31 +00:00
{{ ui / ui-button color = constants .Color .Green light = true icon = constants .Icon .Locked label = constants .Label .Activate onClick = ( action "onSave" ) }}
2017-11-28 12:49:48 +00:00
</form>
2018-06-12 14:07:50 +01:00
{{ # if ( gt keycloakFailure .length 0 ) }}
<p class="admin-setting-failure my-3">Keycloak connection failed: {{ keycloakFailure }} </p>
{{ / if }}
2018-09-03 18:19:46 +01:00
</div>
<div id="ldap-preview-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">LDAP Preview</div>
<div class="modal-body">
{{ # if ldapPreview .isError }}
<p class="text-danger"> {{ ldapPreview .message }} </p>
{{ else }}
2018-09-04 17:19:26 +01:00
<p class="text-success">Connection successful, found {{ ldapPreview .count }} users.</p>
2018-09-03 18:19:46 +01:00
{{ # each ldapPreview .users as | user | }}
2018-09-12 20:03:06 +01:00
<p> {{ user .firstname }} {{ user .lastname }} ( {{ user .email }} )</p>
2018-09-03 18:19:46 +01:00
{{ / each }}
{{ / if }}
</div>
<div class="modal-footer">
2018-12-13 12:24:16 +00:00
{{ ui / ui-button color = constants .Color .Gray light = true label = constants .Label .Cancel dismiss = true }}
2018-09-03 18:19:46 +01:00
</div>
</div>
</div>
2018-12-13 12:24:16 +00:00
</div>