简体   繁体   中英

Yahoo social login not working django-allauth

I'm trying to implement Yahoo Social Login, using django-allauth, I've so far been able to successfully do this with google, and I believe also with Facebook and Amazon, however, those require HTTPS to work, and my localhost server is using HTTP, so I'll only find out once I host it online, if anyone could help me test on localhost, that would be great also, but the main issue is that when I sign in to Yahoo, I get an error message on the yahoo page saying

Uh-oh!

Looks as if something went wrong.

Please try again later.

Then underneath it says

Developers: Please specify a valid request and submit again.

Having searched on the web, I have reason to believe that is because of yahoo getting an invalid URL request, here is a link to That question

Here is the link that I have in the URL bar when I try to sign in

https://api.login.yahoo.com/oauth2/request_auth_fe?client_id=dj0yJmk9OWE0Y1JZQ2NMZ3dOJmQ9WVdrOVIyNVdRMHhWWVVnbWNHbzlNQT09JnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PWM5&redirect_uri=http%3A%2F%2F127.0.0.1%3A8000%2Faccounts%2Fyahoo%2Flogin%2Fcallback%2F&scope=sdps-r&response_type=code&state=W9uBoxwTCi66

Anyway, even if this is the cause, I do not know how to fix it, and can find no such solution, can somebody help me please,

Thank you very much.

Yahoo won't use http as a callback, so you should add https to your local environment. To do so you'll have to:

  1. create some locally trusted development certificates
  2. set your development server to look for them when you run it

As an example, if you're running gunicorn locally to mimic production, you can create local certs using mkcert and then point gunicorn to them when you start the server by adding --certfile FILE and --keyfile FILE as described under the SSL section in gunicorn .

One additional note: in addition to not accepting http in the callback uri, Yahoo may not allow it to be 127.0.0.1:8000 even if secured, so you may need to make up a domain and set your computer to point it to 127.0.0.1 in the hosts file as described here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM