bluesky-social / cookbook

A collection of example projects and scripts for atproto development.
122 stars 15 forks source link

atproto OAuth Flask Backend Demo #11

Closed bnewbold closed 2 months ago

bnewbold commented 3 months ago

The README gives an overview and getting started directions.

This is a example project showing how to implement an Python web service which uses atproto OAuth for authentication. It uses Flask as a web framework, and sqlite as a database to store session tokens.

Progress/status:

It might also be helpful to have a "public" client example in python? But don't want to over-complicate this codebase.

ngerakines commented 3 months ago

Can this proof-of-concept also include JWT validation for tokens sent from the PDS?

bnewbold commented 3 months ago

@ngerakines the current spec semantics are that the authorization server tokens are opaque strings. they are indeed JWTs in the case of the bsky PDS/entryway implementation, but I think this demo shouldn't assume that

bnewbold commented 3 months ago

There is a demo version of this deployed at: https://oauth-flask.demo.bsky.dev/

It has been updated to be inline with the current draft spec (https://github.com/bluesky-social/atproto-website/pull/326), as of just now. Any discrepancies are a bug!

This is ready for final review and merge.