interface drupal with desktop or webapp via oauth & rest
TRANSCRIPT
Interface Drupal with Desktop or Web app via OAuth + Services
Nicolas Froment (@lasconic)http://lasconic.comhttp://wikifonia.orghttp://musescore.org
DrupalCamp GhentDecember 11th, 2009
Why OAuth?
Don't give your credentials to 3rd partiesBut give them the right to act for you
USER
Service providerYour drupal website
Consumer applicationMobile, web, desktop
Do I need OAuth?
Open standard
Oauth 1.0a?
April 2009 a security flaw found Twitter closed Oauth in the hour
In less than a week Oauth 1.0a fixes the flawAdd a verify code to get an access token
Not supported by Drupal (yet)
Example
Sending audio rendition of a score made with MuseScore to Soundcloud
Two Drupal solutions
Oauth moduleGreat overview about OAuthNot-so-good design Work with the unpublished Webservices
Number 3 ...
The Services Way
A nicely designed pluggable framework
Built around pre existing librairies (OAuth)
Reusable & flexible
Maintained and in developmentheyrockerHugo Wetterbergmarcingy
Services
Pluggable framework for services and servers
ServersREST
JSON
SOAP
XMLRPC
AMF
ServicesNode resources
Node
File
System
User
Taxonomy
Menu
ResourceNode Service + REST Server
Provides a resource view on node
Create: POST /services/rest/node + body data
Retrieve: GET /services/rest/node/123
Update: PUT /services/rest/node/123+body data
Delete: DELETE /services/rest/node/123
Oauth modules
OAuth commons Wrapper around Oauth PHP libLib hosted at google code
Services OauthLink to Services
Drupal example
Application
mywebsite.com
Let developers create applications
References
Oauth spec & security issueshttp://oauth.net
Oauth library for PHP, Java, Ruby, Javascript...http://code.google.com/p/oauth/
Moduleshttp://drupal.org/project/Serviceshttp://drupal.org/project/rest_serverhttp://drupal.org/project/oauth_commonhttp://drupal.org/project/services_oauth
Nicolas Froment (@lasconic)