Skip to content
Snippets Groups Projects
Commit 0b419b3f authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

Merge branch 'ecolyo-agent-roles' into 'master'

Ecolyo agent roles

See merge request !48
parents a2458025 85d61bf5
No related branches found
No related tags found
1 merge request!48Ecolyo agent roles
Pipeline #71639 passed
# 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.
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment