Download - OAuth and REST web services
![Page 1: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/1.jpg)
Sean SullivanPortland Java User Group
March 17, 2009
OAuth and REST web services
![Page 2: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/2.jpg)
![Page 3: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/3.jpg)
http://en.wikipedia.org/wiki/Representational_State_Transfer
Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. As such, it is not strictly a method for building "web services." The terms "representational state transfer" and "REST" were introduced in 2000 in the doctoral dissertation of Roy Fielding, one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification.
![Page 4: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/4.jpg)
http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
![Page 5: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/5.jpg)
http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
![Page 6: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/6.jpg)
REST web service API’s
![Page 7: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/7.jpg)
http://roy.gbiv.com/untangled/2008/no-rest-in-cmis
“REST is an architectural style, not a protocol”
Roy FieldingSeptember 2008
![Page 8: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/8.jpg)
REST +
• Jersey
• JBoss RESTEasy
• Apache CXF
• Restlet
• Spring 3.0
![Page 9: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/9.jpg)
• Restlet API
• JAX-RS API
• Restlet client API
![Page 10: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/10.jpg)
• org.restlet.Application
• org.restlet.resource.Resource
• org.restlet.Restlet
• org.restlet.representation.Representation
• org.restlet.representation.Variant
• org.restlet.ext.servlet.ServerServlet
![Page 11: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/11.jpg)
JAX-RS
• Java API for RESTful web services
• JSR-311
• https://jsr311.dev.java.net
![Page 12: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/12.jpg)
Restlet configuration
“As XML has been frequently overused as an alternative programming language, in the Restlet framework we are very careful about this. We think that any configuration that must be done by an application developer should be done in Java.”
http://www.restlet.org/documentation/1.1/faq
![Page 13: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/13.jpg)
“An open protocol to allow secure API authorization in a simple and standard method from desktop and web applications”
http://oauth.net
![Page 14: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/14.jpg)
• use OAuth to access protected data
• your application needs to obtain an access token from the service provider
• service provider will issue access token after the user grants permission
![Page 16: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/16.jpg)
http://wiki.oauth.net/ServiceProviders
![Page 18: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/18.jpg)
• net.oauth.OAuthAccessor
• net.oauth.OAuthConsumer
• net.oauth.OAuthMessage
• net.oauth.client.OAuthClient
• net.oauth.client.httpclient4.HttpClient4
+
![Page 19: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/19.jpg)
XML response
HTTP request
![Page 20: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/20.jpg)
Open source projects
code.google.com/p/jfireeagle
code.google.com/p/jpoco
code.google.com/p/meetup-java-client
code.google.com/p/friendfeed-java-api
code.google.com/p/twilio-java-client
![Page 21: OAuth and REST web services](https://reader033.vdocument.in/reader033/viewer/2022052617/5462085baf79597c138b485c/html5/thumbnails/21.jpg)
Thank you