I run a multi-author wordpress blog. How can I get the posting to work without having to have all my authors create an account on discourse? Should I be using SSO with wordpress and discourse to solve this issue?
If you want authors to be able to publish posts under their own name on Discourse, they will need to create Discourse accounts. SSO is a good approach for this, but when SSO is enabled user will only be able to login to your forum through the WordPress site. This may not be what you want.
Another option would be to publish all posts from WordPress to Discourse under a single Discourse Username. If users leave their Discourse Username setting blank, posts will be published to Discourse by the Publishing Username you have set in the pluginâs Connection settings tab.
Interesting⊠As far as I can tell none of my authors have that set. When I look at the user profiles, I do not see the option for a discourse username setting. Where would I find that?
Additionally, I just noticed that Iâm using the following setting in the discourse wp plugin:
Removes the Discourse Name field from the WordPress user profile page.
Do Not Display Discourse Name Field - Unless SSO is enabled, this setting will cause all posts published to Discourse to be published by the 'Publishing Username.
Itâs my understanding that the above setting will force all posts to be posted to the user that has been defined as the posting user in the âPublishing Usernameâ setting.
What am I missing?
Thanks. I just realized that I had the Do Not Display Discourse Name Field set. Which should have forced all posts to the Posting Username.
Yeah, turn that off if you want them posted by the authorâs own Discourse username, which you will hopefully be able to set no problem. (Some themes, such as Extra, prevent the username from being edited by hiding it on the profile page.)
Edited to add: Now I see the title of this topic is an error number. Iâm not sure anything Iâve said will solve that.
Yes, this is how it is supposed to work. Are you able to publish posts with your account from WordPress to Discourse?
The most common cause of the 403
error when posts are published to Discourse is that the Discourse Username is set incorrectly. It might be worth disabling the âDo Not Display Discourse Name Fieldâ setting and having a look at the profile pages of some of your authors. Make sure that the Discourse Username field for the authors is empty. It is found in the Contact Info section of the userâs profile page.
We are going to be moving the Discourse Username out of the Contact Info section very soon, and also giving site admins the option to set the Discourse Username for their authors manually while hiding the setting from the authors. This is for security reasons - to ensure that people are using the correct Discourse Username on multi-author sites.
Okay. thatâs what I was expecting.
I was thinking that the issue was related to the usernames not matching, but thought when I enabled the âDo not display Discourse Name Fieldâ it would override everything.
I think the change you mentioned would be a really helpful.
I just tried posting with the option turned off, but got the same error.
After turning off the option, can you take a look at your profile page to make sure that the Discourse Username field is empty?
The discourse usernames are blank for all users.
When you go to the WP Discourse connection options tab, are you seeing a messge saying that âYou are connected to Discourseâ?
For the API Key and Publishing Username settings on the Connection options tab, are you using your Discourse forumâs All Users API Key? Is the Publishing Username set to the name of your siteâs system user? The default username for the system user is âsystemâ.
Yes. In the connection options tab Iâm seeing the message âYou are connected to Discourse.â
The API key is the all users and the publishing name is the admin of the discourse forum. The username is not the system user âsystemâ.
Could you try changing the username to âsystemâ (without the quotes) to see if that makes a difference?
I changed the username to system, but get the same error message.
âThere has been an error publishing this post to Discourse.â
Hereâs the details that show in the error email:
Reason for failure:
A 403 response code was returned from Discourse.
Forbidden
Check that:
- the author has correctly set their Discourse username
Does anyone have any other ideas on how to resolve this?
Only thing I can think of to try is to create a new api key and re enter everything.
okay⊠itâs very strange⊠Iâm using nodechef to host discourse⊠I wonder if itâs an issue with their build or server configuration. Thoughts?
I tried changing keyâs and still have the same issue.
Thanks for the details about your hosting. I should have asked about that. It is possible the issue is related to their hosting. It is not a problem I have come across with our hosting, or with sites hosted on https://www.communiteq.com/, or self-hosted sites.
If you have WP-CLI available on your WordPress site, the easiest way to debug this would be to try and create a Discourse topic from the wp console, using the same credentials as you are using in your WP Discourse configuration. The response to that request would give some details about the issue.
Okay. Iâll give that a try.
I was thinking about setting up a self hosted config on my aws account. Iâll give that a try and see if It has the same issues. Thank you for your help
For some reason Publishing fails with the 403 error. And it doesnât matter what I do.
Reason for failure:
A 403 response code was returned from Discourse.
Forbidden
Check that:
- the author has correctly set their Discourse username
The Connection tab shows âconnected to Discourseâ. The âDo Not Display Discourse Name Fieldâ setting is Disabled in Publishing.
I have already recreated a new API key to ensure connection. The default username for the system user is âsystemâ.
Iâm at a loss.
Any help would be appreciated.