-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
OAuth2 Authentication #693
Conversation
@@ -859,7 +859,7 @@ pre { | |||
} | |||
|
|||
code { | |||
padding: 2px 4px; | |||
padding: 1px 4px; |
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.
Keep any CSS changes to a separate pull req.
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.
Allright, I'll move them right now.
Great stuff! Really excellent. Comments inline. 👍 :) |
Thanks :) |
Conflicts: rest_framework/tests/authentication.py
to avoid naming collision with `oauth2` used for OAuth 1
@thedrow I just forgot to add the "pip install" command to the |
from rest_framework.tests.utils import RequestFactory | ||
from rest_framework.views import APIView | ||
import json | ||
import base64 | ||
import datetime | ||
import unittest |
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.
Use 'from django.utils import unittest' for compatibility across different py versions
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.
thanks @tomchristie for this tip!
for a cross python versions compatibility
Well, the pull request is still failing ! I've just found out about |
django-oauth2-provider isn't yet py3k compatible, so may as well drop it from tox and Travis for the moment. Just leaves Django 1.3 errors which are a bit more mysterious. On 1 Mar 2013, at 23:36, Pierre Dulac [email protected] wrote:
|
I agree, the Django 1.3 errors are pretty mysterious, but I've already came across a similar issue while implementing the But I don't know the reasons that can explain why python is mixing up exceptions like that. |
I've finally cracked it ! :) The mysterious error is due to the fact that the So, when I create the form in authentication.py#L3R192 in fact it fails and raise an exception. The thing I don't know is why the AttributeError: 'module' object has no attribute 'forms' |
@@ -14,6 +14,7 @@ env: | |||
install: | |||
- pip install $DJANGO | |||
- pip install defusedxml==0.3 | |||
- "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install -e git+git://github.com/dulaccc/django-oauth2-provider.git#egg=django-oauth2-provider; fi" |
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.
What's different in your fork?
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.
Hi used my fork, temporary, because I didn't get any return from the repo owner concerning my pull requests and other pull requesters too.
And in my fork, I made a fix to add the submodules import statements into the provider.oauth2.__init__
file to fix the error we were getting with Django 1.3
Moreover, I made changes to the README in order to point to the new documentation I'm refactoring.
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.
Okay. Can't really merge this until it's pointed at the PyPI version. If we can use the PyPI version and workaround any import issues inside the compat
module that'd be great.
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.
I understand. I will change that.
But as @thedrow suggested, do you want me to then rebase the commit into the corresponding one where I initially use my fork ?
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.
Yes, I perfectly understand, and fortunately no one has forked my public fork so no harm :) I'll forced my commit to take into account the rebase, you're right this is the correct way to fix "commit mistakes" if no one fork those commits.
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.
I don't care about history so much, so don't worry about rebase unless you want too.
On 6 Mar 2013, at 17:37, Pierre Dulac [email protected] wrote:
In .travis.yml:
@@ -14,6 +14,7 @@ env:
install:
- pip install $DJANGO
- pip install defusedxml==0.3
- "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install -e git+git://github.com/dulaccc/django-oauth2-provider.git#egg=django-oauth2-provider; fi"
I understand. I will change that.
But as @thedrow suggested, do you want me to then rebase the commit into the corresponding one where I initially use my fork ?—
Reply to this email directly or view it on GitHub.
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.
Changes pushed. I've done a rebase to clean a little and avoid "doing this, undoing this, redoing this" ^^ and to learn in the same time the better practices.
The only thing is that it didn't seem to trigger the Travis builds.
Correct. On 6 March 2013 17:09, Omer Katz [email protected] wrote:
|
here by pip. | ||
|
||
Once this package is successfully installed this source code will be | ||
deleted (unless you remove this file). |
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.
Drop this file.
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.
Oops... this shouldn't be here
Actually, the OAuth authentication class is pretty short. So, if you want to use another oauth provider you can easily adapt yours and write your own Authentication class. |
Allright, I will learn how to use |
otherwise log a warning
with a warning for incompatibility with Python 3 and taking @tomchristie advice into account on how to reformulate some sentences
Travis build isn't showing up but it was triggered build#5296716 |
For the awesome OAuth 2 support in #693.
Merged into #709. |
Awesome! Thanks a lot folks :) |
After the OAuth1 PR, here is the
OAuth2Authencation
class as discussed in #8I've incorporated some doc on "how to get started" with
django-oauth2-provider
but maybe you don't want to incorporate those kind of third-party-documentation. I made that as a temporary way for people to get started, waiting for the official doc to be ready.