Hey @orenwolf, Iâm sorry to hear youâre still having an issue. Could you confirm that the users youâre expecting to be publishing under their own name have a Discourse Username
in their Wordpress profile?
Generally guys, thanks for your patience on this. On my own testing on various sites (and in the pluginâs own unit tests), the Discourse Username
feature is now functioning as expected on 2.3.9
. If youâre still having an issue please confirm youâre on the latest version of the plugin and that the user youâre expecting to be the author of the post has a Discourse Username
.
You might be wondering why this issue arose at all. I think itâll be helpful if I give a bit of background (which will also answer your question @itsbhanusharma). Previously, the way this feature worked is that it used different users in the Api-Username
header (see here). The reason this was seen as necessary was because the relevant endpoint in Discourse does not support setting a creator of the post different from the user performing the API request.
The upshot of this was that the only way this feature would work is if you have a âAll Usersâ API key with a âGlobalâ scope. Iâll just note that for some time the standard instructions for creating an API key for the WP Discourse plugin are as follows
If you havenât yet created an API key, Click âNew API Keyâ, set User Level to âSingle Userâ, set âUserâ to an admin account, select âGlobal Keyâ and click âSaveâ. Copy and paste the API key here.
Following these instructions would mean that this (undocumented) feature would not work, and it has caused issues for various sites.
Moreover, for various security reasons, Iâve progressively been making changes to the plugin to allow for much more specific API keys to be used. This will require a change to Discourse, and (when it gets merged) will allow plugin admins to issue themselves a new, much more limited, API key. Iâll be making an announcement about that when the time comes.
https://github.com/discourse/discourse/pull/15366
Yes @itsbhanusharma the way the feature now works is by making a second request to change the owner of the post after it is created (if a Discourse Username
is present). That is actually currently the only proper way to arbitrarily set the owner of a post via the Discourse API (without needing to use the Api-Username and an All Users Global Key in the way described above). Considering the type of operation this is, this should not be a performance concern.