France Connect is an identification and authentication system for people which is managed by the French Government.
Alan believes in simplifying the user experience with all formalities, and contributing to France Connect fits in this mission.
This tutorial is meant to set up with a working test for France Connect using Python/Flask.
The documentation for France Connect is here: https://partenaires.franceconnect.gouv.fr
After cloning the repo, here are the few steps to get you started:
Install Python 3. You can follow this guide.
- Create and prepare your virtual env and activate it:
python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
Visit France Connect.
Click the Editer le FS
button.
On top, you'll get the client_id
and the client_secret
. You will need these in your app.py
.
You also need to generate a random id (it can be anything) as your app.secret_key
.
-
Install ngrok from here.
-
Run it with your favorite port (we'll use 5000 here):
ngrok http 5000
- Ngrok will provide you with a callback address, such as:
https://7f132061.ngrok.io
You'll want to use https://7f132061.ngrok.io/france_connect
as the callback address.
-
Put the callback address with in the
Urls de callback
from France Connect's partenaire page. -
You can also add
https://7f132061.ngrok.io
as anUrl de déconnexion
.
- Run the server on
127.0.0.1:5000
:
python app.py
You can create test data using France Connect's tool here.
And you're all set to test France Connect by clicking on your local site!