Making a Mumble ICE Authenticator in PHP

564 views Asked by At

Interfacing with Mumble over ICE is a very interesting task with little examples around.

I'm trying to make a User Authenticator in PHP and I'm having a few issues with the setup. My setup is PHP 5.5, Murmur 1.3.0 and ICE 3.5.1

$ICE = Ice_initialize();
    $secret = array('secret'=>'');
    try{
            $base = $ICE->stringToProxy("Meta  -e 1.0:tcp -h 127.0.0.1 -p 6502");
            $meta = $base->ice_checkedCast("::Murmur::Meta")->ice_context($secret);
            $mconfig = $meta->getServer(1)->ice_context($secret)->getTree();

This is what I have so far to set the context of the ice server, Im wanting to setup a callback for Murmur::ServerAuthenticator interface "authenticate"

I'm unsure how to set it up with the ICE Callback system to be able to call a function with all the details of the auth and return the needed data.

Something like this:

$server->setAuthenticator($auth);
$auth = myownfunc($user, $pw, $certificates, $certhash);
1

There are 1 answers

0
Nike Tufjo On

I think authenticators need to keep the TCP connexion open, in other words they have to be daemons, which you can't (or probably shouldn't attempt to) do with PHP.

Hence all authenticator examples you can find below are for example written in Python and you'll notice they daemonize one way or another.

https://github.com/mumble-voip/mumble-scripts/blob/master/Authenticators

The confusing thing might be that you are a client (the server is murmurd), but this client needs to stays connected for when a callback / authentication arrives)