-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix missing PKCE field #321
Conversation
3752662
to
54f51cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes total sense @king-jam, thank you 👏 I've added a few minor comments :)
docs/oauth2.md
Outdated
@@ -29,6 +29,8 @@ Returns the authorization URL where you should redirect the user to ask for thei | |||
* `redirect_uri: str`: Your callback URI where the user will be redirected after the service prompt. | |||
* `state: str = None`: Optional string that will be returned back in the callback parameters to allow you to retrieve state information. | |||
* `scope: Optional[List[str]] = None`: Optional list of scopes to ask for. | |||
* `code_challenge: Optional[str] = None`: Optional code_challenge in a [PKCE context](https://datatracker.ietf.org/doc/html/rfc7636). | |||
* `code_challenge_method: ptional[str] = None`: Optional code_challenge_method in a [PKCE context](https://datatracker.ietf.org/doc/html/rfc7636). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: Optional
httpx_oauth/oauth2.py
Outdated
@@ -100,6 +100,8 @@ async def get_authorization_url( | |||
redirect_uri: str, | |||
state: Optional[str] = None, | |||
scope: Optional[List[str]] = None, | |||
code_challenge: Optional[str] = None, | |||
code_challenge_method: Optional[str] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you we type it as Literal['plain', 'S256']
?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #321 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 18
Lines 486 490 +4
=========================================
+ Hits 486 490 +4 ☔ View full report in Codecov by Sentry. |
Thank you @king-jam 🙏 @all-contributors add @king-jam for code |
I've put up a pull request to add @king-jam! 🎉 |
PKCE support only had the code_verifier portion on the get_access_token method. While possible to use extras_params for this, PKCE is becoming more mainstream so making it a first class field.