I have a Wordpress blog which I connected to a Discourse forum through WP Discourse. WP Posts and comments are synchronized with Discourse through Discourse API.
About the SSO, from what I understand, two choices are given :
- Discourse authentication goes through WP. Users can’t log into Discourse by other means than through WP.
- WP authentication goes through WP or Discourse, the choice is given to the user (there is a “login with Discourse” link under the WP login form).
Question 1: Regarding the solution 2), is there any way to force WP users to login/create accounts through Discourse? By having an embedded Discourse login form instead of Wordpress login form or something like that… So all the users are managed by Discourse, which I would prefer.
Question 2: I didn’t try it yet, but with the solution 1) is it possible to use a WP plugin to allow users to log in through Facebook or other social media when being on the WP login form, and if they do this way it also creates a Discourse account?
From what I imagine, it would be: Facebook login creates a WP account -> Creation of a WP account which logs to Discourse too.
Basically, if a user wants to log in on Discourse or WP, they are redirected in both cases to the WP login form, which gives a choice: WP login (which creates a Discourse account thanks to SSO), or Facebook login (which does the same through WP… Am I clear ? )
Question 3: Actually, with WP Discourse, a synchronized WP post displays the post comments, but no comment form. Instead, there is a " Continue the discussion" link which leads to Discourse.
Is there any fairly simple way to the following things?
- If the user is already logged in, show a text area which sends the content to Discourse through the API and redirects the user to the post discussion on Discourse
- If the user isn’t logged in, show a login form which redirects somewhere after having logged in (on the WP post page or the post discussion on Discourse)
I’m not particularly afraid of having to do some PHP code, but I don’t know much about WP methods and stuff that I should use doing so.