Skip to content
Discussion options

You must be logged in to vote

hi @fpstidston - i have oauth implemented in my fork here, i (still) need to contribute that upstream here 😓

if you install from the fork, you can do something like this with OAuthClient:

from atproto_oauth import OAuthClient

client = OAuthClient(
    client_id="https://your-app.com/client-metadata.json",
    redirect_uri="https://your-app.com/callback",
    scope="atproto repo:...",
    state_store=your_state_store,
    session_store=your_session_store,
)

# start flow
auth_url, state = await client.start_authorization(handle)
# redirect user to auth_url

# handle callback
oauth_session = await client.handle_callback(code, state, iss)
# oauth_session has: .did, .handle, .access_token, .…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by fpstidston
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants