Skip to content

Connecting to a "django oAuth toolkit" based oAuth provider #727

@aviars

Description

@aviars

I am seeking some help getting a custom oAuth client and server configuration working. I've hit a wall I can't get around. The error message leads me nowhere. There doesn't seem to be a backend for "django oAuth toolkit" in python-social-auth. Here are the deets... ​

I am new to using django-oauth-toolkit and walking through part 1 of the tutorial.

I have a client setup via pythons-social-auth that I'm calling "myoauth".I've set this up inside the same project as
django-oauth-toolkit for testing.

Here is the backend:

class MyOAuthOAuth2(BaseOAuth2):
    name = 'myoauth'
    AUTHORIZATION_URL   = 'http://127.0.0.1:8000/o/authorize'
    ACCESS_TOKEN_URL    = 'http://127.0.0.1:8000/o/token'
    ACCESS_TOKEN_METHOD = 'POST'

When I get to the Authorize the Application step, when I click Authorize., I get an 500 error.

The Error I get is here:

HTTPError at /social-auth/complete/myoauth/
500 Server Error: INTERNAL SERVER ERROR
Request Method: GET
Request URL: http://127.0.0.1:8000/social-auth/complete/myoauth/?redirect_state=EWbb3Hg0IoLDcnxyKLUjIZCasMcFKQiV&state=EWbb3Hg0IoLDcnxyKLUjIZCasMcFKQiV&code=S2KIFQP6mYgkZKntcMA4DfZ6qaLsFR
Django Version: 1.8.4
Exception Type: HTTPError
Exception Value:

500 Server Error: INTERNAL SERVER ERROR

Exception Location: /home/alan/.virtualenvs/eapi/local/lib/python2.7/site-packages/requests/models.py in raise_for_status, line 851
Python Executable: /home/alan/.virtualenvs/eapi/bin/python
Python Version: 2.7.6

My runserver output is here....

[01/Sep/2015 18:05:11] "GET /o/authorize/?state=EWbb3Hg0IoLDcnxyKLUjIZCasMcFKQiV&redirect_uri=http%3A%2F%2F127.0.0.1%3A8000%2Fsocial-auth%2Fcomplete%2Fmyoauth%2F%3Fredirect_state%3DEWbb3Hg0IoLDcnxyKLUjIZCasMcFKQiV&response_type=code&client_id=BTzds04ociL9ROHofgXHBQuiJesP5TN4KsXKIS3r HTTP/1.1" 200 3130
[01/Sep/2015 18:05:22] "POST /o/authorize/?state=EWbb3Hg0IoLDcnxyKLUjIZCasMcFKQiV&redirect_uri=http%3A%2F%2F127.0.0.1%3A8000%2Fsocial-auth%2Fcomplete%2Fmyoauth%2F%3Fredirect_state%3DEWbb3Hg0IoLDcnxyKLUjIZCasMcFKQiV&response_type=code&client_id=BTzds04ociL9ROHofgXHBQuiJesP5TN4KsXKIS3r HTTP/1.1" 302 0
[01/Sep/2015 18:05:22] "POST /o/token HTTP/1.1" 500 79551
[01/Sep/2015 18:05:22] "GET /social-auth/complete/myoauth/?redirect_state=EWbb3Hg0IoLDcnxyKLUjIZCasMcFKQiV&state=EWbb3Hg0IoLDcnxyKLUjIZCasMcFKQiV&code=S2KIFQP6mYgkZKntcMA4DfZ6qaLsFR HTTP/1.1" 500 141042

Are there any examples using python-social-auth with django-oauth-toolkit? Does anyone know what might be causing this error?

All the Best,

Alan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions