oauth and rest web services - github pagespjug.github.io/docs/oauthrest-pjug20090317.pdf ·...

21
Sean Sullivan Portland Java User Group March 17, 2009 OAuth and REST web services

Upload: others

Post on 12-Jul-2020

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

Sean SullivanPortland Java User Group

March 17, 2009

OAuth and REST web services

Page 2: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed
Page 3: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

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 6: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

REST web service API’s

Page 7: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

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 - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

REST +

• Jersey

• JBoss RESTEasy

• Apache CXF

• Restlet

• Spring 3.0

Page 9: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

• Restlet API

• JAX-RS API

• Restlet client API

Page 10: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

• 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 - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

JAX-RS

• Java API for RESTful web services

• JSR-311

• https://jsr311.dev.java.net

Page 12: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

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 - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

“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 - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

• 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 15: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

http://twitter.com/oauth_clients

Page 17: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

http://code.google.com/p/oauth

+

Page 18: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

• 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 - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

XML response

HTTP request

Page 20: OAuth and REST web services - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

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 - GitHub Pagespjug.github.io/docs/OAuthREST-PJUG20090317.pdf · Representational state transfer (REST) is a style of software architecture for distributed

Thank you