Skip to content

Implement OAUTHBEARER from RFC 7628 #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

Zash
Copy link

@Zash Zash commented May 26, 2023

Untested. Draft-PR hoping for API feedback.

The OAUTHBEARER mechanism is weird and backwards, thus the API will have to be awkward and annoying. You start by sending the token, which you don't have yet, nor know where to retrieve it from. Then the server sends you a challenge with some JSON that includes the URL where you would discover this from. Then you can do the OAuth dance, retrieve your token and start over from the beginning.

The credentials callback would likely look something like:

def credentials(stuff):
    if stuff is None:
        return ('', {'auth':'Bearer Idontknowyet'})
    if 'openid-configuration' in stuff:
        # Do the dance. Get the token.
        return ('', {'auth':'Bearer reallysecrettokenhere'})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant