Skip to content
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

How to implement login with Twitter #377

Open
regyeduardo opened this issue Jul 5, 2022 · 1 comment
Open

How to implement login with Twitter #377

regyeduardo opened this issue Jul 5, 2022 · 1 comment

Comments

@regyeduardo
Copy link

regyeduardo commented Jul 5, 2022

First of all I request this endpoint (http://localhost:8000/auth/o/twitter/?redirect_uri=http://127.0.0.1:8000/complete/twitter) to get the login url.

After complete login, it returns redirect_state, oauth_token and auth_verifier codes.

What I do with these paramets? For exemple, Google and Facebook needs "code" and "state" parameters. And I don't know to handle with redirect_state, oauth_token and auth_verifier!

@tiago-peres
Copy link

I reckon by now you fixed this?

Assuming you have in your URL entries something like url('sso', include('social_django.urls', namespace='social')), you can get the login url just with

<a href="{% url "social:begin" "twitter" %}">`.

Then, if you set your LOGIN_REDIRECT_URL in settings.py to something like

LOGIN_REDIRECT_URL = 'home'

after logging in to Twitter you should be redirected right away to the home.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants