diff --git a/docs/ecolyo-agent/functionalities/authentication.md b/docs/ecolyo-agent/functionalities/authentication.md index 9dd6cc42089b855d2933e27a6ea9d3b0c413e731..a815a82b6a8e27e6e8063d4c985c07a83f5be0cb 100644 --- a/docs/ecolyo-agent/functionalities/authentication.md +++ b/docs/ecolyo-agent/functionalities/authentication.md @@ -1,10 +1,15 @@ # Authentication -This backoffice is meant to be used only by the admins of Ecolyo app and so they need to login to edit the newsletters. - The protocol used to login is OAuth2 with the Authorization Code grant type ([more info](https://auth0.com/docs/authorization/flows/authorization-code-flow)) -Once an admin is connected, he must call the /whoAmI route to access his XSRF-TOKEN and add it in a header named "XSRF-TOKEN" for all requests going to the backend. - The only routes that can be accessed without authentication are /monthlyReport/year/month and /monthlyReport with GET. They will return all the different sections of a specific or the current newsletter in a single JSON. + +## Roles + +The Identity Provider used is Sign&Go and the list of person able to log in Ecolyo-Agent are managed in [MIM](https://mim.grandlyon.fr) (only accessible on Mercure network) + +This backoffice is meant to be used only by two types of persons : + +- the animators of Ecolyo: they edit the newsletters, the fluid prices and the content of warning pop-ups. +- the administrators of Ecolyo: they can do all of the above and also view and search for SGE consents. diff --git a/docs/ecolyo-agent/technical/getting_started.md b/docs/ecolyo-agent/technical/getting_started.md index 2253f1e7349a3239e441d58699dfc15a41f2ce0a..1ded18dc16519250dc35062548cbe0dfb5d9c0c3 100644 --- a/docs/ecolyo-agent/technical/getting_started.md +++ b/docs/ecolyo-agent/technical/getting_started.md @@ -18,8 +18,9 @@ This project is split between a backend and frontend, each project has its own r !!! note Before launching the application, ensure you've properly filled the `.env` file according to the template. If needed please refer to a team member. The template contains - - IMAGE_FOLDER: this variable specify the folder where ecogestures images are located. By default, you can place this folder at the same level as your project for a local usage. (not inside the project). For alpha, rec/prod environment, make sure the path indicated in docker-compose volumes correspond with the location of the image file on the server. - - MOCK_OAUTH2: Set this variable to true while in local, so the OAuth2 dance will be mocked by backend and you will be able to login to your application. + - `IMAGE_FOLDER`: this variable specify the folder where ecogestures images are located. By default, you can place this folder at the same level as your project for a local usage. (not inside the project). For alpha, rec/prod environment, make sure the path indicated in docker-compose volumes correspond with the location of the image file on the server. + - `MOCK_OAUTH2`: Set this variable to true while in local, so the OAuth2 dance will be mocked by backend and you will be able to login to your application. + - `USERINFO_URL`: Set this variable to `http://localhost:8090/admininfo` to log in with admin role or to `http://localhost:8090/animatorinfo` to log in with animator role In order to launch the project in local with the backend working launch the following command @@ -44,7 +45,6 @@ This command will launch the app from the _docker-compose.local.yml_ file, which The nginx server needs local ssl certificates in order to run an interact with backend, these certificates are present in the project. - To stop it properly use ```bash @@ -73,6 +73,8 @@ Once the application is started, you can access it at <https://localhost> Also make sure you have HTTPS env variable set to true. **Do not** use the app with the port 3000, you won't be able to login. +Once an animator/admin is connected, he must call the /whoAmI route to access his XSRF-TOKEN and add it in a header named "XSRF-TOKEN" for all requests going to the backend. + ## Ecolyo Agent - Server ### Features