Skip to content

stijn-janssens/cognito-fastapi-device-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OIDC With Cognito and FastAPI

Local execution

  • Install poetry and Python 3.12 on your machine. Make sure poetry is available on your PATH.
  • In a terminal inside this directory, execute poetry install.
  • Execute poetry run python -m app.main to start a local server.

Cognito setup

  • Make sure you have a working AWS Cognito User Pool available.
  • Pass the configuration values as specified in example.env to a .env file in the root directory.

Testing

  • The easiest way to test the device flow is through the Swagger UI Docs.
  • Start up your server and go to http://localhost:5050/docs
  • Authenticate using your Cognito client id and secret.

Device flow

  • Execute Get Device Token
  • Copy and paste the verification URI in your browser
  • Click confirm and authenticate
  • Now the Get Jwt Token call will succeed.

About

Implementation of OAuth2 Device Flow using AWS Cognito and FastAPI

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages