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

Twitter login not working #164

Closed
alechamed opened this issue Jun 13, 2018 · 22 comments
Closed

Twitter login not working #164

alechamed opened this issue Jun 13, 2018 · 22 comments

Comments

@alechamed
Copy link

Twitter change the callback policy, now when I try to login my callback "oauth/complete/twitter/" not work and twitter return error 403:

`

Request Method: GET
https://homely-dev.herokuapp.com/en/oauth/login/twitter/
1.11.10
HTTPError
403 Client Error: Forbidden for url: https://api.twitter.com/oauth/request_token
/app/.heroku/python/lib/python2.7/site-packages/requests/models.py in raise_for_status, line 935
/app/.heroku/python/bin/python
2.7.14
['/app', '/app/.heroku/python/bin', '/app', '/app/.heroku/python/lib/python27.zip', '/app/.heroku/python/lib/python2.7', '/app/.heroku/python/lib/python2.7/plat-linux2', '/app/.heroku/python/lib/python2.7/lib-tk', '/app/.heroku/python/lib/python2.7/lib-old', '/app/.heroku/python/lib/python2.7/lib-dynload', '/app/.heroku/python/lib/python2.7/site-packages']
Wed, 13 Jun 2018 12:14:52 +0200

`

@matthewdeanmartin
Copy link

matthewdeanmartin commented Jun 13, 2018

I'm getting same, haven't solved, but maybe related to this- python-social-auth/social-core#249

Twitter now requiring a valid call back URL & maybe didn't before June 12

@DavidToca
Copy link

DavidToca commented Jun 13, 2018

I had the same issue and I did solve it by adding

https://mydomain.com/complete/twitter/

to the valid callback url on the twitter app config at https://apps.twitter.com/

@kaleissin
Copy link

I've tried the same but no luck, still get the same error.

@megavenik
Copy link

@DavidToca hi! could you please tell us, where exactly in your project did you configured the callback url for twitter and how? Thanks a lot!

@pydolan
Copy link

pydolan commented Jun 15, 2018

If @DavidToca's solution isn't working for you, double check that your URL matches exactly what it used. For instance, have "http" or "https" correct, and whether "www" is there or not.

@johnclaro
Copy link

johnclaro commented Jun 16, 2018

I had this issue and updated my app settings to have something like these. Note the forward slashes

http://mydomain.com/complete/twitter/
http://www.mydomain.com/complete/twitter/

You can update the app settings in https://apps.twitter.com

@gera-rivero
Copy link

Same issue, changes made but without luck, i still have the 403 Client Error. Is there some other workaround?

@kiruto
Copy link

kiruto commented Jun 18, 2018

Twitter has used the white list since a week ago.
So if you engaged this problem, you may update your callback url (here)[https://apps.twitter.com/].

@henpin
Copy link

henpin commented Jun 19, 2018

I had the same issue and I have resolved by adding callback urls like

http://localhost:8000/auth/complete/twitter/

i had set "auth" to urls.py for login.

@saa14
Copy link

saa14 commented Jun 23, 2018

Has anyone come up with a solution other than the ones mentioned above?

@arjunthakur08
Copy link

Upgrade the following packages to the latest version using pip:

social-auth-app-django
social-auth-core

Steps to follow:

1. Login to you Twitter account
2. Go to https://apps.twitter.com/, and select your application.
3. Select the Settings Tab in the application to configure the Callback URL
4. In the Callback URLs input box, add the following according to the nature of request made:
If it is http, without SSL certificate, then add the following:

http://example.com/complete/twitter/
or
http://www.example.com/complete/twitter/

If it is https i.e. it supports SSL certificate (recommended), then add the following:

https://example.com/complete/twitter/
or
https://www.example.com/complete/twiiter/

Note:
1. Make sure the slash( / ) after the twitter is there in the Callback URLs input box
2. Also, replace "example.com" or "www.example.com" with your domain name.

@monomoti
Copy link

The solution above (adding correct callback to the white list) should work.
But for me, It didn't work until I found that both "Consumer Key (API Key)" and "Consumer Secret (API Secret)" had been changed. I don't know why.
So I strongly recommend you to make sure your key and secret are correct.

@herawais
Copy link

The solution above (adding correct callback to the white list) should work.
But for me, It didn't work until I found that both "Consumer Key (API Key)" and "Consumer Secret (API Secret)" had been changed. I don't know why.
So I strongly recommend you to make sure your key and secret are correct.

Exactly. Thanks a lot

@alejandro-zapeta
Copy link

Upgrade the following packages to the latest version using pip:

social-auth-app-django
social-auth-core

Steps to follow:

1. Login to you Twitter account
2. Go to https://apps.twitter.com/, and select your application.
3. Select the Settings Tab in the application to configure the Callback URL
4. In the Callback URLs input box, add the following according to the nature of request made:
If it is http, without SSL certificate, then add the following:

http://example.com/complete/twitter/
or
http://www.example.com/complete/twitter/

If it is https i.e. it supports SSL certificate (recommended), then add the following:

https://example.com/complete/twitter/
or
https://www.example.com/complete/twiiter/

Note:
1. Make sure the slash( / ) after the twitter is there in the Callback URLs input box
2. Also, replace "example.com" or "www.example.com" with your domain name.

For me these works. I put 3 references in that box. and be careful with the last slash.

@TomaszKot11
Copy link

I needed to make sure I have '/' after the whole callback URL 😄

@hardik-dadhich
Copy link

hardik-dadhich commented May 29, 2020

Hi @henpin , Does http://localhost:8000/auth/complete/twitter/ works for you?
because I am using these callbacks but none of them is working!!
Callback URL

http://localhost:8000/oauth/complete/twitter/
http://localhost:8000/auth/complete/twitter/
http://localhost:8000/oauth/login/twitter/

Can you tell me where I am doing wrong?
I am using django-social-auth.

@alejandro-zapeta
Copy link

alejandro-zapeta commented May 29, 2020 via email

@ghost
Copy link

ghost commented Jul 2, 2020

The above redirect urls seems to be not working but the below ones did

https://mysite.com:8000/social-authcomplete/facebook/
https://mysite.com:8000/social-authcomplete/twitter/

@Kolaposki
Copy link

If you're running on localhost and you still get the error. Make sure the port you're running on matches the port you presented on Twitter CALLBACK URLS

Example
I'm running on port 9900 so this worked for me
http://127.0.0.1:9900/oauth/complete/twitter/

instead of
http://localhost:8000/oauth/complete/twitter/ or http://localhost:9900/oauth/complete/twitter/

@dharmendra-kotarya
Copy link

dharmendra-kotarya commented Jan 22, 2021

for social-auth-app-django
https://your_domain_name/social/complete/twitter/
it worked

@anjayluh
Copy link

I had this issue and updated my app settings to have something like these. Note the forward slashes

http://mydomain.com/complete/twitter/
http://www.mydomain.com/complete/twitter/

You can update the app settings in https://apps.twitter.com

Took me a night and a day to finally find this solution, thank you

@itod
Copy link

itod commented Oct 29, 2021

I was seeing this issue with one user (but not all) in production (not on a dev/localhost box). This fixed it: Tell the user to go to their Twitter settings and revoke your app's access (currently under: Settings > Security & Account Access > Apps & Sessions > Connected Apps). Then return to your site/app and login again. Worked.

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