akirk / enable-mastodon-apps

Allow accessing your WordPress blog with Mastodon clients
https://wordpress.org/plugins/enable-mastodon-apps
GNU General Public License v2.0
34 stars 5 forks source link

Seeking a debug strategy for using Mastodon clients with a self-hosted WP #161

Open teledyn opened 1 month ago

teledyn commented 1 month ago

I apologize in advance for this not being a bug and possibly not even anything to do with this software, but I haven't found anything relevant to the error message online and thought I might appeal to the folks who know what actually happens when a Fediverse client tries to login to a federated WP. If there is a better forum to ask, please let me know.

I have two WP installations that have the ActivityPub, Friends and Mastodon-support plugins, both are WP 6.5 (I updated one to 6.6 but it didn't help) and I don't think this has anything to do with the WP or the plugins, but I'm at a loss to find either a fix or even some way to trace what is happening. One site is hosted professionally, and I can login using Fedilab (but not Mastodon or Moshidon), but on the other, hosted on an rpi4B on my desk (so behind my router forwarding ports 443 and 80) gives the error: Unable to get client ID!

I am able to see accounts on both sites, I can follow and comment from another Fediverse account, I just can't use a Mastodon client to login to the self-hosted version.

The problem is likely my odd setup. I have a static site, radio.teledyn.com, but WP is installed on the /blog path, so there are the .well-known Apache2 redirects in .htaccess:

RedirectMatch "^\/\.well-known/(webfinger|nodeinfo|x-nodeinfo2)(.*)$" /blog/.well-known/$1$2 RedirectMatch "^\/api/(.*)$" /blog/api/$1 I added that API match in hopes it would help. It didn't, although it did stop the 404 errors on POST /api/v1/apps

So I suppose my question really is "What is a client ID, and how can I test where it went?"

akirk commented 1 month ago

I think for such a case my https://akirk.github.io/mastodon-api-tester/ can be helpful. It gives you insight into the communication a Mastodon client would do with your blog.

Maybe the log can give you insight? Also happy to help here if you could provide logs of a failed attempt.

marrie commented 2 weeks ago

I'm also having issues. I click "authorize" and I can't enter the authorization code in the app I'm trying to let in, in fact the page just appears to freeze on the authorize screen. My wordpress is hosted through YuNoHost I can't even get the tester optio towork, it looks like this is being blocked. I've uploaded my debug log gathered when I used the app. mastodon-api-tester-log_2024-8-22_12-43-9.txt Wordpress is up to date and all plugins appear to be up to date as of this morning. Thanks.

akirk commented 2 weeks ago

Hi @marrie, I tried to log in to your host (of course to arrive at your login page) and what stuck out to me that you're being redirected to the yuno host login instead of the standard WordPress login.

I am confused by you mentioning an authorization code, you don't need to enter one in an app. Do you ever arrive at a screen like this?

Screenshot 2024-02-14 at 14 40 46