Skip to content

PKCE support with oauthlib 3 #678

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

Merged
merged 21 commits into from
Apr 6, 2019

Conversation

Maronato
Copy link
Contributor

This PR modifies #656's implementation to use oauthlib's built-in support for PKCE.

Since this version of oauthlib is based on version 3, I had to modify some test cases to comply with the changes.

I also modified the tox and setup files to use the new version of oauthlib.
All modifications to the base test cases and tox/setup files are contained in a491bb1.

@coveralls
Copy link

coveralls commented Dec 16, 2018

Pull Request Test Coverage Report for Build 1080

  • 23 of 24 (95.83%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 94.557%

Changes Missing Coverage Covered Lines Changed/Added Lines %
oauth2_provider/oauth2_validators.py 10 11 90.91%
Totals Coverage Status
Change from base Build 1077: 0.02%
Covered Lines: 1216
Relevant Lines: 1286

💛 - Coveralls

@JonathanHuot JonathanHuot mentioned this pull request Jan 13, 2019
@auvipy
Copy link
Contributor

auvipy commented Feb 21, 2019

could anyone check why the build is failing?

@Maronato
Copy link
Contributor Author

Seems to be because of my attempt to support oauthlib 3 unofficially.
This dep is to blame:
https://github.com/jazzband/django-oauth-toolkit/blob/a491bb1994ae94e6d0ac9adca632185c805b6ef5/tox.ini#L23

@Maronato
Copy link
Contributor Author

I'll fix it once I get a hold of my pc

@auvipy
Copy link
Contributor

auvipy commented Feb 21, 2019

ping me after making travis green.

@auvipy
Copy link
Contributor

auvipy commented Feb 21, 2019

https://github.com/oauthlib/oauthlib/releases seems 3.0.1 is the latest

@svanscho
Copy link

Any progress? Would love to use this in our new app!

@sindrig
Copy link

sindrig commented Apr 3, 2019

Same here. We're anxiously waiting for this to be able to supply our vendors with the ability to use PKCE.

@Maronato
Copy link
Contributor Author

Maronato commented Apr 6, 2019

@auvipy Sorry it took so long. Fixed the migration and pulled from master. Should be ready to merge now.

@auvipy auvipy merged commit dc429ad into django-oauth:master Apr 6, 2019
@auvipy
Copy link
Contributor

auvipy commented Apr 6, 2019

really great work! thanks for tackling this and reviewers for reviewing.

@svanscho
Copy link

svanscho commented Apr 6, 2019

Thanks guys! Awesome work :-) 👍

"code_challenge_method": code_challenge_method,
}

response = self.client.post(reverse("oauth2_provider:authorize"), data=authcode_data)
Copy link
Contributor

@Abhishek8394 Abhishek8394 Apr 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a quick question about this. Shouldn't this be a GET request? I get csrf errors when I send POST. I have been trying to get PKCE to run against master but couldn't get it to work. I would appreciate any pointers no how to get it working.

Edit: many tests fail when I change it to get. I would love to work on this unless it would be a faster fix for OP.

@n2ygk
Copy link
Contributor

n2ygk commented Apr 19, 2019 via email

@Abhishek8394
Copy link
Contributor

Abhishek8394 commented Apr 19, 2019 via email

@Maronato
Copy link
Contributor Author

This is odd. This pull request does not change anything related to how the requests are handled. It only adds new fields to the existing ones. Would you mind sharing how you are making the requests?

@Abhishek8394
Copy link
Contributor

Abhishek8394 commented Apr 19, 2019 via email

@Maronato
Copy link
Contributor Author

I just tested it and you are correct. I was under the impression that oauthlib would capture PKCE credentials, but it doesn't. I've submitted a PR fixing the issue: #707

@Abhishek8394
Copy link
Contributor

Abhishek8394 commented Apr 19, 2019 via email

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.

7 participants