Feature Request: Remote Webservice Authorisation

A place to talk about what is going on with Tera-WURFL's development, what will be included in upcoming releases and what you would like to see added to an upcoming version.

Feature Request: Remote Webservice Authorisation

Postby jhodgski » Tue Apr 12, 2011 6:42 am

Steve, would it be possible for you to add in use authorisation to the remote webservice. E.g., so a customer sends their usernames and passwords...
Code: Select all
require_once('./TeraWurflRemoteClient.php');
$data_format = TeraWurflRemoteClient::$FORMAT_JSON;
$timeout = 1;
$method = TeraWurflRemoteClient::$METHOD_CURL; //other option is $METHOD_URL_WRAPPER
$capabilities = array("resolution_width|xhtml_support_level");
$username = "thisCustomersUsername";
$password = "thisCustomersPassword";
$wurflObj = new TeraWurflRemoteClient('http://mobilewebexpert.co.uk/Tera-WURFL/webservice.php',$data_format,$timeout,$method,$username,$password);
$wurflObj->getCapabilitiesFromAgent(TeraWurflRemoteClient::getUserAgent(),$capabilities);

...with obviously some way of doing the authorisation at the Tera-WURFL backend?

Cheers,
James
jhodgski
 
Posts: 20
Joined: Wed Apr 06, 2011 11:42 am

Re: Feature Request: Remote Webservice Authorisation

Postby kamermans » Sat Apr 16, 2011 11:42 pm

I have certainly considered this in the past, but I have never implemented it. I suppose you could use a .htaccess file to lockdown the webservice.php file, then modify the client to send HTTP auth headers with its request.
Thanks,

Steve Kamerman
Tera-WURFL Author
COO of ScientiaMobile

IMPORTANT ANNOUNCEMENT! Tera-WURFL and WURFL have joined forces! We have launched ScientiaMobile to provide commercial support for our device detection solutions.

Tera-WURFL.com | Device Explorer
kamermans
Site Admin
 
Posts: 323
Joined: Wed Mar 10, 2010 12:06 pm
Location: Fort Worth, TX

Re: Feature Request: Remote Webservice Authorisation

Postby marcguay » Wed Apr 27, 2011 1:06 pm

The existing option to limit the IP addresses which can use the service might provide a solution to your problem as well...
marcguay
 
Posts: 17
Joined: Mon May 31, 2010 11:42 am

Re: Feature Request: Remote Webservice Authorisation

Postby kamermans » Thu Apr 28, 2011 7:22 pm

Indeed, the IP restriction should be sufficient for most scenarios. One scenario that it would not solve is where you use a Javascript client, since the IP is that of the visitor. For situations like this, I use fail2ban to monitor the webservice for abuse. This is how I keep the public Tera-WURFL demo webservice from being hammered with requests.
Thanks,

Steve Kamerman
Tera-WURFL Author
COO of ScientiaMobile

IMPORTANT ANNOUNCEMENT! Tera-WURFL and WURFL have joined forces! We have launched ScientiaMobile to provide commercial support for our device detection solutions.

Tera-WURFL.com | Device Explorer
kamermans
Site Admin
 
Posts: 323
Joined: Wed Mar 10, 2010 12:06 pm
Location: Fort Worth, TX


Return to Improvements / Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron