SlideShare a Scribd company logo
1 of 61
Download to read offline
Gran Sasso Science Institute
Ivano Malavolta
REST
Roadmap
The REST Architectural Style
Resources
Representations
Actions
Security
REST
It stands for

REpresentational 
State Transfer


Proposed by Roy Fieldings
in his PhD dissertation in 2000

REST rules the architecture of
the World Wide Web (HTTP)
Major players
REST Architectural Style
REST is not a technology, nor a framework

REST is an Architectural Style 
à  a set of principles + constraints
Those constraints help us in developing applications that are
“easy” to maintain and extend
REST Main Constraints
A RESTful system should be

•  client-server
•  stateless
–  there should be no need for the service to keep users’
sessions
–  each request should be independent of others
•  it has to support a caching system
•  it has to be uniformly accessible
–  each resource must have a unique address and a valid point
of access
The (static) Web as a RESTful system
1.  you type a URL into your browser to reach a specific HTML
page
2.  the browser gets and displays the elements of the HTML page

 à 
the browser is getting a representation of the current state 









 
of that resource
REST Overview 
http://bit.ly/JALve1
In most cases,
client-server
comunication
relies on HTTP
REST Main Actors
These are the abstractions that make a RESTful system:

•  Resources
•  Representations
•  Actions
Roadmap
The REST Architectural Style
Resources
Representations
Actions
Security
Resources
A resource is “everything” the service can provide

States and functions of a remote application are also considered
as resources

Example of resources:
•  title of a movie from IMDb
•  a Flash movie from YouTube
•  images from Flickr
•  order info from eBay
•  etc.
Resources
In general, a RESTful resource is anything that is addressable 
over the Web

Addressable = anything that can be accessed and transferred
between client and server

à  a resource must have a unique address over the Web

Under HTTP these are URIs
URIs
Uniform Resource Identifier

in a RESTful web service is a hyperlink to a resource

It is the only means for clients and servers to exchange
representations of resources


ex.


.../orderinfo?id=123
URIs
The URI is not meant to change over time
à it is the only means to identify a specific resource 

URIs are also used to negotiate representations of a given
resource

In the URI you give certain parameters that define which
information you want the server to return to you (just like
giving GET variables to a page)

The server will respond with a resource representation
containing the information you’ve asked
URIs
URIs and URLs are also used to link resources together

ex.
Roadmap
The REST Architectural Style
Resources
Representations
Actions
Security
Representations
The representation of resources is what is sent back and forth
between clients and servers

So, we never send or receive resources, only their representations
URL
Uniform Resource Locator

A URL is a specialization of URI that defines the network location
of a specific resource

Unlike a URI, the URL defines how the resource can be obtained


es.


http://some.domain.com/orderinfo?id=123
Representations
The format of the representation is determined by the content-
type 

The interaction of the representation on the resource is
determined by the action (GET, SET, etc.)
Content-types
Since we are using HTTP to communicate, we can transfer any
kind of information that can be passed between clients and
servers

ex. text files, PDF documents, images, videos, etc. 

In any case, the data is streamed over TCP/IP and the browser
knows how to interpret the binary streams because of the
HTTP protocol response header Content-Type
Representation Formats
Different clients are able to consume different representations
of the same resource

A representation can take various forms, such as:
•  image
•  a text file
•  an XML stream
•  a JSON stream
but its resource has to be available through the same URI
Representation Formats
For human-generated requests through a web browser, a
representation is typically in the form of an HTML page



For automated requests from other web services, readability is
not as important and a more efficient representation can be
used such as XML or JSON
Roadmap
The REST Architectural Style
Resources
Representations
Actions
Security
Actions
Actions are used to operate on resources

For example, they can be used for
–  getting info about a movie
–  adding a photo to Flickr
–  deleting a file from a folder

The data transmitted to and from the resource is a representation
of it
HTTP-based Actions
Under HTTP, actions are standard HTTP request:

GET
POST
PUT
DELETE

They make up the uniform interface used for client/server data
transfers
HTTP-based Actions
RESTful web services can also execute logic at the server level,
but remember that every result must be a resource
representation
HTTP as Uniform Interface
In RESTful systems we focus on resource names, whereas in
traditional web systems we focussed on the actions to be
performed on resources

à In RESTful systems we have four specific actions that we can
take upon resources — Create, Retrieve, Update, and Delete
(CRUD)


In traditional web applications, we could have countless actions
with no naming or implementation standards
The Classroom Example
Artificial example of a web service handling students in some
classroom

Location of the service = http://restfuljava.com/

Resources are represented as XML streams
The Classroom Example: URIs
Student (identified by name):

http://restfuljava.com/students/{name}

List of students: 
http://restfuljava.com/students
The Classroom Example: Representations
Student:
<student>
<name>Jane</name>
<age>10</age>
<link>/students/Jane</link>
</student>
The Classroom Example: Representations
Students List:
<students>
<student>
<name>Jane</name>
<age>10</age>
<link>/students/Jane</link>
</student>
<student>
<name>John</name>
<age>11</age>
<link>/students/John</link>
</student>
</students>
GET
The method GET is used to RETRIEVE resources

It cannot have side-effects
à it can be done repeatedly without changing the state of the
resource
It can also return only parts of the resource
à it can act as both a read operation and a query operation
GET Example
POST
The method POST is used to CREATE resources


Usually, the resource identity/URL is not known at creation time

à The URL of the newly created resource is usually created
automatically by the server
POST Example
PUT
The method PUT is used to UPDATE resources

Recurrent PUT workflow:
1.  we first GET the representation of the resource we need to
update
2.  in the client we update the resource with the new value(s) 
3.  we update the resource using a PUT request together with
the representation as its payload
PUT Example
The initial GET
is omitted here
DELETE
The method DELETE is used to DELETE resources

Similarly to PUT, also in this case we need the URI of the resource
being deleted
DELETE Example
A note on PUT and DELETE
PUT and DELETE apply to the entire resource


à 
when doing a PUT or DELETE operation, 


the entire resource is replaced/deleted

The PUT and DELETE operations are atomic



à 
if two PUT/DELETE operations occur simultaneously, 


one of them will win and determine the final state of 


the resource
HTTP Status Codes
RESTful services use these codes to return information about the
response of the requests

1xx 

informational message
2xx 
success message
3xx 
redirects the client to another URL
4xx 
client-side error
5xx 
server-side error
Roadmap
The REST Architectural Style
Resources
Representations
Actions
Security
Security
Here we will focus on securing user access to our services

There are three main methods:

1.  Custom token authentication
2.  HTTP Basic authentication
3.  OAuth
Control access
to resources
Accessing services on
behalf of users
Custom Token Authentication
2-steps process

1.  The server generates a unique token for a registered API
user
2.  The registered user sends the generated token for
authentication with every request to the service

The token can be used to 
•  enable a specific user
•  to check if traffic limits have been exceeded
•  etc.
Pros and Cons
+ 
The generation of an access token is independent of the web
service 

+ 
It is a simple approach
–  while creating a user registration process, the server generates a
unique token per account access
+ 
data exchange can be logged and verified
–  since access is controlled for each request
-  This method is not secure
–  The passed token can be copied and reused without authorization
How to send the token?
The authentication token is sent with every request in two ways: 


1.  it can be part of the URI
2.  it can be added to the HTTP request header
HTTP Basic authentication
The client sends the (cleartext Base64 encoded) username and
password pair in the HTTP header Authorization







Username and password must be sent for every HTTP request
for the authorization to be validated

http://bit.ly/JFGCQW
Pros and Cons
+ 
clients must manage server authorization requests

-  in general, it is not secure
-  because usernames and passwords are only encoded using Base64
encoding, which can be easily deciphered

+ 
this potential security hole can be solved by using HTTPS (SSL)
Client/server transaction
It can take 2 forms:

1.  a client makes a request to the server without authentication
credentials
–  the server sends a response with an HTTP error code of 401
(unauthorized access)
–  we need to programmatically intercept the 401 response and then
provide valid credentials to complete the original request
2.  a client makes a request to the server with authentication
credentials from the beginning
Example of Request
<input type="text" name=“u" id=“u" value="" />
<input type="password" name=“p" id=“p" value="" />
var username = $('#u').val();
var password = MD5($('#p').val());
$.ajax({
type: 'POST',
url: ‘https://www.domain.com/login.php',
data: {
username: username,
password: password
},
success: function(result) {
console.log(“logged in”);
}
});
Oauth 2.0
OAuth's authorization protocol is becoming the preferred
authorization scheme

It is simple and easy to 
integrate to RESTful services

Open-source protocol
What are we talking about...
http://slidesha.re/JdfBGy
OAuth
Your
app
Service
provider
User
OAuth 2.0
It is used for accessing web services on the behalf of the user

OAuth is an authorization protocol that allows third-party web
service creators (you) to get access to users' data stored in a
different web service

This can happen only with users' consent and without a username
and password exchange
OAuth 2.0
Before OAuth, users needed to pass login information to multiple
third party services

With OAuth, users don’t divulge their login information
à  authorization is granted from the provider service, where both
user’s data and credentials are stored
à  the consumer service only receives an authorization token that
is used to access data from the provider service
OAuth Basics 
Authentication
•  Need to log in to access parts of a website
–  ex: view user profile
–  post a photo
–  add a friend
–  view private messages

Token-based Authentication
•  Logged-in user has a unique token used to access data from
your app
Intuition behind OAuth
http://en.wikipedia.org/wiki/OAuth
OAuth 2.0 Authentication flow
your
app
 Auth Server
(ex. Facebook)
user
More formally...
http://goo.gl/rNm80
References



http://bit.ly/JA1UPT


Cordova Facebook plugin:


http://goo.gl/7qY54

Facebook login without plugin:


http://github.com/ccoenraets/OpenFB
+ 39 380 70 21 600
Contact
Ivano Malavolta | 
Gran Sasso Science Institute
iivanoo
ivano.malavolta@univaq.it
www.ivanomalavolta.com

More Related Content

What's hot

Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVCRichard Paul
 
Spring MVC Architecture Tutorial
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture TutorialJava Success Point
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_HourDilip Patel
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!Fioriela Bego
 
HTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile appsHTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile appsIvano Malavolta
 
Jsp & Ajax
Jsp & AjaxJsp & Ajax
Jsp & AjaxAng Chen
 
RESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCRESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCdigitalsonic
 
Introduction to Ember.js
Introduction to Ember.jsIntroduction to Ember.js
Introduction to Ember.jsJeremy Brown
 
Jasig Rubyon Rails
Jasig Rubyon RailsJasig Rubyon Rails
Jasig Rubyon RailsPaul Pajo
 
Session 31 - Session Management, Best Practices, Design Patterns in Web Apps
Session 31 - Session Management, Best Practices, Design Patterns in Web AppsSession 31 - Session Management, Best Practices, Design Patterns in Web Apps
Session 31 - Session Management, Best Practices, Design Patterns in Web AppsPawanMM
 
Spring Web Services
Spring Web ServicesSpring Web Services
Spring Web ServicesEmprovise
 
Session 35 - Design Patterns
Session 35 - Design PatternsSession 35 - Design Patterns
Session 35 - Design PatternsPawanMM
 

What's hot (20)

Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVC
 
Spring MVC Architecture Tutorial
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture Tutorial
 
Spring MVC 3.0 Framework
Spring MVC 3.0 FrameworkSpring MVC 3.0 Framework
Spring MVC 3.0 Framework
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
 
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
 
HTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile appsHTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile apps
 
Jsp & Ajax
Jsp & AjaxJsp & Ajax
Jsp & Ajax
 
Ajax
AjaxAjax
Ajax
 
JavaScript
JavaScriptJavaScript
JavaScript
 
RESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCRESTful Web Services with Spring MVC
RESTful Web Services with Spring MVC
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
Introduction to Ember.js
Introduction to Ember.jsIntroduction to Ember.js
Introduction to Ember.js
 
Jasig Rubyon Rails
Jasig Rubyon RailsJasig Rubyon Rails
Jasig Rubyon Rails
 
Session 31 - Session Management, Best Practices, Design Patterns in Web Apps
Session 31 - Session Management, Best Practices, Design Patterns in Web AppsSession 31 - Session Management, Best Practices, Design Patterns in Web Apps
Session 31 - Session Management, Best Practices, Design Patterns in Web Apps
 
Spring Web Services
Spring Web ServicesSpring Web Services
Spring Web Services
 
Intro lift
Intro liftIntro lift
Intro lift
 
Fast mobile web apps
Fast mobile web appsFast mobile web apps
Fast mobile web apps
 
Session 35 - Design Patterns
Session 35 - Design PatternsSession 35 - Design Patterns
Session 35 - Design Patterns
 

Viewers also liked

Accessing Device Features
Accessing Device FeaturesAccessing Device Features
Accessing Device FeaturesIvano Malavolta
 
Backbone.js
Backbone.jsBackbone.js
Backbone.jstonyskn
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.jsPragnesh Vaghela
 
[2016/2017] AADL (Architecture Analysis and Design Language)
[2016/2017] AADL (Architecture Analysis and Design Language)[2016/2017] AADL (Architecture Analysis and Design Language)
[2016/2017] AADL (Architecture Analysis and Design Language)Ivano Malavolta
 
Mission planning of autonomous quadrotors
Mission planning of autonomous quadrotorsMission planning of autonomous quadrotors
Mission planning of autonomous quadrotorsIvano Malavolta
 
[2016/2017] Modern development paradigms
[2016/2017] Modern development paradigms [2016/2017] Modern development paradigms
[2016/2017] Modern development paradigms Ivano Malavolta
 

Viewers also liked (7)

Accessing Device Features
Accessing Device FeaturesAccessing Device Features
Accessing Device Features
 
A4WSN
A4WSNA4WSN
A4WSN
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
[2016/2017] AADL (Architecture Analysis and Design Language)
[2016/2017] AADL (Architecture Analysis and Design Language)[2016/2017] AADL (Architecture Analysis and Design Language)
[2016/2017] AADL (Architecture Analysis and Design Language)
 
Mission planning of autonomous quadrotors
Mission planning of autonomous quadrotorsMission planning of autonomous quadrotors
Mission planning of autonomous quadrotors
 
[2016/2017] Modern development paradigms
[2016/2017] Modern development paradigms [2016/2017] Modern development paradigms
[2016/2017] Modern development paradigms
 

Similar to Rest

Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful FundamentalsSuresh Madhra
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful FundamentalsSuresh Madhra
 
Rest webservice ppt
Rest webservice pptRest webservice ppt
Rest webservice pptsinhatanay
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with ODataMahek Merchant
 
REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.pptKGSCSEPSGCT
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyPayal Jain
 
Api design and development
Api design and developmentApi design and development
Api design and developmentoquidave
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
 
RESTFul WebApp Concept
RESTFul WebApp ConceptRESTFul WebApp Concept
RESTFul WebApp ConceptDian Aditya
 
RESTFul WebApp Concept
RESTFul WebApp ConceptRESTFul WebApp Concept
RESTFul WebApp ConceptDian Aditya
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST AssuredTO THE NEW Pvt. Ltd.
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServicesPrateek Tandon
 

Similar to Rest (20)

REST Basics
REST BasicsREST Basics
REST Basics
 
ROA.ppt
ROA.pptROA.ppt
ROA.ppt
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful Fundamentals
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful Fundamentals
 
ReSTful API Final
ReSTful API FinalReSTful API Final
ReSTful API Final
 
Rest webservice ppt
Rest webservice pptRest webservice ppt
Rest webservice ppt
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
 
Rest Webservice
Rest WebserviceRest Webservice
Rest Webservice
 
REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using Jersey
 
Api design and development
Api design and developmentApi design and development
Api design and development
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 
RESTFul WebApp Concept
RESTFul WebApp ConceptRESTFul WebApp Concept
RESTFul WebApp Concept
 
RESTFul WebApp Concept
RESTFul WebApp ConceptRESTFul WebApp Concept
RESTFul WebApp Concept
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
 
Restful api
Restful apiRestful api
Restful api
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
 
Best Practices in Api Design
Best Practices in Api DesignBest Practices in Api Design
Best Practices in Api Design
 

More from Ivano Malavolta

Conducting Experiments on the Software Architecture of Robotic Systems (QRARS...
Conducting Experiments on the Software Architecture of Robotic Systems (QRARS...Conducting Experiments on the Software Architecture of Robotic Systems (QRARS...
Conducting Experiments on the Software Architecture of Robotic Systems (QRARS...Ivano Malavolta
 
The Green Lab - Research cocktail @Vrije Universiteit Amsterdam (October 2020)
The Green Lab - Research cocktail  @Vrije Universiteit Amsterdam (October 2020)The Green Lab - Research cocktail  @Vrije Universiteit Amsterdam (October 2020)
The Green Lab - Research cocktail @Vrije Universiteit Amsterdam (October 2020)Ivano Malavolta
 
Software sustainability and Green IT
Software sustainability and Green ITSoftware sustainability and Green IT
Software sustainability and Green ITIvano Malavolta
 
Navigation-aware and Personalized Prefetching of Network Requests in Android ...
Navigation-aware and Personalized Prefetching of Network Requests in Android ...Navigation-aware and Personalized Prefetching of Network Requests in Android ...
Navigation-aware and Personalized Prefetching of Network Requests in Android ...Ivano Malavolta
 
How Maintainability Issues of Android Apps Evolve [ICSME 2018]
How Maintainability Issues of Android Apps Evolve [ICSME 2018]How Maintainability Issues of Android Apps Evolve [ICSME 2018]
How Maintainability Issues of Android Apps Evolve [ICSME 2018]Ivano Malavolta
 
Collaborative Model-Driven Software Engineering: a Classification Framework a...
Collaborative Model-Driven Software Engineering: a Classification Framework a...Collaborative Model-Driven Software Engineering: a Classification Framework a...
Collaborative Model-Driven Software Engineering: a Classification Framework a...Ivano Malavolta
 
Experimenting on Mobile Apps Quality - a tale about Energy, Performance, and ...
Experimenting on Mobile Apps Quality - a tale about Energy, Performance, and ...Experimenting on Mobile Apps Quality - a tale about Energy, Performance, and ...
Experimenting on Mobile Apps Quality - a tale about Energy, Performance, and ...Ivano Malavolta
 
Modeling objects interaction via UML sequence diagrams [Software Design] [Com...
Modeling objects interaction via UML sequence diagrams [Software Design] [Com...Modeling objects interaction via UML sequence diagrams [Software Design] [Com...
Modeling objects interaction via UML sequence diagrams [Software Design] [Com...Ivano Malavolta
 
Modeling behaviour via UML state machines [Software Design] [Computer Science...
Modeling behaviour via UML state machines [Software Design] [Computer Science...Modeling behaviour via UML state machines [Software Design] [Computer Science...
Modeling behaviour via UML state machines [Software Design] [Computer Science...Ivano Malavolta
 
Object-oriented design patterns in UML [Software Design] [Computer Science] [...
Object-oriented design patterns in UML [Software Design] [Computer Science] [...Object-oriented design patterns in UML [Software Design] [Computer Science] [...
Object-oriented design patterns in UML [Software Design] [Computer Science] [...Ivano Malavolta
 
Structure modeling with UML [Software Design] [Computer Science] [Vrije Unive...
Structure modeling with UML [Software Design] [Computer Science] [Vrije Unive...Structure modeling with UML [Software Design] [Computer Science] [Vrije Unive...
Structure modeling with UML [Software Design] [Computer Science] [Vrije Unive...Ivano Malavolta
 
Requirements engineering with UML [Software Design] [Computer Science] [Vrije...
Requirements engineering with UML [Software Design] [Computer Science] [Vrije...Requirements engineering with UML [Software Design] [Computer Science] [Vrije...
Requirements engineering with UML [Software Design] [Computer Science] [Vrije...Ivano Malavolta
 
Modeling and abstraction, software development process [Software Design] [Com...
Modeling and abstraction, software development process [Software Design] [Com...Modeling and abstraction, software development process [Software Design] [Com...
Modeling and abstraction, software development process [Software Design] [Com...Ivano Malavolta
 
[2017/2018] Agile development
[2017/2018] Agile development[2017/2018] Agile development
[2017/2018] Agile developmentIvano Malavolta
 
Reconstructing microservice-based architectures
Reconstructing microservice-based architecturesReconstructing microservice-based architectures
Reconstructing microservice-based architecturesIvano Malavolta
 
[2017/2018] AADL - Architecture Analysis and Design Language
[2017/2018] AADL - Architecture Analysis and Design Language[2017/2018] AADL - Architecture Analysis and Design Language
[2017/2018] AADL - Architecture Analysis and Design LanguageIvano Malavolta
 
[2017/2018] Architectural languages
[2017/2018] Architectural languages[2017/2018] Architectural languages
[2017/2018] Architectural languagesIvano Malavolta
 
[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software ArchitectureIvano Malavolta
 
[2017/2018] RESEARCH in software engineering
[2017/2018] RESEARCH in software engineering[2017/2018] RESEARCH in software engineering
[2017/2018] RESEARCH in software engineeringIvano Malavolta
 

More from Ivano Malavolta (20)

Conducting Experiments on the Software Architecture of Robotic Systems (QRARS...
Conducting Experiments on the Software Architecture of Robotic Systems (QRARS...Conducting Experiments on the Software Architecture of Robotic Systems (QRARS...
Conducting Experiments on the Software Architecture of Robotic Systems (QRARS...
 
The H2020 experience
The H2020 experienceThe H2020 experience
The H2020 experience
 
The Green Lab - Research cocktail @Vrije Universiteit Amsterdam (October 2020)
The Green Lab - Research cocktail  @Vrije Universiteit Amsterdam (October 2020)The Green Lab - Research cocktail  @Vrije Universiteit Amsterdam (October 2020)
The Green Lab - Research cocktail @Vrije Universiteit Amsterdam (October 2020)
 
Software sustainability and Green IT
Software sustainability and Green ITSoftware sustainability and Green IT
Software sustainability and Green IT
 
Navigation-aware and Personalized Prefetching of Network Requests in Android ...
Navigation-aware and Personalized Prefetching of Network Requests in Android ...Navigation-aware and Personalized Prefetching of Network Requests in Android ...
Navigation-aware and Personalized Prefetching of Network Requests in Android ...
 
How Maintainability Issues of Android Apps Evolve [ICSME 2018]
How Maintainability Issues of Android Apps Evolve [ICSME 2018]How Maintainability Issues of Android Apps Evolve [ICSME 2018]
How Maintainability Issues of Android Apps Evolve [ICSME 2018]
 
Collaborative Model-Driven Software Engineering: a Classification Framework a...
Collaborative Model-Driven Software Engineering: a Classification Framework a...Collaborative Model-Driven Software Engineering: a Classification Framework a...
Collaborative Model-Driven Software Engineering: a Classification Framework a...
 
Experimenting on Mobile Apps Quality - a tale about Energy, Performance, and ...
Experimenting on Mobile Apps Quality - a tale about Energy, Performance, and ...Experimenting on Mobile Apps Quality - a tale about Energy, Performance, and ...
Experimenting on Mobile Apps Quality - a tale about Energy, Performance, and ...
 
Modeling objects interaction via UML sequence diagrams [Software Design] [Com...
Modeling objects interaction via UML sequence diagrams [Software Design] [Com...Modeling objects interaction via UML sequence diagrams [Software Design] [Com...
Modeling objects interaction via UML sequence diagrams [Software Design] [Com...
 
Modeling behaviour via UML state machines [Software Design] [Computer Science...
Modeling behaviour via UML state machines [Software Design] [Computer Science...Modeling behaviour via UML state machines [Software Design] [Computer Science...
Modeling behaviour via UML state machines [Software Design] [Computer Science...
 
Object-oriented design patterns in UML [Software Design] [Computer Science] [...
Object-oriented design patterns in UML [Software Design] [Computer Science] [...Object-oriented design patterns in UML [Software Design] [Computer Science] [...
Object-oriented design patterns in UML [Software Design] [Computer Science] [...
 
Structure modeling with UML [Software Design] [Computer Science] [Vrije Unive...
Structure modeling with UML [Software Design] [Computer Science] [Vrije Unive...Structure modeling with UML [Software Design] [Computer Science] [Vrije Unive...
Structure modeling with UML [Software Design] [Computer Science] [Vrije Unive...
 
Requirements engineering with UML [Software Design] [Computer Science] [Vrije...
Requirements engineering with UML [Software Design] [Computer Science] [Vrije...Requirements engineering with UML [Software Design] [Computer Science] [Vrije...
Requirements engineering with UML [Software Design] [Computer Science] [Vrije...
 
Modeling and abstraction, software development process [Software Design] [Com...
Modeling and abstraction, software development process [Software Design] [Com...Modeling and abstraction, software development process [Software Design] [Com...
Modeling and abstraction, software development process [Software Design] [Com...
 
[2017/2018] Agile development
[2017/2018] Agile development[2017/2018] Agile development
[2017/2018] Agile development
 
Reconstructing microservice-based architectures
Reconstructing microservice-based architecturesReconstructing microservice-based architectures
Reconstructing microservice-based architectures
 
[2017/2018] AADL - Architecture Analysis and Design Language
[2017/2018] AADL - Architecture Analysis and Design Language[2017/2018] AADL - Architecture Analysis and Design Language
[2017/2018] AADL - Architecture Analysis and Design Language
 
[2017/2018] Architectural languages
[2017/2018] Architectural languages[2017/2018] Architectural languages
[2017/2018] Architectural languages
 
[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture
 
[2017/2018] RESEARCH in software engineering
[2017/2018] RESEARCH in software engineering[2017/2018] RESEARCH in software engineering
[2017/2018] RESEARCH in software engineering
 

Recently uploaded

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Rest

  • 1. Gran Sasso Science Institute Ivano Malavolta REST
  • 2. Roadmap The REST Architectural Style Resources Representations Actions Security
  • 3. REST It stands for REpresentational State Transfer Proposed by Roy Fieldings in his PhD dissertation in 2000 REST rules the architecture of the World Wide Web (HTTP)
  • 5. REST Architectural Style REST is not a technology, nor a framework REST is an Architectural Style à  a set of principles + constraints Those constraints help us in developing applications that are “easy” to maintain and extend
  • 6. REST Main Constraints A RESTful system should be •  client-server •  stateless –  there should be no need for the service to keep users’ sessions –  each request should be independent of others •  it has to support a caching system •  it has to be uniformly accessible –  each resource must have a unique address and a valid point of access
  • 7. The (static) Web as a RESTful system 1.  you type a URL into your browser to reach a specific HTML page 2.  the browser gets and displays the elements of the HTML page à the browser is getting a representation of the current state of that resource
  • 8. REST Overview http://bit.ly/JALve1 In most cases, client-server comunication relies on HTTP
  • 9. REST Main Actors These are the abstractions that make a RESTful system: •  Resources •  Representations •  Actions
  • 10. Roadmap The REST Architectural Style Resources Representations Actions Security
  • 11. Resources A resource is “everything” the service can provide States and functions of a remote application are also considered as resources Example of resources: •  title of a movie from IMDb •  a Flash movie from YouTube •  images from Flickr •  order info from eBay •  etc.
  • 12. Resources In general, a RESTful resource is anything that is addressable over the Web Addressable = anything that can be accessed and transferred between client and server à  a resource must have a unique address over the Web Under HTTP these are URIs
  • 13. URIs Uniform Resource Identifier in a RESTful web service is a hyperlink to a resource It is the only means for clients and servers to exchange representations of resources ex. .../orderinfo?id=123
  • 14. URIs The URI is not meant to change over time à it is the only means to identify a specific resource URIs are also used to negotiate representations of a given resource In the URI you give certain parameters that define which information you want the server to return to you (just like giving GET variables to a page) The server will respond with a resource representation containing the information you’ve asked
  • 15. URIs URIs and URLs are also used to link resources together ex.
  • 16. Roadmap The REST Architectural Style Resources Representations Actions Security
  • 17. Representations The representation of resources is what is sent back and forth between clients and servers So, we never send or receive resources, only their representations
  • 18. URL Uniform Resource Locator A URL is a specialization of URI that defines the network location of a specific resource Unlike a URI, the URL defines how the resource can be obtained es. http://some.domain.com/orderinfo?id=123
  • 19. Representations The format of the representation is determined by the content- type The interaction of the representation on the resource is determined by the action (GET, SET, etc.)
  • 20. Content-types Since we are using HTTP to communicate, we can transfer any kind of information that can be passed between clients and servers ex. text files, PDF documents, images, videos, etc. In any case, the data is streamed over TCP/IP and the browser knows how to interpret the binary streams because of the HTTP protocol response header Content-Type
  • 21. Representation Formats Different clients are able to consume different representations of the same resource A representation can take various forms, such as: •  image •  a text file •  an XML stream •  a JSON stream but its resource has to be available through the same URI
  • 22. Representation Formats For human-generated requests through a web browser, a representation is typically in the form of an HTML page For automated requests from other web services, readability is not as important and a more efficient representation can be used such as XML or JSON
  • 23. Roadmap The REST Architectural Style Resources Representations Actions Security
  • 24. Actions Actions are used to operate on resources For example, they can be used for –  getting info about a movie –  adding a photo to Flickr –  deleting a file from a folder The data transmitted to and from the resource is a representation of it
  • 25. HTTP-based Actions Under HTTP, actions are standard HTTP request: GET POST PUT DELETE They make up the uniform interface used for client/server data transfers
  • 26. HTTP-based Actions RESTful web services can also execute logic at the server level, but remember that every result must be a resource representation
  • 27. HTTP as Uniform Interface In RESTful systems we focus on resource names, whereas in traditional web systems we focussed on the actions to be performed on resources à In RESTful systems we have four specific actions that we can take upon resources — Create, Retrieve, Update, and Delete (CRUD) In traditional web applications, we could have countless actions with no naming or implementation standards
  • 28. The Classroom Example Artificial example of a web service handling students in some classroom Location of the service = http://restfuljava.com/ Resources are represented as XML streams
  • 29. The Classroom Example: URIs Student (identified by name): http://restfuljava.com/students/{name} List of students: http://restfuljava.com/students
  • 30. The Classroom Example: Representations Student: <student> <name>Jane</name> <age>10</age> <link>/students/Jane</link> </student>
  • 31. The Classroom Example: Representations Students List: <students> <student> <name>Jane</name> <age>10</age> <link>/students/Jane</link> </student> <student> <name>John</name> <age>11</age> <link>/students/John</link> </student> </students>
  • 32. GET The method GET is used to RETRIEVE resources It cannot have side-effects à it can be done repeatedly without changing the state of the resource It can also return only parts of the resource à it can act as both a read operation and a query operation
  • 34. POST The method POST is used to CREATE resources Usually, the resource identity/URL is not known at creation time à The URL of the newly created resource is usually created automatically by the server
  • 36. PUT The method PUT is used to UPDATE resources Recurrent PUT workflow: 1.  we first GET the representation of the resource we need to update 2.  in the client we update the resource with the new value(s) 3.  we update the resource using a PUT request together with the representation as its payload
  • 37. PUT Example The initial GET is omitted here
  • 38. DELETE The method DELETE is used to DELETE resources Similarly to PUT, also in this case we need the URI of the resource being deleted
  • 40. A note on PUT and DELETE PUT and DELETE apply to the entire resource à when doing a PUT or DELETE operation, the entire resource is replaced/deleted The PUT and DELETE operations are atomic à if two PUT/DELETE operations occur simultaneously, one of them will win and determine the final state of the resource
  • 41. HTTP Status Codes RESTful services use these codes to return information about the response of the requests 1xx informational message 2xx success message 3xx redirects the client to another URL 4xx client-side error 5xx server-side error
  • 42. Roadmap The REST Architectural Style Resources Representations Actions Security
  • 43. Security Here we will focus on securing user access to our services There are three main methods: 1.  Custom token authentication 2.  HTTP Basic authentication 3.  OAuth Control access to resources Accessing services on behalf of users
  • 44. Custom Token Authentication 2-steps process 1.  The server generates a unique token for a registered API user 2.  The registered user sends the generated token for authentication with every request to the service The token can be used to •  enable a specific user •  to check if traffic limits have been exceeded •  etc.
  • 45. Pros and Cons + The generation of an access token is independent of the web service + It is a simple approach –  while creating a user registration process, the server generates a unique token per account access + data exchange can be logged and verified –  since access is controlled for each request -  This method is not secure –  The passed token can be copied and reused without authorization
  • 46. How to send the token? The authentication token is sent with every request in two ways: 1.  it can be part of the URI 2.  it can be added to the HTTP request header
  • 47. HTTP Basic authentication The client sends the (cleartext Base64 encoded) username and password pair in the HTTP header Authorization Username and password must be sent for every HTTP request for the authorization to be validated http://bit.ly/JFGCQW
  • 48. Pros and Cons + clients must manage server authorization requests -  in general, it is not secure -  because usernames and passwords are only encoded using Base64 encoding, which can be easily deciphered + this potential security hole can be solved by using HTTPS (SSL)
  • 49. Client/server transaction It can take 2 forms: 1.  a client makes a request to the server without authentication credentials –  the server sends a response with an HTTP error code of 401 (unauthorized access) –  we need to programmatically intercept the 401 response and then provide valid credentials to complete the original request 2.  a client makes a request to the server with authentication credentials from the beginning
  • 50. Example of Request <input type="text" name=“u" id=“u" value="" /> <input type="password" name=“p" id=“p" value="" /> var username = $('#u').val(); var password = MD5($('#p').val()); $.ajax({ type: 'POST', url: ‘https://www.domain.com/login.php', data: { username: username, password: password }, success: function(result) { console.log(“logged in”); } });
  • 51. Oauth 2.0 OAuth's authorization protocol is becoming the preferred authorization scheme It is simple and easy to integrate to RESTful services Open-source protocol
  • 52. What are we talking about... http://slidesha.re/JdfBGy
  • 54. OAuth 2.0 It is used for accessing web services on the behalf of the user OAuth is an authorization protocol that allows third-party web service creators (you) to get access to users' data stored in a different web service This can happen only with users' consent and without a username and password exchange
  • 55. OAuth 2.0 Before OAuth, users needed to pass login information to multiple third party services With OAuth, users don’t divulge their login information à  authorization is granted from the provider service, where both user’s data and credentials are stored à  the consumer service only receives an authorization token that is used to access data from the provider service
  • 56. OAuth Basics Authentication •  Need to log in to access parts of a website –  ex: view user profile –  post a photo –  add a friend –  view private messages Token-based Authentication •  Logged-in user has a unique token used to access data from your app
  • 58. OAuth 2.0 Authentication flow your app Auth Server (ex. Facebook) user
  • 60. References http://bit.ly/JA1UPT Cordova Facebook plugin: http://goo.gl/7qY54 Facebook login without plugin: http://github.com/ccoenraets/OpenFB
  • 61. + 39 380 70 21 600 Contact Ivano Malavolta | Gran Sasso Science Institute iivanoo ivano.malavolta@univaq.it www.ivanomalavolta.com