2017-11-28 12:49:48 +00:00
<div class="row">
<div class="col">
<div class="view-customize">
<h1 class="admin-heading">Authentication</h1>
<h2 class="sub-heading">Choose user authentication mechanism</h2>
</div>
</div>
</div>
<div class="view-customize">
<form class="mt-5">
2018-09-03 17:36:54 +01:00
<div class="widget-list-picker widget-list-picker-horiz mb-5">
<ul class="options">
<li class="option {{ if isDocumizeProvider 'selected' }} " {{ action 'onDocumize' }} >
<div class="text-header">Documize</div>
<div class="text">Built-in email/password</div>
{{ # if isDocumizeProvider }}
<i class="material-icons">check</i>
{{ / if }}
</li>
<li class="option {{ if isKeycloakProvider 'selected' }} " {{ action 'onKeycloak' }} >
<div class="text-header">Keycloak</div>
<div class="text">Via authentication server</div>
{{ # if isKeycloakProvider }}
<i class="material-icons">check</i>
{{ / if }}
</li>
<li class="option {{ if isLDAPProvider 'selected' }} " {{ action 'onLDAP' }} >
<div class="text-header">LDAP</div>
<div class="text">Connect to LDAP/ Active Directory</div>
{{ # if isLDAPProvider }}
<i class="material-icons">check</i>
{{ / if }}
</li>
</ul>
2017-11-28 12:49:48 +00:00
</div>
2017-03-14 17:19:53 +00:00
2017-11-28 12:49:48 +00:00
{{ # if isKeycloakProvider }}
<div class="form-group row">
2018-09-03 17:36:54 +01:00
<label for="keycloak-url" class="col-sm-3 col-form-label">Keycloak Server URL</label>
<div class="col-sm-9">
2017-11-28 12:49:48 +00:00
{{ 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>
2017-10-04 12:27:56 -04:00
</div>
2017-11-28 12:49:48 +00:00
</div>
<div class="form-group row">
2018-09-03 17:36:54 +01:00
<label for="keycloak-realm" class="col-sm-3 col-form-label">Keycloak Realm</label>
<div class="col-sm-9">
2018-06-12 14:07:50 +01:00
{{ in put id = "keycloak-realm" type = "text" value = keycloakConfig .realm class = ( if KeycloakRealmError 'form-control is-invalid' 'form-control' ) }}
2017-11-28 12:49:48 +00:00
<small class="form-text text-muted">e.g. main</small>
2017-10-04 12:27:56 -04:00
</div>
2017-11-28 12:49:48 +00:00
</div>
<div class="form-group row">
2018-09-03 17:36:54 +01:00
<label for="keycloak-publicKey" class="col-sm-3 col-form-label">Keycloak Realm Public Key</label>
<div class="col-sm-9">
2017-11-28 12:49:48 +00:00
{{ 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>
2017-10-04 12:27:56 -04:00
</div>
2017-11-28 12:49:48 +00:00
</div>
<div class="form-group row">
2018-09-03 17:36:54 +01:00
<label for="keycloak-clientId" class="col-sm-3 col-form-label">Keycloak OIDC Client ID</label>
<div class="col-sm-9">
2017-11-28 12:49:48 +00:00
{{ 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>
2017-10-04 12:27:56 -04:00
</div>
2017-11-28 12:49:48 +00:00
</div>
<div class="form-group row">
2018-09-03 17:36:54 +01:00
<label for="keycloak-group" class="col-sm-3 col-form-label">Keycloak Group ID (Optional)</label>
<div class="col-sm-9">
2017-11-28 12:49:48 +00:00
{{ 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>
2017-10-04 12:27:56 -04:00
</div>
2017-11-28 12:49:48 +00:00
</div>
<div class="form-group row">
2018-09-03 17:36:54 +01:00
<label for="keycloak-admin-user" class="col-sm-3 col-form-label">Keycloak Username</label>
<div class="col-sm-9">
2017-11-28 12:49:48 +00:00
{{ in put id = "keycloak-admin-user" type = "text" value = keycloakConfig .adminUser class = ( if KeycloakAdminUserError 'form-control is-invalid' 'form-control' ) }}
2018-03-22 17:29:59 +00:00
<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>
2017-10-04 12:27:56 -04:00
</div>
2017-11-28 12:49:48 +00:00
</div>
<div class="form-group row">
2018-09-03 17:36:54 +01:00
<label for="keycloak-admin-password" class="col-sm-3 col-form-label">Keycloak Password</label>
<div class="col-sm-9">
2017-11-28 12:49:48 +00:00
{{ 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>
2017-10-04 12:27:56 -04:00
</div>
2017-11-28 12:49:48 +00:00
</div>
<div class="form-group row">
2018-09-03 17:36:54 +01:00
<label class="col-sm-3 col-form-label">Disable Logout</label>
<div class="col-sm-9">
{{ x-toggle value = keycloakConfig .disableLogout size = "medium" theme = "light" onToggle = ( action ( mut keycloakConfig .disableLogout ) ) }}
</div>
</div>
<div class="form-group row">
<label for="ldap-defaultPermissionAddSpace" class="col-sm-3 col-form-label">Can Create Spaces</label>
<div class="col-sm-9">
{{ x-toggle value = keycloakConfig .defaultPermissionAddSpace size = "medium" theme = "light" onToggle = ( action ( mut keycloakConfig .defaultPermissionAddSpace ) ) }}
</div>
</div>
{{ / if }}
{{ # if isLDAPProvider }}
<div class="form-group row">
<label for="ldap-host" class="col-sm-3 col-form-label">LDAP Server</label>
<div class="col-sm-9">
{{ 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>
<div class="form-group row">
<label for="ldap-port" class="col-sm-3 col-form-label">LDAP Server Port</label>
<div class="col-sm-9">
{{ 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>
<div class="form-group row">
<label for="ldap-encryption" class="col-sm-3 col-form-label">Encryption</label>
<div class="col-sm-9">
<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>
<div class="form-group row">
<label for="ldap-baseDN" class="col-sm-3 col-form-label">Base DN</label>
<div class="col-sm-9">
2018-09-03 18:19:46 +01:00
{{ in put id = "ldap-baseDN" type = "text" value = ldapConfig .baseDN class = 'form-control' }}
2018-09-03 17:36:54 +01:00
<small class="form-text text-muted">Starting point for search filters, e.g. ou=users,dc=example,dc=com</small>
</div>
</div>
<div class="form-group row">
<label for="ldap-bindDN" class="col-sm-3 col-form-label">Bind DN</label>
<div class="col-sm-9">
{{ 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>
<div class="form-group row">
<label for="ldap-bindPassword" class="col-sm-3 col-form-label">Bind Password</label>
<div class="col-sm-9">
{{ 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>
<div class="form-group row">
<label for="ldap-userFilter" class="col-sm-3 col-form-label">User Filter</label>
<div class="col-sm-9">
{{ 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>
2017-10-04 12:27:56 -04:00
</div>
2017-11-28 12:49:48 +00:00
</div>
<div class="form-group row">
2018-09-03 17:36:54 +01:00
<label for="ldap-groupFilter" class="col-sm-3 col-form-label">Group Filter</label>
<div class="col-sm-9">
{{ 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>
</div>
</div>
<div class="form-group row">
<label for="ldap-attributeUserRDN" class="col-sm-3 col-form-label">User Attribute RDN</label>
<div class="col-sm-9">
{{ 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>
<div class="form-group row">
<label for="ldap-attributeUserFirstname" class="col-sm-3 col-form-label">User Attribute Firstname</label>
<div class="col-sm-9">
{{ 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>
<div class="form-group row">
<label for="ldap-attributeUserLastname" class="col-sm-3 col-form-label">User Attribute Lastname</label>
<div class="col-sm-9">
{{ 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>
<div class="form-group row">
<label for="ldap-attributeUserEmail" class="col-sm-3 col-form-label">User Attribute Email</label>
<div class="col-sm-9">
{{ 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>
<div class="form-group row">
<label for="ldap-attributeGroupMember" class="col-sm-3 col-form-label">Group Attribute Member</label>
<div class="col-sm-9">
{{ 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>
<div class="form-group row">
<label for="ldap-disableLogout" class="col-sm-3 col-form-label">Disable Logout</label>
<div class="col-sm-9">
{{ x-toggle value = ldapConfig .disableLogout size = "medium" theme = "light" onToggle = ( action ( mut ldapConfig .disableLogout ) ) }}
</div>
</div>
<div class="form-group row">
<label for="ldap-defaultPermissionAddSpace" class="col-sm-3 col-form-label">Can Create Spaces</label>
<div class="col-sm-9">
{{ x-toggle value = ldapConfig .defaultPermissionAddSpace size = "medium" theme = "light" onToggle = ( action ( mut ldapConfig .defaultPermissionAddSpace ) ) }}
2017-10-04 12:27:56 -04:00
</div>
2017-11-28 12:49:48 +00:00
</div>
2018-09-03 18:19:46 +01:00
<div class="form-group row">
<div class="col-sm-3"></div>
<div class="col-sm-9">
<div class="btn btn-secondary mt-4" {{ action 'onLDAPPreview' }} >Test Connection & Preview pauth→</div>
</div>
</div>
2017-11-28 12:49:48 +00:00
{{ / if }}
2018-09-03 17:36:54 +01:00
2018-09-03 18:19:46 +01:00
<div class="btn btn-success mt-4" {{ action 'onSave' }} >ACTIVATE</div>
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 }}
<p class="text-success">Connection successful.</p>
{{ # each ldapPreview .users as | user | }}
<p> {{ user .firstname }} {{ user .firstname }} ( {{ user .email }} )</p>
{{ / each }}
{{ / if }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
2018-03-22 17:29:59 +00:00
</div>