FusionAuth / fusionauth-python-client

FusionAuth Python Client
https://fusionauth.io
Apache License 2.0
24 stars 12 forks source link

Function client_response.was_successful() return False instead of True #7

Closed mao75 closed 3 years ago

mao75 commented 3 years ago

Hi. With this code: client_response = client.exchange_o_auth_code_for_access_token(authCode,redirectURL,applicationID,clientSecret) the value of client_response.was_successful() is True with version 1.18.0, but with 1.19.0 the returned value is False. In the last case the error_response was: <Response [401]>

mooreds commented 3 years ago

Hiya,

I was able to login, however, the order of the arguments has changed to be more consistent with other libraries.

You can see some discussion about this issue here: https://fusionauth.io/community/forum/topic/311/trouble-getting-the-user-object-post-login/13

In particular, here's the order of parameters for that function:

 resp = client.exchange_o_auth_code_for_access_token(request.args.get("code"), client_id, "http://localhost:5000/oauth-callback", client_secret)

You can see there that the applicationID is before the redirectURL.

Can you please try that and see if it addresses the issue?

mao75 commented 3 years ago

Hi! :) Yes, the problem is (was...) the parameters order.

I wasted some time to understand that the problem was the version, but I didn't think (nor had I found in the documentation) that the order of the parameters had been changed. :( anyway it's ok!

thx

mooreds commented 3 years ago

Yes, I agree we need to update the documentation. I have opened a PR for this: https://github.com/FusionAuth/fusionauth-site/pull/214

I'm glad you solved the issue. I'll close this out.