[Freeswitch-users] Passing stuff from javascript to mod_xml_curl and then to a authentication web service

Ken Rice krice at freeswitch.org
Fri May 6 17:51:25 MSD 2016


mod_xml_curl just requests configurations.... in the case of the directory,
it literally requests the exact same thing you would put in the static XML
files for configs.

In the event of someone logging in with Verto, FreeSWITCH will make an xml
curl call to the webservice providing the directory expecting to get an xml
blob back that is a complete directory config for that user. The Username
and Password provided by Verto are them compared. Does password in the xml
field for the user passed from the xml webservice == the password passed in
from the verto login attempt if yes the user is authenticated.

In the event of a SIP authentication request,  sip client computes the hash
for the username and password along with some other bits such as the nonce
and passes that into freeswitch, FreeSWITCH requests the user's directory
entry from curl and computes the hash based on the same parameters, if the
hashes match then the auth is good.

Nothing is passed from the directory back to the user at this point. There
are some other things you can do like setting channel variables for calls
that are originated by the user. But it's a very straight forward process.



-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Oivvio
Polite
Sent: Friday, May 6, 2016 8:43 AM
To: freeswitch-users at lists.freeswitch.org
Subject: [Freeswitch-users] Passing stuff from javascript to mod_xml_curl
and then to a authentication web service

Today I've been trying to grok mod_xml_curl.

I've set up a webservice that xml_curl will call to get the user directory.

I've figured out from experimentation that my endpoint gets called whenever
a sip user tries to register or in my case when verto is initialized in the
browser.

What I haven't figured out is how to pass stuff from the browser to
mod_xml_curl and then on to the webservice.

In my case I want to pass a JSON Web Token. I can pass it as the passwd
argument in the verto initialization.

        vertoHandle = new jQuery.verto({
             login: 'user at mydomain',
                    passwd: 'xxxxxx',               
                    socketUrl: 'wss://mydomain:8082',
                    deviceParams: {                 
                        useMic: true,                   
                        useSpeak: true                  
                    },         
                    iceServers: true                
        }, vertoCallbacks);


But how then do I pick that up in in my xml_curl conf and pass it on to the
webservice?

    <configuration name="xml_curl.conf" description="cURL XML Gateway">
        <bindings>                 
            <binding name="directory">      
                <param name="gateway-url"
value="https://127.0.0.1/my_jwt_checking_webservice" bindings="directory"/>
            </binding> 
        </bindings>                
    </configuration>

The webservice will be running on the same box as FS so passing the token to
it as a URL paramater or as a HTTP header would be equally fine by me, but
right now I can't even figure out how to access it.

Regards Oivvio

_________________________________________________________________________
Professional FreeSWITCH Consulting Services: 
consulting at freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list