Skip to content

Usage with httpx 'auth' #264

Answered by frankie567
oryon-dominik asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @oryon-dominik!

Unfortunately, OAuth2 is a bit more complex and involves a bit more steps than that 🙃 I strongly recommend you to read detailed resources about the protocol, but here is a simplified overview:

1. Authorization URL

Generate an authorization URL for the service provider (GitHub, Google...). This URL points to a web page where you'll be able to allow your application to access your personal data (you probably already seen and used this kind of interface).

authorization_url = await client.get_authorization_url(
    "http://localhost:8000/oauth-callback", scope=["SCOPE1", "SCOPE2", "SCOPE3"],
)

The first argument is the redirect URL: it's a URL on your own web server where t…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@oryon-dominik
Comment options

@frankie567
Comment options

Answer selected by oryon-dominik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants