Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Mon 4134 ldap add okta template (#7825)
Browse files Browse the repository at this point in the history
* enh(ldap): order templates by name ASC
* enh(ldap): add Okta LDAP template
* enh(ldap): update documentation about Okta server + SWA plugin
  • Loading branch information
lpinsivy authored Oct 2, 2019
1 parent 85d48d3 commit 0c5e719
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 15 deletions.
10 changes: 9 additions & 1 deletion doc/en/administration_guide/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,19 @@ The table below summarizes the settings to add an LDAP server:

* **Bind user** and **Bind password** fields define the user name and the password for logging to the LDAP server
* **Protocol version** field indicates the version of the protocol using to login
* **Template** list can be used to pre-configure the search filters for users on the LDAP directory. These filters serve to propose, by default, a search on the MS AD or of Posix type directories.
* **Template** list can be used to pre-configure the search filters for users on the LDAP directory. These filters
serve to propose, by default, a search on the MS Active Directory, Okta or of Posix type directories.

.. note::
Before any import, check the default settings proposed. If you have not selected a Model, you will need to define the search filters manually by filling in the fields.

.. note::
You can use **Okta** as LDAP server with `SWA plugin <https://help.okta.com/en/prod/Content/Topics/Apps/Apps_Configure_Template_App.htm>`_.
Please define:

* **uid=<USER>,dc=<ORGANIZATION>,dc=okta,dc=com** for **Bind DN** field
* **ou=<OU>,dc=<ORGANIZATION>,dc=okta,dc=com** ** for **Search group base DN** field.

With CentOS 7, it's possible to not check server certificate, follow procedure :

Add the following line in file "/etc/openldap/ldap.conf" :
Expand Down
8 changes: 7 additions & 1 deletion doc/fr/administration_guide/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,17 @@ Le tableau ci-dessous résume les différents paramètres à insérer pour ajout

* Les champs **Utilisateur du domaine** et **Mot de passe** définissent le nom d'utilisateur et le mot de passe pour se connecter au serveur LDAP
* Le champ **Version du protocole** indique la version du protocole à utiliser pour se connecter
* La liste **Modèle** permet de préconfigurer les filtres de recherches des utilisateurs sur l'annuaire LDAP. Ces filtres permettant de proposer par défaut une recherche sur un annuaire de type MS AD ou de type Posix.
* La liste **Modèle** permet de préconfigurer les filtres de recherches des utilisateurs sur l'annuaire LDAP.
Ces filtres permettent de proposer par défaut une recherche sur un annuaire de type MS Active Directory, Okta ou de type Posix.

.. note::
Avant tout import, vérifiez les paramètres par défaut proposés. Si vous n'avez sélectionné aucun modèle, vous devez définir manuellement les filtres de recherches en complétant les champs.

.. note::
Il est possible d'utiliser l'annuaire **Okta** avec le `plugin SWA <https://help.okta.com/en/prod/Content/Topics/Apps/Apps_Configure_Template_App.htm>`_:

* le champ **Utilisateur du domaine** est du type **uid=<USER>,dc=<ORGANIZATION>,dc=okta,dc=com**
* et le champ **Base de recherche de groupe DN** du type **ou=<OU>,dc=<ORGANIZATION>,dc=okta,dc=com**

Sous CentOS 7, on peut définir de ne pas vérifier le certificat serveur avec la procédure suivante:

Expand Down
39 changes: 26 additions & 13 deletions www/include/Administration/parameters/ldap/javascript/ldapJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,6 @@ function removeTr(trId) {
function initTemplates() {
ldapTemplates = new Array();

ldapTemplates['Posix'] = new Array();
ldapTemplates['Posix']['user_filter'] = '(&(uid=%s)(objectClass=inetOrgPerson))';
ldapTemplates['Posix']['alias'] = 'uid';
ldapTemplates['Posix']['user_group'] = '';
ldapTemplates['Posix']['user_name'] = 'cn';
ldapTemplates['Posix']['user_firstname'] = 'givenname';
ldapTemplates['Posix']['user_lastname'] = 'sn';
ldapTemplates['Posix']['user_email'] = 'mail';
ldapTemplates['Posix']['user_pager'] = 'mobile';
ldapTemplates['Posix']['group_filter'] = '(&(cn=%s)(objectClass=groupOfNames))';
ldapTemplates['Posix']['group_name'] = 'cn';
ldapTemplates['Posix']['group_member'] = 'member';

ldapTemplates['Active Directory'] = new Array();
ldapTemplates['Active Directory']['user_filter'] =
'(&(samAccountName=%s)(objectClass=user)(samAccountType=805306368))';
Expand All @@ -238,6 +225,32 @@ function initTemplates() {
'(&(samAccountName=%s)(objectClass=group)(samAccountType=268435456))';
ldapTemplates['Active Directory']['group_name'] = 'samaccountname';
ldapTemplates['Active Directory']['group_member'] = 'member';

ldapTemplates['Posix'] = new Array();
ldapTemplates['Posix']['user_filter'] = '(&(uid=%s)(objectClass=inetOrgPerson))';
ldapTemplates['Posix']['alias'] = 'uid';
ldapTemplates['Posix']['user_group'] = '';
ldapTemplates['Posix']['user_name'] = 'cn';
ldapTemplates['Posix']['user_firstname'] = 'givenname';
ldapTemplates['Posix']['user_lastname'] = 'sn';
ldapTemplates['Posix']['user_email'] = 'mail';
ldapTemplates['Posix']['user_pager'] = 'mobile';
ldapTemplates['Posix']['group_filter'] = '(&(cn=%s)(objectClass=groupOfNames))';
ldapTemplates['Posix']['group_name'] = 'cn';
ldapTemplates['Posix']['group_member'] = 'member';

ldapTemplates['Okta'] = new Array();
ldapTemplates['Okta']['user_filter'] = '(&(nickName=%s)(objectclass=inetorgperson))';
ldapTemplates['Okta']['alias'] = 'nickname';
ldapTemplates['Okta']['user_group'] = 'memberof';
ldapTemplates['Okta']['user_name'] = 'cn';
ldapTemplates['Okta']['user_firstname'] = 'givenname';
ldapTemplates['Okta']['user_lastname'] = 'sn';
ldapTemplates['Okta']['user_email'] = 'mail';
ldapTemplates['Okta']['user_pager'] = 'mobile';
ldapTemplates['Okta']['group_filter'] = '(&(cn=%s)(objectclass=groupofuniquenames))';
ldapTemplates['Okta']['group_name'] = 'cn';
ldapTemplates['Okta']['group_member'] = 'uniquemember';
}

/*
Expand Down

0 comments on commit 0c5e719

Please sign in to comment.