Skip to content

Latest commit

 

History

History

oauth2-password-provider

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Example of Self Hosted OAuth2 Password Provider

A simple example of a self hosted OAuth2 password provider. It can be used to authenticate users in own applications with password flow.

Running the example

  • create a Python virtual environment
python -m venv venv
  • install dependencies
pip install -r requirements.txt
  • run the dev server
python server.py

Server has 4 endpoints

  • /api/register - register a new user
  • /api/token - get a new access token
  • /api/refresh - refresh an access token
  • /api/revoke - revoke an access token
  • /api/anonymous - get a resource without authentication
  • /api/protected - get a resource with authentication