Open nbro10 opened 10 months ago
Yes , you are right. We can add description for this, And other method.
@MerleLiuKun I think this method should also provide the possibility to generate the user access token given the authorization code or maybe there should be another method for that case.
Here, the response
parameter is unclear to me. The docstrings says The redirect response url for authorize redirect
, but this is a bit unclear to me. Where would we get this URL if usually what you get is an authorization code, when the user gives you permission? I suppose you would need to build this URL. Can you clarify what response
is here?
the reponse is a url, it is generated by facebook.
When you generate a ouath url to let user operate. After user give permisson, Facebook will direct to the redirect url you have pointed at oauth url.
The direct url is the reponse
@MerleLiuKun Alright, but isn't this URL just the redirect URI that you pass to api.get_authorization_url
with the authorization code and the state? In that case, one can automatically build the this URL from what api.get_authorization_url
returns. In my case, I actually get only the authorization code and the URL is in the browser, so I'd need to copy either the browser's URL or copy the authorization code and then build the URL. That's why I think this method should also accept the authorization code and state and be able to do the same job. Anyway, this parameter response
should be renamed to something like redirect_url
.
Yes you are right. But we think this is facebook's reponse. just style is a url
but when we pass response url to exchange_user_access_token they gives encode error
response_url = request.build_absolute_uri()
print("RESPONSE URL:", response_url)
access_token = API.exchange_user_access_token(
response=response_url, redirect_uri=FREDIRECT_URL
)
error:'OAuth2Token' object has no attribute 'encode'
Could you give more information? I have not seen this error.
Currently,
So, we have only a description of the parameters. This a public method, so it should have a description