Asoul
September 4, 2016, 3:39am
1
Hi, I’m new to discourse,
I want to create a plugin for customized login that contains below feature:
No signup button on homepage, and can not create new account in discourse
After click signin button, user will be authenticate to external database
After authentication, get user information and login to discourse
Is there any document or sample code for that? or these feature has already done before?
Thanks
fefrei
(Felix Freiberger)
September 4, 2016, 1:28pm
2
Discourse’s SSO support does exactly this:
1 Like
Asoul
September 4, 2016, 2:23pm
3
Hi @fefrei
I thought this SSO plugin is for external site authentication,
not directly use discourse connect to database for authentication.
Do I misunderstand that?
Thanks
fefrei
(Felix Freiberger)
September 4, 2016, 2:25pm
4
I’m not sure I understand the difference between these two options.
SSO means that Discourse will ask an external application to handle authentication, which can then use its database to handle the requests.
Asoul
September 4, 2016, 2:29pm
5
Yes, that’s a way to do it.
But for me there is no the “external application” now, so I’m wondering which one is simpler
Build an external app connect to database, and build the SSO part
Build an discourse plugin connect to database for authentication
fefrei
(Felix Freiberger)
September 4, 2016, 2:31pm
6
The second option is a world of pain, because there are a ton of edge cases in using an external user database, most of which are already handled beautifully by Discourse’s SSO implementation.
Go for option one, and build a thin app to handle SSO. Remember that your users don’t have to know about SSO at all – you can style the login prompt as you wish to make this all seamless
6 Likes