WordPress Callback fails #6676
WordPress Callback fails #6676
Comments
Hi, I have the exact same issue on my pod (freehuman.fr) when I try to link my profile to my WordPress.com account. However my error number is 500, not 505. |
@gabsoftware could you please post the corresponding log? |
@Flaburgan
|
I have the same issue. I'm not sure when it appeared, but it was sometime between V0.5.5.1 and now. Mine was working, but sometime in that time period/update period it stopped working. I'm getting the same "Invalid authorization_code" error. |
@gabsoftware I see no 500 in the log you posted, this is not the corresponding logs. |
… |
Well is there another log than the production log then? |
@gabsoftware I just didn't know the error 500 page could be displayed without a "Completed 500" in the logs. Looks like I was wrong, sorry ;) |
@Flaburgan That's only the case if we actually result the 500 ourselves (i.e. return a response with status: 500). If the request gets interrupted by an exception we don't handle, the request is technically never completed. |
So here is what I've discovered. Exception is raised from the request method of the OAuth2 client which in its turn is called from the get_token method.
{:raise_errors=>true, :parse=>:json, :body=>{"grant_type"=>"authorization_code", "code"=>"***", "client_id"=>"**", "client_secret"=>"****", :redirect_uri=>"http://development.diaspora.local/auth/wordpress/callback?code=***&state=****"}, :headers=>{"Content-Type"=>"application/x-www-form-urlencoded"}} The request is POSTed to the {"error"=>"invalid_grant", "error_description"=>"Invalid authorization_code."} This response raises an exception from this point. I can't clearly say what it means right now. |
Is this a blog on wordpress.com or a self-hosted one? Have you checked the credentials and the return url in the application preferences? Is this reproducible with a non-local pod? Could be they are blocking domains they cannot resolve. |
@cmrd-senya Did you solve that problem? {"error"=>"invalid_grant", "error_description"=>"Invalid authorization_code."} |
I didn't have a chance to test on a non-local pod yet. I'll retest it as soon as possible, if nobody fix it before. |
Just out of curiosity, has anyone been able to make any progress on this error? I've been seeing it on my Pod as well and have not made any headway. |
I had the same issue with this. The solution was to make sure that the 'redirect_uri' parameter is the same between subsequent calls to the authorization method. When the 'redirect_uri' is passed to the https://public-api.wordpress.com/oauth2/authorize endpoint, it should be URL encoded. In my case, when I got this error, both were URL encoded. Sending the normal URL to the second call solved this issue for me. Hope this helps. Regards, |
@sfatfarma do you have a patch for that or this is only a configuration issue? |
@piraz To be honest, I stumbled upon this error in the code I wrote (I am not using Diaspora). I found this threat only when I was browsing to find a fix for the issue from my code. I made the fix directly in my code. |
Hi all - new pod owner here and this bug lives on in 0.7.3.1. I'd be happy to help diagnose from an admin standpoint as best as I can. It's completely reproducible here.
|
The same (as @realkinetix described it before) here in version 0.7.11.0. I'd be willing as well debugging this to get it fixed... |
I have several users contacting me about this issue. I just wanted to add it is still there and still blocks people. |
Given that this thing is in a broken state and nobody felt like fixing it for four years, I have sincere doubts this will be addressed at all. It’s probably worth for someone interested in this to look into the API and build something based on that. |
Hi,
I registered successfully our diaspora pod as a wordpress app, but after the user authenticates it, the callback fails with 505 (yeah, I set it correctly to https://[pod.domain.tld]/auth/wordpress/callback ).
any help is appreciated,
hk
The text was updated successfully, but these errors were encountered: