wordpress-micropub icon indicating copy to clipboard operation
wordpress-micropub copied to clipboard

Bug: Posting from Omnibear with IndieAuth fails.

Open miklb opened this issue 6 years ago • 12 comments

Using master of WP Indieauth & micropub plugins, attempting to post from Omnibear results in 2 errors

PHP Warning:  in_array() expects parameter 2 to be array, null given in /plugins/micropub/micropub.php on line 265
 

PHP Warning:  in_array() expects parameter 2 to be array, null given in /plugins/micropub/micropub.php on line 268

I recall changes to these two lines in another issue, but do not recall where that issue was (maybe Indieauth plugin?)

Omnibear reports failure to authenticate with micropub endpoint.

miklb avatar Jun 15 '18 17:06 miklb

This is interestingly telling. This suggests that somehow, the scope information isn't making it from IndieAuth into Micropub. But why would it on some sites and not on others.

dshanske avatar Jun 15 '18 19:06 dshanske

It's also strange that it would occur for Omnibear, but not some other MP clients like Quill…?

keithjgrant avatar Jun 15 '18 19:06 keithjgrant

Is Omnibear requesting scopes differently when authenticating to the auth endpoint?

keithjgrant avatar Jun 15 '18 19:06 keithjgrant

At the very least, we should initialize the variables before use.

@keithjgrant What scopes does Omnibear request?

dshanske avatar Jun 15 '18 19:06 dshanske

Hm... Skimming the code (albeit on phone, so I could be missing something) it doesn't look like Omnibear specifies. That could be the issue, depending whether different auth services fallback to all scopes by default, or null set...?

keithjgrant avatar Jun 16 '18 00:06 keithjgrant

We don't fallback.

dshanske avatar Jun 16 '18 00:06 dshanske

https://indieauth.spec.indieweb.org/#authorization-request - I'd better go check my code on the IndieAuth plugin.

dshanske avatar Jun 16 '18 00:06 dshanske

I was misremembering. We do. https://github.com/indieweb/wordpress-indieauth/blob/948165cb30f211eaf416b69996ee0e43d8ada666/includes/class-indieauth-authorization-endpoint.php#L86

dshanske avatar Jun 16 '18 00:06 dshanske

This is not related to the Semantic Linkbacks problem.

dshanske avatar Jun 16 '18 16:06 dshanske

POST /?micropub=endpoint HTTP/1.1" 403 76 "-"
POST /?micropub=endpoint HTTP/1.1" 201 12 "-" "-"

Top is Omnibear, bottom is Quill in my access logs. Not sure jf anything useful there, but documenting nonetheless.

miklb avatar Jun 18 '18 05:06 miklb

I’m running latest plugin releases. Attempted reacji w/Omnibear in firefox

webserver-wordpress_1 | 2018/07/17 06:06:48 [notice] 5#5: *6382 "^/.well-known/(host-meta|webfinger).*" does not match "/index.php", client: 71.212.132.198, server: dougbeal.com, request: "POST /?micropub=endpoint HTTP/1.1", host: "dougbeal.com" [17-Jul-2018 06:06:48 UTC] Micropub Data: {"micropub":"endpoint"} {"type":["h-entry"],"properties":{"content":["\ud83d\udc94"],"in-reply-to":["https:\/\/www.instagram.com\/p\/BlUNv51FerF\/"]}} [17-Jul-2018 06:06:49 UTC] PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/micropub/micropub.php on line 265 [17-Jul-2018 06:06:49 UTC] PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/micropub/micropub.php on line 268 wordpress_1 | 172.18.0.4 - 17/Jul/2018:06:06:48 +0000 "POST /index.php" 403 webserver-wordpress_1 | 71.212.132.198 - - [17/Jul/2018:06:06:49 +0000] "POST /?micropub=endpoint HTTP/1.1" 403 98 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:61.0) Gecko/20100101 Firefox/61.0" "-"

(Originally published at: https://crw.moe/b/Xg)

dougbeal avatar Jul 17 '18 06:07 dougbeal

This has been determined to be a problem with cookie authentication preventing the token authentication from being used. Solution at this time is to log out of the site on the browser you are using to post.

dshanske avatar Aug 25 '18 03:08 dshanske