This is just a sample implementation of the GitHub OAuth login flow within NiceGui. I followed this documentation to learn about the flow.
- Create an OAuth app on Github
- Copy your
CLIENT_ID
,CLIENT_SECRET
andCALLBACK_URL
to the.env.bak
file and remove the .bak extension - Generate some SSL Certificates (
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key .pem -days 365
) - Start the appliction with
python3 app.py
You need to provide SSL certificates using Uvicorn or a Traefik reverse Proxy, as GitHub does not allow insecure callback URLs with HTTP.