/oauth2-local-server-experiment

A lightweight OAuth 2.1 local server with PKCE, token rotation, and DPoP support for learning, testing, and experimentation.

Primary LanguagePython

OAuth 2.1 Local Server and Experiment

This repository provides a minimal OAuth 2.1 server (using Flask) and a client experiment script for testing PKCE, token rotation, DPoP, and more.

Requirements

  • Python 3.7+
  • pip install flask pyjwt cryptography requests

Usage

  1. Run the local server:

python local_oauth_server.py

It will start on http://127.0.0.1:5000.

  1. Edit oauth_experiment.py if needed to match the server endpoints. Run the experiment script:

python oauth_experiment.py

  1. Check the console outputs and any returned JSON to see the tokens and test results.

Use these scripts for demonstration or local testing only. Do not use them in production environments.