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

Cannot connect any client to Wordpress #43

Closed StarrWulfe closed 7 months ago

StarrWulfe commented 10 months ago

Errors out of the following response shows:

{"error":"invalid_client","error_description":"No client id supplied"}

Other times it times out with: image

In all cases tokens are saved but never used.

Client: Ice Cubes, Tusker and official Mastodon app

vishae commented 10 months ago

I'm also getting the same error with Ice Cube: {"error":"invalid_client","error_description":"No client id supplied"}

I also have IndieWeb plugins installed on my Wordpress instance (eg. Micropub, Webmention etc.) Do they need to be removed?

StarrWulfe commented 10 months ago

Any progress? The latest release hasn't changed anything. All clients seem to pass a token but then drop it.

Screenshot 2023-11-05 at 2 02 40 PM

Meaning no client ever keeps the token.

veeyawn commented 10 months ago

I'm also seeing this with various apps I've tried. Elk, Phanpy, Fedilab...

veeyawn commented 8 months ago

Anyone had any more luck with the recent updates to the plugin? I'm still getting errors.

akirk commented 7 months ago

Hi everyone, sorry about this. It works for me. Would you be so kind and try https://akirk.github.io/mastodon-api-tester/ to connect to your WordPress site via the API? I hope it can reveal where things fail for you individually.

vishae commented 7 months ago

Hey @akirk I just tested the latest update to the plugin and it still doesn't work for me. I have used your link to connect my site, I hope that gives you useful info.

Edit: do I have to send you the logs, or do you have them already?

akirk commented 7 months ago

No, sorry, I don't see any logs, it's all client side. Were you able to connect and do you see that reflected in your Mastodon Apps settings?

vishae commented 7 months ago

@akirk Please find the log attached. mastodon-api-tester-log_2024-1-12_13-43-2.txt

The Mastodon Apps settings do show the Mastodon API Tester, but then it has always been able to show the other apps as well (eg. Ivory, IceCube), but the apps themselves can't connect to the WordPress site.

In the past, they showed the error message mentioned in the OP, but now it just silently fails. Screenshot below - that's the login screen for IceCube. After logging in and being taken to Wordpress to finalise authorisation, it just comes back to this login screen: no error message. Screenshot 2024-01-12 at 3 06 33 pm

akirk commented 7 months ago

@vishae thanks! Could you also click one of the endpoints in the Tester like /api/v1/accounts/verify_credentials or /api/v1/timelines/home to see if it works? No need to share the logs here. The verify credentials should show your user data and the home timeline some posts, both in JSON format.

veeyawn commented 7 months ago

@akirk thanks so much for helping sort this out (and writing the plugin to begin with). I also ran the test link you sent and log is here: mastodon-api-tester-log_2024-1-11_22-11-16.txt

I see the same results as @vishae where the Mastodon API Tester shows up with a token and as an application in my Mastodon Apps Settings but that has always been the case.

I then clicked on /api/v1/accounts/verify_credentials as you just suggested and here is the log from that: mastodon-api-tester-log_2024-1-11_22-15-53.txt

If I click on /api/v1/timelines/home I get the same message in the log "invalid access token"

Hope this helps!

V

akirk commented 7 months ago

Thank you, this is helpful! Looks like something is wrong with storing the access token for later use. I'll investigate a little later in my day today.

akirk commented 7 months ago

Could you check in the "Access Tokens" section that @StarrWulfe posted a screenshot of, when you hover over the app name, you should see the actual access token. Is it being displayed?

Screenshot 2024-01-12 at 14 25 03
akirk commented 7 months ago

After some more testing, I think it might be caused by the IndieAuth plugin, do you have that one installed and active?

veeyawn commented 7 months ago

I do have that one installed. Let me deactivate and test in a little bit.

On Fri, Jan 12, 2024, 05:30 Alex Kirk @.***> wrote:

After some more testing, I think it might be caused by the IndieAuth plugin, do you have that one installed and active?

— Reply to this email directly, view it on GitHub https://github.com/akirk/enable-mastodon-apps/issues/43#issuecomment-1889213252, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVLNIRZ4BAC3NT4KPVWVYTYOE3JFAVCNFSM6AAAAAA6EY72OWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBZGIYTGMRVGI . You are receiving this because you commented.Message ID: @.***>

akirk commented 7 months ago

I submitted a patch on the IndieAuth plugin to fix this: https://github.com/indieweb/wordpress-indieauth/pull/263

veeyawn commented 7 months ago

I disabled IndieAuth and just reconnected to my site with Phanpy and it works! Amazing! Thank you so much and double thanks for patching IndieAuth!

V

On Fri, Jan 12, 2024 at 7:30 AM Alex Kirk @.***> wrote:

I submitted a patch on the IndieAuth plugin to fix this: indieweb/wordpress-indieauth#263 https://github.com/indieweb/wordpress-indieauth/pull/263

— Reply to this email directly, view it on GitHub https://github.com/akirk/enable-mastodon-apps/issues/43#issuecomment-1889513828, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVLNIR5LV4WCXOG7H54UODYOFJKZAVCNFSM6AAAAAA6EY72OWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBZGUYTGOBSHA . You are receiving this because you commented.Message ID: @.***>

-- Vaughn social.vaughnhannon.com

pfefferle commented 7 months ago

I just released the fix of @akirk

Thanks for the fix!

StarrWulfe commented 7 months ago

Oh wow, glad my submissions could help with this one!

vishae commented 7 months ago

@akirk So I tried disabling Indieauth (before the update), and it did allow me to connect IceCube with my site. But IceCube wasn’t able to load any of my posts: IMG_8797

Using the API testers, it looks like everything is fine, but I'm not sure. mastodon-api-tester-log_2024-1-14_5-46-0.txt

As for the Indieauth update, it didn't seem to fix anything for me. After updating Indieauth and re-enabling it, I still get the invalid token when I try to authorise: mastodon-api-tester-log_2024-1-14_5-34-48.txt

vishae commented 7 months ago

Just thought I'd mention, IceCube is the only app that even seem to see my site as an instance. Ivor, Elk and Pinafore doesn't even allow me to try to authenticate.

IMG_8798

akirk commented 7 months ago

Interesting, according to your log, the POST /api/v1/apps returns the right JSON but the HTTP status is 401. I am not sure why. I can reproduce the non-functional response and will try to address this with a code change in this plugin. But I am unsure this will address that 401 in /api/v1/apps but let's try.

akirk commented 7 months ago

@vishae Could you update Enable Mastodon Apps to 0.6.4 which includes the above and try again? Thank you!

vishae commented 7 months ago

@akirk in trying to test this plugin I've somehow broken the indieweb-ness of my site (ie. when I try to use the Mastodon API tester, it says TypeError: undefined is not an object (evaluating 'response.headers'))

I'm trying to figure out what I've done (I just turned all my other plugins off to see if it was interfering with the Mastodon app and turned it back on) and see if I can fix it. Then I will try continuing testing the Enable Mastodon Apps plugin.

vishae commented 7 months ago

@akirk the Mastodon API tester isn't letting me authorise now: mastodon-api-tester-log_2024-1-15_20-14.txt

I can authorise using IceCube (but still can't see any posts, even when I post a new one)

pfefferle commented 7 months ago

@akirk I also had some issues with "old" tokens (already connected apps) these days and the solution was to remove all of the already created ones.