#wordpress 2020-09-05

2020-09-05 UTC
JohnBeales, [Murray] and pschmehl joined the channel
#
pschmehl
pschmehl
#
pschmehl
Is this the right channel to discuss an issue with Wordpress and the IndieAuth plugin?
#
GWG
Yes
#
GWG
I hope we have an answer
#
pschmehl
OK. I'm trying to setup Threadreader so it can post to my Wordpress blog.
#
GWG
Okay
#
pschmehl
I run the latest version of Wordpress and the plugins (MicroPub and IndieAuth).
#
GWG
okay
#
pschmehl
When I test using the IndieWeb test link, I get prompted for a login and I login successfully.
#
pschmehl
But, when I attempt to use Threadreader to do the same thing, it fails.
#
GWG
Which test Link?
#
pschmehl
Just a sec
[chrisaldrich] joined the channel
#
pschmehl
I put a lot of details here:
#
pschmehl
If you go here and scroll down, you'll see a form to test your login: https://indieauth.com
#
pschmehl
When I type in my blog address there (https://www.txantimedia.com/) I get prompted for a login, and the login is successful.
#
pschmehl
When I attempt to do the same at the threadreader site (https://threadreaderapp.com/account/author) (I don't know if you can see that without logging in first)
#
pschmehl
I get this error message: {“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method”,”data”:{“status”:404}}
#
pschmehl
I'm not a programmer, so I don't understand a lot about REST and the API.
#
pschmehl
I've done a bunch of searching on the web, but haven't figured out yet what's wrong.
#
GWG
Well, IndieAuth uses the rest API system to implement authentication
#
pschmehl
OK
#
GWG
But not the REST API itself.
#
pschmehl
Let me show you the http access log entries for IndieAuth and then Threadreader
#
GWG
I haven't tried thread reader but I know it worked for several people with the tools. That rest no route found is concerning
#
GWG
Please
#
GWG
I also might ask you to try some things
#
pschmehl
IndieAuth: “POST /wp-login.php?client_id=https%3A%2F%2Findieauth.com%2F&redirect_uri=https%3A%2F%2Findieauth.com%2Fauth%2Find ieauth%2Fredirect&state=0fa997183894c018d5ee8bf97e0d04b3&me=https%3A%2F%2Fwww.tx antimedia.com%2F&response_type=id&action=indieauth HTTP/1.1” 302 – “POST /index.php?rest_route=/indieauth/1.0/auth HTTP/1.1” 200 40
#
pschmehl
The first thing I noticed was that the IndieAuth login uses POST but the Threadreader system uses GET. I don't know if that's a problem or not.
#
pschmehl
I'll be happy to try anything you suggest. I have root access to the server, so getting log entires or other stuff is not a problem.
#
GWG
So, you don't do pretty permalinks on your site? That shouldn't be an issue, but just confirming
#
pschmehl
Another thing I noticed is when I go to https://www.txantimedia.com/wp-json/ , I get a 404. That is not the case on a different server that I'm running Wordpress on.
#
GWG
That's this question
#
GWG
You aren't creating that link. Without it, it uses ?rest_route= instead
#
GWG
It's a setting in WordPress under Settings->Permalinks.
#
GWG
You have it set to Plain.
#
GWG
If you changed it to one of the other options, wp-json would work
#
GWG
But, that shouldn't be an issue, though I do want to check. I'm not sure if it's been tested without it.
#
pschmehl
Yes. It is set to Plain. I just checked.
#
GWG
Yes. Is that intentional?
#
pschmehl
Yes, but it's not a problem to change it. I just happen to like short links without the entire title in it.
#
GWG
Can you set it to numeric then?
#
pschmehl
If I have to change that to get this to work, I will.
#
GWG
Not permanently, I just want to rule it out
#
pschmehl
OK. I'll try that now.
#
GWG
Numeric will give you /123 instead of /p=123
#
GWG
I'm going to check a few things.
#
pschmehl
Changing to numeric sends me to an error page instead of the error message that I posted earlier. (IOW, 404)
#
GWG
So, even with that, the wp-json URL isn't working. So something is misconfigured there.
#
GWG
So, regardless, this is a server configuration issue on rewriting URLs, which might explain the problem
#
GWG
At the least, probably worth fixing for other reasons
#
pschmehl
OK. What sort of configuration problem?
#
GWG
Well, generally, rewriting URLs.
#
GWG
Is this Apache or Nginx running the server?
#
GWG
Okay. Just checked. Apache
#
pschmehl
Apache on FreeBSD - just to clarify, the wp-json link throws a 404 with plain and with numeric
#
GWG
Yes
#
GWG
It will
#
GWG
Something about how the configuration is set up isn't rewriting things.
#
GWG
I'm not sure precisely how it is configured, but let me see if there is an article I can link to
#
pschmehl
Could it be something in the .htaccess file for Wordpress? (I'll go read that article now.)
#
GWG
It talks about configuring Apache to allow URL Rewrites
#
pschmehl
I see that now. Let me take a look.
#
GWG
Also, I'd like you to try another client just to cover that, regardless of this issue, as I don't know why it wouldn't work regardless.
#
pschmehl
# grep rewrite_module /usr/local/etc/apache24/httpd.conf LoadModule rewrite_module libexec/apache24/mod_rewrite.so
#
pschmehl
I'm using Safari on a Mac. Just tested with Chrome - (wp-json) - 404, same thing with Epic, and TorBrowser - at least it's consistent
#
GWG
If you changed the permalink back, it won't regardless
#
GWG
Plain will use /?rest_route= instead
#
GWG
That shouldn't hurt anything, but I'm not sure if Threadreader has an issue with it
#
GWG
Can you try the following Micropub client to see how it does? You can revoke it after. https://quill.p3k.io
#
GWG
It's the reference implementation of Micropub
#
GWG
For the permalink issue, you might need the .htaccess file identified in the article.
#
GWG
In the meantime, I'm going to go see if no permalinks works on my test site
#
pschmehl
Below is the raw response from your token endpoint (https://www.txantimedia.com/index.php?rest_route=/indieauth/1.0/token): { "access_token": "HdkUM37NFJ8hfU78UYcWzfvavzPTkLgCIv0QykJ3WRGuyY6UQKmoUg3J6O2up1F2XyQ232YV0kJb02N6j9VPKlZSARoA2UTNBNjHWDnge1epm9PG6EgxH8m0T61qwWnM", "token_type": "Bearer", "scope": "create update media", "me": "https://www.txantimedia.com/", "profile": { "type": "card", "name":
#
pschmehl
"txantimedia", "url": "https://www.txantimedia.com/?author=5", "photo": "https://secure.gravatar.com/avatar/05ee63c88a433a76d84bb6df97c45bf3?s=125&d=404&r=pg" } }
#
pschmehl
Quil worked.
#
GWG
Since you just posted a token to access your website, would suggest you click the revoke button
#
pschmehl
Sure. Here's the results: https://www.txantimedia.com/?p=3121
#
Loqi
[txantimedia] testing 1,2,3 Share this: Share Twitter Facebook Pinterest Reddit LinkedIn WhatsApp Telegram Pocket Skype Email Tumblr Print Like this: Like Loading... Related
#
GWG
So, it's some interaction between the Threadreader implementation and this.
[chrisaldrich]1 joined the channel
#
GWG
The POST and GET issue you identified isn't the issue. They are different stages of the process. It does a GET then a POST
#
pschmehl
That's exactly what I thought, but Threadreader support seems to think everything on their end is fine.
#
pschmehl
BTW, I revoked Quil.
#
pschmehl
Just in case some fool is reading this chart and decides to be a smartass
#
GWG
My thought was they might not have considered a query string as the endpoint. ?rest_route= instead of wp-json/
#
GWG
And they are constructing their URL incorrectly
#
GWG
We had that problem a while ago when the micropub endpoint used to be ?micropub=endpoint
#
pschmehl
I'm not sure I understand what you mean by ?rest_route= instead of wp-json/
#
GWG
Okay.
#
GWG
So, without the permalink support I asked about, the address of the IndieAuth endpoint on your site is /?rest_route=/indieauth/1.0/auth
#
GWG
The IndieAuth authentication process uses a query string... ?redirect_url=__&state=____ etc
#
GWG
So, if it tries to add that to the end of the one you use, it would have two ? in it, which is an invalid URL
#
pschmehl
So, why is Threadreader calling index.php instead of wp_login.php?
#
GWG
Again, different stages in the process.
#
GWG
The first step is a GET request, which takes you to your site. Then, you authorize it, which is a POST request, qwhich then redirects you back
#
pschmehl
So, referring back to your question mark comment, this appears to be wrong: “GET /index.php?rest_route=/indieauth/1.0/auth?
#
GWG
Yes.
#
GWG
When your endpoint is a query string to begin with, after the auth it should be &, not ?
#
GWG
So, the issue is that Thread Reader's implementation isn't taking that into account
#
GWG
If I'm right
#
GWG
Which I admit I might not be
#
GWG
But if you see in your logs two ? in the GET URL, that would explain it
#
GWG
And I see when I scroll up you do
#
GWG
So, two possible solutions
#
pschmehl
OK. Is this chat logged somehow so I can send a link to Threadreader? If not, I can just copy the whole thing and paste it into a text doc.
#
GWG
1. Fix the permalinks so they don't have a query string. The way I suggested
#
pschmehl
The numeric?
#
GWG
2. Report it to Thread Reader that they aren't building the URL correctly for when there it is a query string
#
GWG
pschmehl: Correct. IF you can access wp-json, then it will work without them fixing their code
#
GWG
Of course, it is a bug on their part, so worth fixing
#
pschmehl
Thanks. You've been a huge help.
#
GWG
You can tell them this. "My IndieAuth endpoint is a query string. And you are appending another query string to it, which is why it isn't working"
#
GWG
Now, I'm not sure what language the code is written in, but it should be a simple fix
#
GWG
pschmehl: Hope it works out regardless
#
pschmehl
I'll get it figured out sooner or later. If there's one thing I am, it's persistent. :-)
#
GWG
pschmehl: Tell me if there is anything else we can do...always trying to improve the WordPress Micropub and IndieAuth implementations
[chrisaldrich], nickodd, [tw2113], JohnBeales, [James_Gallaghe], [LewisCowles], [Murray], [Chaitanya] and [jgmac1106] joined the channel
#
GWG
Working on Kind_Post, the optimized, simplified, and improved replacement for MF2_Post
#
GWG
It may break a few templates
[tantek], [fluffy], [Rose] and JohnBeales joined the channel; nickodd left the channel