KartikTalwar/Duolingo

3rd Party Login

Antwohlf opened this issue · 5 comments

Is it possible to log in via a 3rd party provider with this API (Facebook or Google being examples)? I have been receiving "login failed" errors but verified the login works on the website.

As far as I know, it's not possible, what exactly are you trying to do? Simply submitting your Facebook/Google credentials won't work, the authentication has to take place in browser. After that you can use a JWT in this library.

I apologize, I see now that this is a duplicate of #84

Thank you!

Just to clarify, this should be as simple as
lingo = duolingo.Duolingo('username', jwt='token.from.browser')
correct?

I'm still getting

 raise DuolingoException("Login failed")
duolingo.DuolingoException: Login failed 

errors with the token from a logged in browser. I've also tried specifying password and session_file as None in the duolingo constructor with the same result.

@Antwohlf I'm afraid there is an issue with library implementation.

The URL in this line:

return "https://duolingo.com/users/%s" % self.username

has to be

return https://www.duolingo.com/users/%s" % self.username 

Otherwise it returns a HTTP 302 and redirects in which case authorisation fails.

@Antwohlf I'm afraid there is an issue with library implementation.

The URL in this line:

return "https://duolingo.com/users/%s" % self.username

has to be

return https://www.duolingo.com/users/%s" % self.username 

Otherwise it returns a HTTP 302 and redirects in which case authorisation fails.

Just to highlight for others, the difference here is there is a "www." in front of Duolingo.com vs just https://duolingo.com...