Many time to read topics, but I cannot undestand how to do.
Maybe you can help me ?
We installed a Discourse forum on OVH VPS, subdomain of our site (forum.mysite.com)
Old users will be imported into Discourse Forum.
New users will create account by Discourse Forum.
All users will sign on with Discourse.
OK
Our main site (www.mysite.com) is PHP/MySQL.
My php pages have to know if the user is logged, his username, his group.
How to do ?
I can create PHP scripts, but I don’t know Ruby.
I see it’s the solution, but I don’t andertand howto use.
The way with this script :
1/ On external site, user click the link <a href='$discourse_url/session/sso_provider?$query'>sign in with discourse</a>
2/ Discourse returns user info
3/ external site open a session ?
I’m ok or not ?
I’m not far, but have not yet all keys…
Migration stopped until I anderstand how to use the script…
Many thanks !
Last question please about get_key() and set_key() functions
// pretend that set_key is a function that saves key value data in a database
Initially we store the nonce in a database (a single column table ?)
When Discourse respond, we just check if nonce exists in the table ?
If yes, we store login infos received from Discourse with the $_GET
(then store in PHP session…)
I misread what is being done here. To use Discourse as the SSO provider, the nonce will have to be stored somewhere on the website. The wp-discourse plugin does it by saving the value to the database.