iivek / redis-token-rotation

Refresh tokens on Redis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TokenCycle

Custom token lifecyle and rotation in Redis

License Version

PRs Welcome

About

Made for authorization flows that use internal refresh tokens. Implements token generation, validation, rotation and token reuse detection, using an async Redis client.

Installation

Clone the repository and install the package:

$ git clone https://github.com/iivek/redis-token-rotation.git
$ pip install -e ./

Usage

First, let's provision a local redis instance, using terraform. From project root:

$ export PROJECT_ROOT=$(pwd)
$ cd $PROJECT_ROOT/examples/terraform && \
  terraform init && \
  terraform plan && \
  terraform apply -auto-approve              # provision a local redis instance

Next, we can run the example python script:

$ cd $PROJECT_ROOT/examples && \
  PYTHONPATH=$PROJECT_ROOT python main.py    # run the example

About

Refresh tokens on Redis

License:MIT License


Languages

Language:Python 100.0%