Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect any client to Wordpress #43

Closed
StarrWulfe opened this issue Oct 18, 2023 · 25 comments · Fixed by indieweb/wordpress-indieauth#263 or #65
Closed

Cannot connect any client to Wordpress #43

StarrWulfe opened this issue Oct 18, 2023 · 25 comments · Fixed by indieweb/wordpress-indieauth#263 or #65

Comments

@StarrWulfe
Copy link

StarrWulfe commented Oct 18, 2023

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
Copy link

vishae commented Oct 23, 2023

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
Copy link
Author

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
Copy link

veeyawn commented Nov 9, 2023

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

@veeyawn
Copy link

veeyawn commented Jan 11, 2024

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

@akirk
Copy link
Owner

akirk commented Jan 12, 2024

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
Copy link

vishae commented Jan 12, 2024

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
Copy link
Owner

akirk commented Jan 12, 2024

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
Copy link

vishae commented Jan 12, 2024

@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
Copy link
Owner

akirk commented Jan 12, 2024

@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
Copy link

veeyawn commented Jan 12, 2024

@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
Copy link
Owner

akirk commented Jan 12, 2024

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
Copy link
Owner

akirk commented Jan 12, 2024

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
Copy link
Owner

akirk commented Jan 12, 2024

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

@veeyawn
Copy link

veeyawn commented Jan 12, 2024 via email

@akirk
Copy link
Owner

akirk commented Jan 12, 2024

I submitted a patch on the IndieAuth plugin to fix this: indieweb/wordpress-indieauth#263

@veeyawn
Copy link

veeyawn commented Jan 12, 2024 via email

@pfefferle
Copy link
Collaborator

I just released the fix of @akirk

Thanks for the fix!

@StarrWulfe
Copy link
Author

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

@vishae
Copy link

vishae commented Jan 13, 2024

@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
Copy link

vishae commented Jan 13, 2024

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
Copy link
Owner

akirk commented Jan 13, 2024

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
Copy link
Owner

akirk commented Jan 14, 2024

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

@vishae
Copy link

vishae commented Jan 14, 2024

@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
Copy link

vishae commented Jan 15, 2024

@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
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants