Skip to content
Snippets Groups Projects
Commit e57ad715 authored by Elian Loraux's avatar Elian Loraux
Browse files

Add dolibarr connection

parent 198976f3
No related branches found
No related tags found
No related merge requests found
...@@ -18,11 +18,11 @@ Ici on cherche à ajouter un client au sens commercial qui se traduiras par un r ...@@ -18,11 +18,11 @@ Ici on cherche à ajouter un client au sens commercial qui se traduiras par un r
- [ ] Cliquez sur le menu déroulant en dessous du logo Keycloak - [ ] Cliquez sur le menu déroulant en dessous du logo Keycloak
- [ ] Cliquez sur Create realm - [ ] Cliquez sur Create realm
[image] ![Add Realm](img/add-realm.png)
- [ ] Entrez le nom de royaume - [ ] Entrez le nom de royaume
[image] ![Name Realm](img/name-realm.png)
## Configuration du Royaume ## Configuration du Royaume
...@@ -35,7 +35,7 @@ Ici on cherche à ajouter un client au sens commercial qui se traduiras par un r ...@@ -35,7 +35,7 @@ Ici on cherche à ajouter un client au sens commercial qui se traduiras par un r
- [ ] Aller dans l'onglet "Localization" - [ ] Aller dans l'onglet "Localization"
- [ ] Activez l'option "Internationalization" - [ ] Activez l'option "Internationalization"
- [ ] Ajoutez les langues souhaitées - [ ] Ajoutez les langues souhaitées
- [ ] Sauvegardez - [ ] Sauvegarde
## Création du première utilisateur ## Création du première utilisateur
......
# Branchement de Dolibarr sur Keycloak
## Prérequis
[Dolibarr dockerisé](https://gitlab.tetras-libre.fr/nocloud/docker/dolibarr) en place.
Avoir un royaume keycloak et un client dolibarr dans ce royaume
## Mise en place du SSO sur dolibarr_src
Pour mettre en place le SSO sur dolibarr il vous faut suivre ses instructions :
1. [ ] Crée le même utilisateur (avec le même username) dans dolibarr et dans keycloak
2. [ ] Récupérer les informations suivante
- [ ] Domaine Keycloak (ex : keycloak.tetras-libre.fr)
- [ ] Domaine Dolibarr (ex : dolibarr.tetras-libre.fr)
- [ ] Nom du royaume
- [ ] ClientID
1. Dans keycloak, cliquez sur "Client"
2. Récupérer le ClientID du client dolibarr ![Client ID](img/clientID.png)
3. Récupérer le secret du client ![Client secret](img/secret.png)
3. [ ] Générer les variable dolibarr avec le script `dolibarr_variables.py`
4. [ ] Mettre les variables dans Dolibarr > Setup > Other Setup
5. [ ] Configurez la methode d'authentification dans conf.php (dolibarr_src/htdocs/conf/conf.php) en mettant 'openid_connect' `$dolibarr_main_authentication='openid_connect'`
6. [ ] Confugurez le Client keycloak dolibarr
1. [ ] Activez "Always display in UI"
2. [ ] Rensaignez "Home URL" avec l'url du dolibarr (ex : dolibarr.tetras-libre.fr)
3. [ ] Rensaignez "valid redirect URIs" avec l'url du dolibarr suivit de '\/*' (ex : dolibarr.tetras-libre.fr\/*)
4. [ ] Rensaignez "Web origins" avec l'URL de keyclaok et dolibarr (ex : keycloak.tetras-libre.fr,dolibarr.tetras-libre.fr)
Pour plus d'information, suivez le [tutoriel dolibarr](https://wiki.dolibarr.org/index.php?title=Authentication,_SSO_and_SSL#Mode_openid_connect)
.gitlab/issue_templates/img/add-realm.png

8.07 KiB

.gitlab/issue_templates/img/clientID.png

39.1 KiB

.gitlab/issue_templates/img/name-realm.png

29.3 KiB

.gitlab/issue_templates/img/secret.png

41.2 KiB

...@@ -15,42 +15,8 @@ It's designed to be connected to a Dolibarr instance and other partners applciat ...@@ -15,42 +15,8 @@ It's designed to be connected to a Dolibarr instance and other partners applciat
## Configuration ## Configuration
For realm creation, add custom theme and Dolibarr connection, see issue template (.gitlab/issue_templates)
### Create realm, first user and connect first application ### Create realm, first user and connect first application
Follow the official [get started tutorial](https://www.keycloak.org/getting-started/getting-started-docker) Follow the official [get started tutorial](https://www.keycloak.org/getting-started/getting-started-docker)
### Link a Dolibarr instance to Keycloak
#### Prerequisites
Set un dockerised [Dolibarr](https://gitlab.tetras-libre.fr/nocloud/docker/dolibarr)
#### Set up Dolibarr
To set up SSO with dolibarr you need folow this insctruction :
1. Create user with the same username in dolibarr and keycloak
2. Generate the dolibarr variable with `dolibarr_variables.py`. If you don't know where to find the information requested by the script, see Prerequisites
3. Put generated variables in Dolibarr > Setup > Other Setup
4. Configure the authentication methods in conf.php (dolibarr_src/htdocs/conf/conf.php) and add openid_connect. `$dolibarr_main_authentication='openid_connect'`
5.
- In dev : choose username matching : `preferred_username`
- In prod : Choose mail matching method
For many information, follow the [dolibarr tutorial](https://wiki.dolibarr.org/index.php?title=Authentication,_SSO_and_SSL#Mode_openid_connect)
#### Final config KeyCloak Dolibarr for Prod (WIP)
- In Realm settings > Login, check following options
- Forgot password
- Remember me
- Email as username
- login with email
- verify email
- Realm settings > Email, configur your SMTP parameters + mail informations
- Realm settings > Theme, add your custom theme
- If needed create users group
- Create your users
- Client > account-console > sttings
- Set web origins to *
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment