Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.8 KB

README.md

File metadata and controls

37 lines (29 loc) · 1.8 KB

fastapi-sso-example

FastAPI Single Sign On example with various providers and minimal home page that presents counters for users from each provider

Cloud deployed demo

https://fastapi-sso-example.vercel.app/

Installation

  • Create a python virtual environment: python3.11 -m venv venv
  • Activate the virtual environment: source venv/bin/activate
  • Install dependencies: python3.11 -m pip install -r requirements.txt

Setup and Configuration

  • Create a .env file in the project root directory with the keys just like shown in .env.example
  • Fill the values for each environment variable
  • For creating client IDs and secrets for each provider you can follow these guides:

Use the project

  • While in activated virtual environment, run with: python3.11 main.py

To sign up a local user

Use the swagger documentation at localhost:9999/v1/documentation, example:

  • img.png

Browse in the app

  • Visit the user interface in the browser at: localhost:9999
  • Use form to sign-in with local users
  • Use sign-in buttons to sign-in via a provider