I’m new comer to discourse and I loved it very much.
Recently I do some changes in discourse “session controller” by adding to functions so that I could login to forum remotely using SSO.
I were going to change this in online source code but every time I rebuild all changes restored to origin, so I read that I need to put these changes in “Session Controller” and routes file via plugin.
I searched for how do this via plugin or a documentation for how doing an plugin but I didn’t reached any thing.
These changes is two functions similar to sso_login and sso in session controller, so I can login to forum remotely when user login in my website www.example.com, he will be logged in the forum.example.com too without needing to visit the forum.
@DeanMarkTaylor Thanks for your help, I didn’t understand the part of i frame but I’m already do these changes in my local development discourse and It works correctly. I didn’t change any of the core code I just added new two functions to initiate the SSO and all works correctly, I just need to upload these changes to my website that use docker so I need to put them in a form of plugin
These changes are:
1- Session Controller: Adding two functions and adding them to "skip_before_filter"
2- Route File: Adding two lines for these functions
I wanna know who can make a plugin do this changes in my website.
You do realize that we’re all helping each other in volunteer work … so if we don’t reply, it might be because the question was hard to understand and/or answer.
Anyway, to make this simple for you, @DeanMarkTaylor gave you a link to an answer that will log in the user without having to do any changes to the core (yes, you were doing changes to the core), is simple to implement and works every time on all clients.
After reading your original post, I understand that you’re trying to automatically log a user into your discourse forum without having the user going into the forum itself, is that correct?
If so, it would be best for you to implement an iframe solution.
Iframe solution does not require a new plugin or any changes to any core files … it simply works.
If you’re adamant on turning your changes into a plugin, then you’ll just have to set up a development environment and figure out how to create the plugin …
When I was writing my first plugin, I just went to Discourse · GitHub and read the source code of other plugins to figure out how the plugin architecture works.
@sigurdur Thanks for your reply, I know that we are helping each other in volunteering work, I really appreciate this and hope to learn and help others too, and I already done my plugin for this, I think it’s more reliable way and hope if I can make it applicable for all not customized for my website.