General > Support

Modify Mibew to use SAML

(1/2) > >>

mscherst:
Mibew looks great and will fill a huge need for us to provide chat service without a $30+ license per operator per month.  However, we would want to integrate it into our system using SAML authentication.

We're currently using auth0 as our identity provider.  Ideally a change would allow for more general SAML authentication, but auth0 specific would work for our needs.  I'm a bit rusty on my php, but the documentation for using auth0 in a php application is at https://auth0.com/docs/quickstart/webapp/php/01-login.

Can anyone with knowledge of Mibew code take a look at that and point me in the right direction to start implementing this?  I'm sure I could hack it together, but a guess on at least which files need to be edited would be very helpful.

faf:
There are not so many active developers here these days.  :-\

As of your idea, I'd suggest you to take a look at plugins (there are a lot of them to observe and research the code). You could write your own one utilizing \Mibew\EventDispatcher\Events::OPERATOR_AUTHENTICATE event.

mscherst:
Thanks for the response.  I know this was a while ago, but I appreciate the help.

I've already completed one of my plugins, so I have some familiarity with how it works.  That one just used a Plugin.php file to attach an event listener to some of the group events.

For this, I've set up a Plugin.php file with an event listener on the OPERATOR_AUTHENTICATE event.  In that function, one of the parameters I need to pass into the authentication service is a redirect URL, which I think will just be /home (but the particular route doesn't matter).

I know that if I was using a Controller/Controller.php file that extends AbstractController, I could use $this->generateUrl().  Since I have no other need for routing, and I don't require a routing.yml file, I'm not exactly sure how to move forward.

I wonder if maybe I should do something like (still in Plugin.php):


--- Code: ---use Mibew\Controller\AbstractController;

class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\PluginInterface
{
    $router = AbstractController::getRouter();
   
    ....
    public function myAuthListener()
    {
        $url = $router->generateUrl('home');
    }
}

--- End code ---

Thanks

mscherst:
Actually, since I really just need the hosturl and not the specific route, I think I can do this:

use Mibew\Controller\AbstractController;


--- Code: ---use Mibew\Settings;

class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\PluginInterface
{
    protected $hosturl = Settings::get('hosturl');
    ...
}
--- End code ---

faf:
Well, usually 'hosturl' setting holds a value of URL of a site, not the basic URL of Mibew itself. So your second option is simple, but if you need some specific URL for some page in the administrative interface you'd better use router object. But in that case don't forget that the plugin should also implements \Mibew\Plugin\PluginInterface anyway.

Navigation

[0] Message Index

[#] Next page

Go to full version