SlideShare a Scribd company logo
RESTful services and
OAUTH protocol in IoT
by Yakov Fain, Farata Systems
Farata Systems and SuranceBay
surancebay.com
faratasystems.com
The three parts of this presentation
• One approach to integrating consumer devices in the
business workflow
• Live demo: integrating a blood pressure monitor into a
business workflow
• A brief review of REST, OAUTH, Websockets and their
roles tin our application.
Yesterday’s Sensors (Things)
• 18 years ago. Telephony.
• I’ve been programming IoT!
Today’s Sensors

SCIO: a molecular sensor that scans physical objects and
receives instant information to your smartphone.
http://www.consumerphysics.com/
Tomorrow: Streachable Wearables

epidermal electronics
Source: http://bit.ly/1uu0srr
A thing is an app + an API + a Web site.
Smartphone

app
Device

Manufacturer’s

Server
Device
A Typical Consumer Device Setup
Bluetooth or NFC
MQTT, CoAp, …
MQTT, CoAp, …
Low-Level IoT Approach
Learn and implement IoT protocols: MQTT, XMPP, AMQP, CoAp,…
Write Java programs for Raspberry Pi or Arduino

Learn HomeKit and HealthKit from Apple
High-Level IoT Approach
Create applications using standard
technologies to integrate things into an
existing business workflow.
A Proof of Concept App
• Integrate consumer devices into one of the insurance
business workflows
• Leverage existing software technologies
• Create a standard-based application layer that connects
things
Your Server in the Middle
• Create a software layer as a proxy for all communications
with IoT devices.
• Find the use-cases for data-gathering devices in your
business applications.
• Collect the valuable data from devices for analisys.
Java dominates on the middleware market.
The Use Case: Integrating Scale and Blood Pressure Monitor

into insurance workflow
IHealthLabs Blood

Pressure Monitor
Fitbit Scale

Aria
Medical Examiner’s Report
Removing Manual Entry
DeviceVendor.com
XYZ protocol
XYZ protocol
A Typical IoT Workflow
A Typical IoT Workflow
XYZ protocol
XYZ protocol
We’re not dealing with XYZ



Our server communicates with the vendor’s server 

using HTTPS

DeviceVendor.com
Integrating With Fitbit Scale: Take 1.
fitbit.com
My Front-End App
HTTP/Rest API
Weight:
Integrating With Fitbit Scale: Take 2.
fitbit.com
HTTP/Rest API
Weight:
My Front-End App
My Server
Polling/Pub-SubData push
via
WebSocket
Integrating With Fitbit and iHealthLabs.
fitbit.com
Weight:
iHealthLabs.com
HTTP/

Rest API
Blood Pressure:
HTTP/Rest API
Data push
via
WebSocket
My Front-End App
My Server
Adding OAuth Authentication
fitbit.com
Weight:
iHealthLabs.com
HTTP/

Rest API
Blood Pressure:
HTTP/Rest API
My Front-End App
My Server
Data push
via
WebSocket
Secret, key,
tokens from
each vendor are
here
The Final Architecture
fitbit.com
Weight:
iHealthLabs.com
HTTP/

Rest API
Blood Pressure:
HTTP/Rest API
My Front-End App
My Server
Data push
via
WebSocket
- Vendor’s consumer app
Secret, key,
tokens from
each vendor are
here
Demo
Measuring Blood Pressure
What’s used in our app
• RESTful Web services
• OAuth authentication and authorization
• WebSocket protocol
• Front end: written in Dart, deployed as JavaScript
• Data exchange format: JSON
• Back-end: Java with Spring Boot and embedded Tomcat
• Build automation: Gradle
© 2015 Farata Systems
REST API
REpresentational State of Transfer
© 2015 Farata Systems
HTTP Request and Java EE Rest Endpoint
A sample client’s HTTP request:
“https://iHealthLabs.com:8443/iotdemo/ihealth/bp"
© 2015 Farata Systems
HTTP Request and Java EE Rest Endpoint
A sample client’s HTTP request:
“https://iHealthLabs.com:8443/iotdemo/ihealth/bp"
// Configuring The App
@ApplicationPath(“iotdemo")
public class MyIoTApplication extends Application {

}
© 2015 Farata Systems
HTTP Request and Java EE Rest Endpoint
// Receiving and handling blood pressure on our server
@Path("/ihealth")

public class BloodPressureService {
// …
// The method to handle HTTP Get requests
@GET
@Path("/bp")

@Produces(“application/json")

public String getBloodPressureData() {
// The code to get bp and prepare JSON goes here 

return bloodPressure;

}
}
A sample client’s HTTP request:
“https://iHealthLabs.com:8443/iotdemo/ihealth/bp"
// Configuring The App
@ApplicationPath(“iotdemo")
public class MyIoTApplication extends Application {

}
© 2015 Farata Systems
A Rest Endpoint in Spring Framework
// The endpoint handling blood pressure
@RestController

@RequestMapping("/ihealth")

public class HealthLabsController {
// …
// The method to handle HTTP Get requests
@RequestMapping(value="/bp", method = RequestMethod.GET,

produces = "application/json")

public Measurement getBloodPressureData() {
// The code to get blood pressure goes here 

return bloodPressure;

}
}
OAuth 2
Authorizing an app to act on behalf of the user
Authorization and Authentication
• Authentication: Is the user who he says he is?
• Authorization: Which resources the user can access?
The owner of the Blood Pressure Monitor can see only the
measurments taken from his device.
The OAuth Players
• The User
• The client app that accesses the user’s resources
• The server with the user’s resources (data)
• The authorization server
Delegating Authorization to 3rd Party Servers
Bad
Delegating Authorization
Good
OAuth 2 Access Token
A client app needs to aquire an access token that
can be used on behalf of the user.
Typical OAuth 2 Workflows
• A client app is located on the user’s device
• A client app is located on the server (our use case)
iHealthLabs Authorization
(our 

server)
GUI
Redirect URI
A Sample OAuth 2 Workflow
• My company registers the app with the thing’s vendor providing a redirect
URI for successful and failed logins and gets a client id and a secret.
A Sample OAuth 2 Workflow
• My company registers the app with the thing’s vendor providing a redirect
URI for successful and failed logins and gets a client id and a secret.
• My company builds an app that uses the thing’s API (e.g. with REST ).
A Sample OAuth 2 Workflow
• My company registers the app with the thing’s vendor: providing a redirect
URI for successful and failed logins and gets a client id and a secret.
• My company builds an app that uses the thing’s API (e.g. with REST ).
• The user opens my app and logs into thing’s vendor site via its authentication
server (not the OAuth provider).
A Sample OAuth 2 Workflow
• My company registers the app with the thing’s vendor providing a redirect
URI for successful and failed logins and gets a client id and a secret.
• My company builds an app that uses the thing’s API (e.g. with REST )
• The user opens my app and logs into thing’s vendor site via its authentication
server (not the OAuth provider).
• My app (not the browser) generates the unguessable state value and sends
the request to the thing vendor’s OAuth provider:



https://<auth_server>/path?clientid=123&redirect_uri=https//
myCallbackURL&response_type=code&scope=“email
user_likes”&state=7F32G5
A Sample OAuth 2 Workflow
• My company registers the app with the thing’s vendor providing a redirect URI for successful
and failed logins and gets a client id and a secret.
• My company builds an app that uses the thing’s API (e.g. with REST )
• The user opens my app and logs into thing’s vendor site via its authentication server (not the
OAuth provider).
• My app (not the browser) generates the unguessable state value and sends the request to the
thing vendor’s OAuth provider:



https://<auth_server>/path?clientid=123&redirect_uri=https//
myCallbackURL&response_type=code&scope=“email user_likes”&state=7F32G5
• My app receives a temporary auth code from the thing’s OAuth server and compares the state
with the one received from the server:



https://myCallbackURL?code=54321&state=7F32G5
A Sample OAuth 2 Workflow
• My company registers the app with the thing’s vendor providing a redirect URI for successful and failed logins
and gets a client id and a secret.
• My company builds an app that uses the thing’s API (e.g. with REST )
• The user opens my app and logs into thing’s vendor site via its authentication server (not the OAuth provider).
• My app (not the browser) generates the unguessable state value and sends the request to the thing vendor’s
OAuth provider:



https://<auth_server>/path?clientid=123&redirect_uri=https//
myCallbackURL&response_type=code&scope=“email user_likes”&state=7F32G5
• My app receives temporary auth code from the thing’s OAuth server and compares the state with the one
received from the server:



https://myCallbackURL?code=54321&state=7F32G5
• ,My app makes another request adding the secret and exchanging the code for the authorization token:



https://<auth_server>/path?clientid=123&client_secret=…&code=54321&redirect_uri=

https//myCallbackURL&grant_type=authorization_code
A Sample OAuth 2 Workflow
• My company registers the app with the thing’s vendor: providing a redirect URI for successful and failed logins
and gets a client id and a secret.
• My company builds an app that uses the thing’s API (e.g. with REST )
• The user opens my app and logs into thing’s vendor site via its authentication server (not the OAuth provider).
• My app (not the browser) generates the unguessable state value and sends the request to the thing vendor’s
OAuth provider:



https://<auth_server>/path?clientid=123&redirect_uri=https//
myCallbackURL&response_type=code&scope=“email user_likes”&state=7F32G5
• My app receives temporary auth code from the thing’s OAuth server and compares the state with the one
received from the server:



https://myCallbackURL?code=54321&state=7F32G5
• ,My app makes another request adding the secret and exchanging the code for the authorization token:



https://<auth_server>/path?clientid=123&client_secret=…&code=54321&redirect_uri=

https//myCallbackURL&grant_type=authorization_code
• The thing’s vendor redirects the user to my app and returns the authorization token.
A Sample OAuth 2 Workflow
• My company registers the app with the thing’s vendor providing a redirect URI for successful and failed logins and
gets a client id and a secret.
• My company builds an app that uses the thing’s API (e.g. with REST )
• The user opens my app and logs into thing’s vendor site via its authentication server (not the OAuth provider).
• My app (not the browser) generates the unguessable state value and sends the request to the thing vendor’s OAuth
provider:



https://<auth_server>/path?clientid=123&redirect_uri=https//myCallbackURL&response_type=code&scope=“email
user_likes”&state=7F32G5
• My app receives temporary auth code from the thing’s OAuth server and compares the state with the one received
from the server:

https://myCallbackURL?code=54321&state=7F32G5
• ,My app makes another request adding the secret and exchanging the code for the authorization token:



https://<auth_server>/path?clientid=123&client_secret=…&code=54321&redirect_uri=

https//myCallbackURL&grant_type=authorization_code
• The thing’s vendor redirects the user to my app and provides the authorization token.
• My app starts invoking the vendor’s API using the token.
Access and Refresh Tokens
• The OAuth 2 server returns the authorization token. It
expires after certain time interval. iHealtLabs sends the
token in JSON format that expires in 10 min.
• The OAuth 2 server also can provide a refresh token that
the client app uses to request a new token instead of the
expired one.
© 2015 Farata Systems
WebSocket Protocol
Bi-directional communication for the Web
© 2015 Farata Systems
HTTP - Request/Response, Half Duplex

WebSocket - Full Duplex
© 2015 Farata Systems
Monitoring AJAX requests
© 2015 Farata Systems
WebSocket Workflow
• Establish connection with the service endpoint
upgrading the protocol from HTTP to WebSocket
• Send messages in both directions at the same time
(Full Duplex)
• Close the connection
© 2015 Farata Systems
Apps for Websockets
• Live trading/auctions/sports notifications
• Controlling medical equipment over the web
• Chat applications
• Multiplayer online games
• Any app that requires a data push from a server
© 2015 Farata Systems
WebSocket Client/Server handshake
• Client sends an UPGRADE HTTP-request
• Server confirms UPGRADE
• Client receives UPGRADE response
• Client setsreadyState=1 on the WebSocket object
© 2015 Farata Systems
The JavaScript Client
if (window.WebSocket) {
ws = new WebSocket("ws://www.websocket.org/echo");
ws.onopen = function() {
console.log("onopen");
};
ws.onmessage = function(e) {
console.log("echo from server : " + e.data);
};
ws.onclose = function() {
console.log("onclose");
};
ws.onerror = function() {
console.log("onerror");
};
} else {
console.log("WebSocket object is not supported");
}
ws.send(“Hello Server”);Sending a request:
© 2015 Farata Systems
Java EE WebSocket Server’s APIs
1. Annotated WebSocket endpoint
Annotate a POJO with @ServerEndpoint, and its methods with
@OnOpen,@OnMessage, @OnError,and @OnClose
2. Programmatic endpoint
Extend your class from javax.websocket.Endpoint and
override onOpen(), onMessage(), onError(), and onClose().
© 2015 Farata Systems
HelloWebSocket Server
@ServerEndpoint("/hello")
public class HelloWebSocket {
@OnOpen
public void greetTheClient(Session session){
try {
session.getBasicRemote().sendText("Hello stranger");
} catch (IOException ioe) {
System.out.println(ioe.getMessage());
}
}
}
The server-side push without client’s requests
A detailed description at http://bit.ly/1DHuKwg
© 2015 Farata Systems
Websockets with Spring Framework
public class WebSocketEndPoint extends TextWebSocketHandler {

private final static Logger LOG =
LoggerFactory.getLogger(WebSocketEndPoint.class);



private Gson gson;

private WebSocketSession currentSession;



@Override

public void afterConnectionEstablished(WebSocketSession session) throws
Exception {

super.afterConnectionEstablished(session);



setCurrentSession(session);

}



public boolean sendMeasurement(Measurement m) {

if (getCurrentSession() != null) {

TextMessage message = new TextMessage(getGson().toJson(m));



try {

getCurrentSession().sendMessage(message);

} catch (IOException e) {

e.printStackTrace();

return false;

}



return true;

} else {

LOG.info("Can not send message, session is not established.");

return false;

}

}

Deploying with Spring Boot
• Java EE REST services are deployed in a WAR under the external Java Server.
• Spring Boot allows creating a standalone app (a JAR) with an embedded servlet container.
• Starting our RESTful server: java -jar MyJar.
• We used Tomcat. To use another server, exclude Tomcat in build configuration and specify
another dependency.
• A sample section from Gradle build replacing Tomcat with Jetty:
dependencies {
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
}
compile("org.springframework.boot:spring-boot-starter-jetty")
}
Security
• Device vendors should take security very seriously.
• We don’t deal with security between the thing and its vendor.
• The OAuth state attribute helps ensuring that the received redirect_uri is the
same as provided during the app registration.
• IoT integration apps are as as secure as any other Web app (see owasp.org).
Thank you!
• Farata Systems: faratasystems.com
• email: yfain@faratasystems.com
• Twitter: @yfain
• My blog: yakovfain.com
• My podcast: americhka.us






More Related Content

What's hot

Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
Jadson Santos
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
Santhosh Kumar Srinivasan
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
Phan Tuan
 
Angular App Presentation
Angular App PresentationAngular App Presentation
Angular App Presentation
Elizabeth Long
 
Angular 4
Angular 4Angular 4
Angular 4
Saurabh Juneja
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
Ran Wahle
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
Scott Lee
 
Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training
Patrick Schroeder
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
Yakov Fain
 
Tech Webinar: Angular 2, Introduction to a new framework
Tech Webinar: Angular 2, Introduction to a new frameworkTech Webinar: Angular 2, Introduction to a new framework
Tech Webinar: Angular 2, Introduction to a new framework
Codemotion
 
Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020
Yakov Fain
 
Angular 2: core concepts
Angular 2: core conceptsAngular 2: core concepts
Angular 2: core concepts
Codemotion
 
Adding User Management to Node.js
Adding User Management to Node.jsAdding User Management to Node.js
Adding User Management to Node.js
Dev_Events
 
Angular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHEREAngular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHERE
Nadav Mary
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
Eliran Eliassy
 
Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework
Commit University
 
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 -  Fullstack end-to-end Test Automation with node.jsForwardJS 2017 -  Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
Mek Srunyu Stittri
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular App
Katy Slemon
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
Katy Slemon
 

What's hot (20)

Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
Angular App Presentation
Angular App PresentationAngular App Presentation
Angular App Presentation
 
Angular 4
Angular 4Angular 4
Angular 4
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
 
Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
 
Tech Webinar: Angular 2, Introduction to a new framework
Tech Webinar: Angular 2, Introduction to a new frameworkTech Webinar: Angular 2, Introduction to a new framework
Tech Webinar: Angular 2, Introduction to a new framework
 
Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020
 
Angular 2: core concepts
Angular 2: core conceptsAngular 2: core concepts
Angular 2: core concepts
 
Adding User Management to Node.js
Adding User Management to Node.jsAdding User Management to Node.js
Adding User Management to Node.js
 
Angular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHEREAngular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHERE
 
Angularjs
AngularjsAngularjs
Angularjs
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework
 
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 -  Fullstack end-to-end Test Automation with node.jsForwardJS 2017 -  Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular App
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
 

Viewers also liked

Fitbit presentation
Fitbit presentationFitbit presentation
Fitbit presentation
jryan39
 
Dart for Java Developers
Dart for Java DevelopersDart for Java Developers
Dart for Java Developers
Yakov Fain
 
Cours java smi 2007 2008
Cours java smi 2007 2008Cours java smi 2007 2008
Cours java smi 2007 2008Khalil Lechheb
 
Introduction àJava
Introduction àJavaIntroduction àJava
Introduction àJava
Christophe Vaudry
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Shekhar Gulati
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoT
Virtual JBoss User Group
 
Bonnes pratiques des applications java prêtes pour la production
Bonnes pratiques des applications java prêtes pour la productionBonnes pratiques des applications java prêtes pour la production
Bonnes pratiques des applications java prêtes pour la production
Cyrille Le Clerc
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
Yakov Fain
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoT
dejanb
 
AngularJS for Java Developers
AngularJS for Java DevelopersAngularJS for Java Developers
AngularJS for Java Developers
Loc Nguyen
 
Reactive Thinking in Java
Reactive Thinking in JavaReactive Thinking in Java
Reactive Thinking in Java
Yakov Fain
 
Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai]
Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai]Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai]
Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai]Shreeraj Shah
 
MQTT – protocol for yours IoT
MQTT – protocol for yours IoTMQTT – protocol for yours IoT
MQTT – protocol for yours IoT
Miroslav Resetar
 
Connect to the IoT with a lightweight protocol MQTT
Connect to the IoT with a lightweight protocol MQTTConnect to the IoT with a lightweight protocol MQTT
Connect to the IoT with a lightweight protocol MQTT
Kenneth Peeples
 
MQTT 101 - Getting started with the lightweight IoT Protocol
MQTT 101  - Getting started with the lightweight IoT ProtocolMQTT 101  - Getting started with the lightweight IoT Protocol
MQTT 101 - Getting started with the lightweight IoT Protocol
Christian Götz
 
Protocols for IoT
Protocols for IoTProtocols for IoT
Protocols for IoT
Aravindhan G K
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitMichael Koster
 
qsqs-141129025329-conversion-gate01.pdf
qsqs-141129025329-conversion-gate01.pdfqsqs-141129025329-conversion-gate01.pdf
qsqs-141129025329-conversion-gate01.pdfrivenhau
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Shekhar Gulati
 
MQTT with Java - a protocol for IoT and M2M communication
MQTT with Java - a protocol for IoT and M2M communicationMQTT with Java - a protocol for IoT and M2M communication
MQTT with Java - a protocol for IoT and M2M communication
Christian Götz
 

Viewers also liked (20)

Fitbit presentation
Fitbit presentationFitbit presentation
Fitbit presentation
 
Dart for Java Developers
Dart for Java DevelopersDart for Java Developers
Dart for Java Developers
 
Cours java smi 2007 2008
Cours java smi 2007 2008Cours java smi 2007 2008
Cours java smi 2007 2008
 
Introduction àJava
Introduction àJavaIntroduction àJava
Introduction àJava
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoT
 
Bonnes pratiques des applications java prêtes pour la production
Bonnes pratiques des applications java prêtes pour la productionBonnes pratiques des applications java prêtes pour la production
Bonnes pratiques des applications java prêtes pour la production
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoT
 
AngularJS for Java Developers
AngularJS for Java DevelopersAngularJS for Java Developers
AngularJS for Java Developers
 
Reactive Thinking in Java
Reactive Thinking in JavaReactive Thinking in Java
Reactive Thinking in Java
 
Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai]
Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai]Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai]
Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai]
 
MQTT – protocol for yours IoT
MQTT – protocol for yours IoTMQTT – protocol for yours IoT
MQTT – protocol for yours IoT
 
Connect to the IoT with a lightweight protocol MQTT
Connect to the IoT with a lightweight protocol MQTTConnect to the IoT with a lightweight protocol MQTT
Connect to the IoT with a lightweight protocol MQTT
 
MQTT 101 - Getting started with the lightweight IoT Protocol
MQTT 101  - Getting started with the lightweight IoT ProtocolMQTT 101  - Getting started with the lightweight IoT Protocol
MQTT 101 - Getting started with the lightweight IoT Protocol
 
Protocols for IoT
Protocols for IoTProtocols for IoT
Protocols for IoT
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT Toolkit
 
qsqs-141129025329-conversion-gate01.pdf
qsqs-141129025329-conversion-gate01.pdfqsqs-141129025329-conversion-gate01.pdf
qsqs-141129025329-conversion-gate01.pdf
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJS
 
MQTT with Java - a protocol for IoT and M2M communication
MQTT with Java - a protocol for IoT and M2M communicationMQTT with Java - a protocol for IoT and M2M communication
MQTT with Java - a protocol for IoT and M2M communication
 

Similar to RESTful services and OAUTH protocol in IoT

Big commerce app development
Big commerce app developmentBig commerce app development
Big commerce app development
Nascenia IT
 
Intro to OAuth2 and OpenID Connect
Intro to OAuth2 and OpenID ConnectIntro to OAuth2 and OpenID Connect
Intro to OAuth2 and OpenID Connect
LiamWadman
 
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013Aaron Parecki
 
Deep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected AppsDeep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected Apps
Salesforce Developers
 
Deep dive into Salesforce Connected App
Deep dive into Salesforce Connected AppDeep dive into Salesforce Connected App
Deep dive into Salesforce Connected App
Dhanik Sahni
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTStateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWT
Gaurav Roy
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWTStateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWT
Mobiliya
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
Gaston Cruz
 
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
Apigee | Google Cloud
 
OAuth2 primer
OAuth2 primerOAuth2 primer
OAuth2 primer
Manish Pandit
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportGaurav Sharma
 
.NET Core, ASP.NET Core Course, Session 19
 .NET Core, ASP.NET Core Course, Session 19 .NET Core, ASP.NET Core Course, Session 19
.NET Core, ASP.NET Core Course, Session 19
aminmesbahi
 
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Microservice security with spring security 5.1,Oauth 2.0 and open id connect Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Nilanjan Roy
 
OAuth for QuickBooks Online REST Services
OAuth for QuickBooks Online REST ServicesOAuth for QuickBooks Online REST Services
OAuth for QuickBooks Online REST Services
Intuit Developer
 
Silicon Valley Code Camp 2009: OAuth: What, Why and How
Silicon Valley Code Camp 2009: OAuth: What, Why and HowSilicon Valley Code Camp 2009: OAuth: What, Why and How
Silicon Valley Code Camp 2009: OAuth: What, Why and How
Manish Pandit
 
Securing APIs with OAuth 2.0
Securing APIs with OAuth 2.0Securing APIs with OAuth 2.0
Securing APIs with OAuth 2.0
Kai Hofstetter
 
Authentication with OAuth and Connected Apps
Authentication with OAuth and Connected AppsAuthentication with OAuth and Connected Apps
Authentication with OAuth and Connected AppsSalesforce Developers
 
oauth-for-credentials-security-in-rest-api-access
oauth-for-credentials-security-in-rest-api-accessoauth-for-credentials-security-in-rest-api-access
oauth-for-credentials-security-in-rest-api-access
idsecconf
 

Similar to RESTful services and OAUTH protocol in IoT (20)

Big commerce app development
Big commerce app developmentBig commerce app development
Big commerce app development
 
Intro to OAuth2 and OpenID Connect
Intro to OAuth2 and OpenID ConnectIntro to OAuth2 and OpenID Connect
Intro to OAuth2 and OpenID Connect
 
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
 
Deep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected AppsDeep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected Apps
 
Deep dive into Salesforce Connected App
Deep dive into Salesforce Connected AppDeep dive into Salesforce Connected App
Deep dive into Salesforce Connected App
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTStateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWT
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWTStateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWT
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
 
Iam f42 a
Iam f42 aIam f42 a
Iam f42 a
 
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
 
OAuth2 primer
OAuth2 primerOAuth2 primer
OAuth2 primer
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
 
.NET Core, ASP.NET Core Course, Session 19
 .NET Core, ASP.NET Core Course, Session 19 .NET Core, ASP.NET Core Course, Session 19
.NET Core, ASP.NET Core Course, Session 19
 
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Microservice security with spring security 5.1,Oauth 2.0 and open id connect Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
 
OAuth for QuickBooks Online REST Services
OAuth for QuickBooks Online REST ServicesOAuth for QuickBooks Online REST Services
OAuth for QuickBooks Online REST Services
 
ATD11_WebAPISecurity
ATD11_WebAPISecurityATD11_WebAPISecurity
ATD11_WebAPISecurity
 
Silicon Valley Code Camp 2009: OAuth: What, Why and How
Silicon Valley Code Camp 2009: OAuth: What, Why and HowSilicon Valley Code Camp 2009: OAuth: What, Why and How
Silicon Valley Code Camp 2009: OAuth: What, Why and How
 
Securing APIs with OAuth 2.0
Securing APIs with OAuth 2.0Securing APIs with OAuth 2.0
Securing APIs with OAuth 2.0
 
Authentication with OAuth and Connected Apps
Authentication with OAuth and Connected AppsAuthentication with OAuth and Connected Apps
Authentication with OAuth and Connected Apps
 
oauth-for-credentials-security-in-rest-api-access
oauth-for-credentials-security-in-rest-api-accessoauth-for-credentials-security-in-rest-api-access
oauth-for-credentials-security-in-rest-api-access
 

More from Yakov Fain

Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
Yakov Fain
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
Yakov Fain
 
Reactive Streams and RxJava2
Reactive Streams and RxJava2Reactive Streams and RxJava2
Reactive Streams and RxJava2
Yakov Fain
 
Using JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot apps
Yakov Fain
 
Reactive programming in Angular 2
Reactive programming in Angular 2Reactive programming in Angular 2
Reactive programming in Angular 2
Yakov Fain
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java Developers
Yakov Fain
 
Java Intro: Unit1. Hello World
Java Intro: Unit1. Hello WorldJava Intro: Unit1. Hello World
Java Intro: Unit1. Hello World
Yakov Fain
 
Running a Virtual Company
Running a Virtual CompanyRunning a Virtual Company
Running a Virtual Company
Yakov Fain
 
Princeton jug git_github
Princeton jug git_githubPrinceton jug git_github
Princeton jug git_github
Yakov Fain
 
Speed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsSpeed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSockets
Yakov Fain
 
Surviving as a Professional Software Developer
Surviving as a Professional Software DeveloperSurviving as a Professional Software Developer
Surviving as a Professional Software Developer
Yakov Fain
 
Becoming a professional software developer
Becoming a professional software developerBecoming a professional software developer
Becoming a professional software developer
Yakov Fain
 

More from Yakov Fain (12)

Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
 
Reactive Streams and RxJava2
Reactive Streams and RxJava2Reactive Streams and RxJava2
Reactive Streams and RxJava2
 
Using JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot apps
 
Reactive programming in Angular 2
Reactive programming in Angular 2Reactive programming in Angular 2
Reactive programming in Angular 2
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java Developers
 
Java Intro: Unit1. Hello World
Java Intro: Unit1. Hello WorldJava Intro: Unit1. Hello World
Java Intro: Unit1. Hello World
 
Running a Virtual Company
Running a Virtual CompanyRunning a Virtual Company
Running a Virtual Company
 
Princeton jug git_github
Princeton jug git_githubPrinceton jug git_github
Princeton jug git_github
 
Speed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsSpeed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSockets
 
Surviving as a Professional Software Developer
Surviving as a Professional Software DeveloperSurviving as a Professional Software Developer
Surviving as a Professional Software Developer
 
Becoming a professional software developer
Becoming a professional software developerBecoming a professional software developer
Becoming a professional software developer
 

Recently uploaded

BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 

Recently uploaded (20)

BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 

RESTful services and OAUTH protocol in IoT

  • 1. RESTful services and OAUTH protocol in IoT by Yakov Fain, Farata Systems
  • 2. Farata Systems and SuranceBay surancebay.com faratasystems.com
  • 3. The three parts of this presentation • One approach to integrating consumer devices in the business workflow • Live demo: integrating a blood pressure monitor into a business workflow • A brief review of REST, OAUTH, Websockets and their roles tin our application.
  • 4. Yesterday’s Sensors (Things) • 18 years ago. Telephony. • I’ve been programming IoT!
  • 5. Today’s Sensors
 SCIO: a molecular sensor that scans physical objects and receives instant information to your smartphone. http://www.consumerphysics.com/
  • 6. Tomorrow: Streachable Wearables
 epidermal electronics Source: http://bit.ly/1uu0srr
  • 7. A thing is an app + an API + a Web site.
  • 8. Smartphone
 app Device
 Manufacturer’s
 Server Device A Typical Consumer Device Setup Bluetooth or NFC MQTT, CoAp, … MQTT, CoAp, …
  • 9. Low-Level IoT Approach Learn and implement IoT protocols: MQTT, XMPP, AMQP, CoAp,… Write Java programs for Raspberry Pi or Arduino
 Learn HomeKit and HealthKit from Apple
  • 10. High-Level IoT Approach Create applications using standard technologies to integrate things into an existing business workflow.
  • 11. A Proof of Concept App • Integrate consumer devices into one of the insurance business workflows • Leverage existing software technologies • Create a standard-based application layer that connects things
  • 12. Your Server in the Middle • Create a software layer as a proxy for all communications with IoT devices. • Find the use-cases for data-gathering devices in your business applications. • Collect the valuable data from devices for analisys. Java dominates on the middleware market.
  • 13. The Use Case: Integrating Scale and Blood Pressure Monitor
 into insurance workflow IHealthLabs Blood
 Pressure Monitor Fitbit Scale
 Aria
  • 16. A Typical IoT Workflow XYZ protocol XYZ protocol We’re not dealing with XYZ
 
 Our server communicates with the vendor’s server 
 using HTTPS
 DeviceVendor.com
  • 17. Integrating With Fitbit Scale: Take 1. fitbit.com My Front-End App HTTP/Rest API Weight:
  • 18. Integrating With Fitbit Scale: Take 2. fitbit.com HTTP/Rest API Weight: My Front-End App My Server Polling/Pub-SubData push via WebSocket
  • 19. Integrating With Fitbit and iHealthLabs. fitbit.com Weight: iHealthLabs.com HTTP/
 Rest API Blood Pressure: HTTP/Rest API Data push via WebSocket My Front-End App My Server
  • 20. Adding OAuth Authentication fitbit.com Weight: iHealthLabs.com HTTP/
 Rest API Blood Pressure: HTTP/Rest API My Front-End App My Server Data push via WebSocket Secret, key, tokens from each vendor are here
  • 21. The Final Architecture fitbit.com Weight: iHealthLabs.com HTTP/
 Rest API Blood Pressure: HTTP/Rest API My Front-End App My Server Data push via WebSocket - Vendor’s consumer app Secret, key, tokens from each vendor are here
  • 23. What’s used in our app • RESTful Web services • OAuth authentication and authorization • WebSocket protocol • Front end: written in Dart, deployed as JavaScript • Data exchange format: JSON • Back-end: Java with Spring Boot and embedded Tomcat • Build automation: Gradle
  • 24. © 2015 Farata Systems REST API REpresentational State of Transfer
  • 25. © 2015 Farata Systems HTTP Request and Java EE Rest Endpoint A sample client’s HTTP request: “https://iHealthLabs.com:8443/iotdemo/ihealth/bp"
  • 26. © 2015 Farata Systems HTTP Request and Java EE Rest Endpoint A sample client’s HTTP request: “https://iHealthLabs.com:8443/iotdemo/ihealth/bp" // Configuring The App @ApplicationPath(“iotdemo") public class MyIoTApplication extends Application {
 }
  • 27. © 2015 Farata Systems HTTP Request and Java EE Rest Endpoint // Receiving and handling blood pressure on our server @Path("/ihealth")
 public class BloodPressureService { // … // The method to handle HTTP Get requests @GET @Path("/bp")
 @Produces(“application/json")
 public String getBloodPressureData() { // The code to get bp and prepare JSON goes here 
 return bloodPressure;
 } } A sample client’s HTTP request: “https://iHealthLabs.com:8443/iotdemo/ihealth/bp" // Configuring The App @ApplicationPath(“iotdemo") public class MyIoTApplication extends Application {
 }
  • 28. © 2015 Farata Systems A Rest Endpoint in Spring Framework // The endpoint handling blood pressure @RestController
 @RequestMapping("/ihealth")
 public class HealthLabsController { // … // The method to handle HTTP Get requests @RequestMapping(value="/bp", method = RequestMethod.GET,
 produces = "application/json")
 public Measurement getBloodPressureData() { // The code to get blood pressure goes here 
 return bloodPressure;
 } }
  • 29. OAuth 2 Authorizing an app to act on behalf of the user
  • 30. Authorization and Authentication • Authentication: Is the user who he says he is? • Authorization: Which resources the user can access? The owner of the Blood Pressure Monitor can see only the measurments taken from his device.
  • 31. The OAuth Players • The User • The client app that accesses the user’s resources • The server with the user’s resources (data) • The authorization server
  • 32. Delegating Authorization to 3rd Party Servers
  • 34. OAuth 2 Access Token A client app needs to aquire an access token that can be used on behalf of the user.
  • 35. Typical OAuth 2 Workflows • A client app is located on the user’s device • A client app is located on the server (our use case)
  • 37. A Sample OAuth 2 Workflow • My company registers the app with the thing’s vendor providing a redirect URI for successful and failed logins and gets a client id and a secret.
  • 38. A Sample OAuth 2 Workflow • My company registers the app with the thing’s vendor providing a redirect URI for successful and failed logins and gets a client id and a secret. • My company builds an app that uses the thing’s API (e.g. with REST ).
  • 39. A Sample OAuth 2 Workflow • My company registers the app with the thing’s vendor: providing a redirect URI for successful and failed logins and gets a client id and a secret. • My company builds an app that uses the thing’s API (e.g. with REST ). • The user opens my app and logs into thing’s vendor site via its authentication server (not the OAuth provider).
  • 40. A Sample OAuth 2 Workflow • My company registers the app with the thing’s vendor providing a redirect URI for successful and failed logins and gets a client id and a secret. • My company builds an app that uses the thing’s API (e.g. with REST ) • The user opens my app and logs into thing’s vendor site via its authentication server (not the OAuth provider). • My app (not the browser) generates the unguessable state value and sends the request to the thing vendor’s OAuth provider:
 
 https://<auth_server>/path?clientid=123&redirect_uri=https// myCallbackURL&response_type=code&scope=“email user_likes”&state=7F32G5
  • 41. A Sample OAuth 2 Workflow • My company registers the app with the thing’s vendor providing a redirect URI for successful and failed logins and gets a client id and a secret. • My company builds an app that uses the thing’s API (e.g. with REST ) • The user opens my app and logs into thing’s vendor site via its authentication server (not the OAuth provider). • My app (not the browser) generates the unguessable state value and sends the request to the thing vendor’s OAuth provider:
 
 https://<auth_server>/path?clientid=123&redirect_uri=https// myCallbackURL&response_type=code&scope=“email user_likes”&state=7F32G5 • My app receives a temporary auth code from the thing’s OAuth server and compares the state with the one received from the server:
 
 https://myCallbackURL?code=54321&state=7F32G5
  • 42. A Sample OAuth 2 Workflow • My company registers the app with the thing’s vendor providing a redirect URI for successful and failed logins and gets a client id and a secret. • My company builds an app that uses the thing’s API (e.g. with REST ) • The user opens my app and logs into thing’s vendor site via its authentication server (not the OAuth provider). • My app (not the browser) generates the unguessable state value and sends the request to the thing vendor’s OAuth provider:
 
 https://<auth_server>/path?clientid=123&redirect_uri=https// myCallbackURL&response_type=code&scope=“email user_likes”&state=7F32G5 • My app receives temporary auth code from the thing’s OAuth server and compares the state with the one received from the server:
 
 https://myCallbackURL?code=54321&state=7F32G5 • ,My app makes another request adding the secret and exchanging the code for the authorization token:
 
 https://<auth_server>/path?clientid=123&client_secret=…&code=54321&redirect_uri=
 https//myCallbackURL&grant_type=authorization_code
  • 43. A Sample OAuth 2 Workflow • My company registers the app with the thing’s vendor: providing a redirect URI for successful and failed logins and gets a client id and a secret. • My company builds an app that uses the thing’s API (e.g. with REST ) • The user opens my app and logs into thing’s vendor site via its authentication server (not the OAuth provider). • My app (not the browser) generates the unguessable state value and sends the request to the thing vendor’s OAuth provider:
 
 https://<auth_server>/path?clientid=123&redirect_uri=https// myCallbackURL&response_type=code&scope=“email user_likes”&state=7F32G5 • My app receives temporary auth code from the thing’s OAuth server and compares the state with the one received from the server:
 
 https://myCallbackURL?code=54321&state=7F32G5 • ,My app makes another request adding the secret and exchanging the code for the authorization token:
 
 https://<auth_server>/path?clientid=123&client_secret=…&code=54321&redirect_uri=
 https//myCallbackURL&grant_type=authorization_code • The thing’s vendor redirects the user to my app and returns the authorization token.
  • 44. A Sample OAuth 2 Workflow • My company registers the app with the thing’s vendor providing a redirect URI for successful and failed logins and gets a client id and a secret. • My company builds an app that uses the thing’s API (e.g. with REST ) • The user opens my app and logs into thing’s vendor site via its authentication server (not the OAuth provider). • My app (not the browser) generates the unguessable state value and sends the request to the thing vendor’s OAuth provider:
 
 https://<auth_server>/path?clientid=123&redirect_uri=https//myCallbackURL&response_type=code&scope=“email user_likes”&state=7F32G5 • My app receives temporary auth code from the thing’s OAuth server and compares the state with the one received from the server:
 https://myCallbackURL?code=54321&state=7F32G5 • ,My app makes another request adding the secret and exchanging the code for the authorization token:
 
 https://<auth_server>/path?clientid=123&client_secret=…&code=54321&redirect_uri=
 https//myCallbackURL&grant_type=authorization_code • The thing’s vendor redirects the user to my app and provides the authorization token. • My app starts invoking the vendor’s API using the token.
  • 45. Access and Refresh Tokens • The OAuth 2 server returns the authorization token. It expires after certain time interval. iHealtLabs sends the token in JSON format that expires in 10 min. • The OAuth 2 server also can provide a refresh token that the client app uses to request a new token instead of the expired one.
  • 46. © 2015 Farata Systems WebSocket Protocol Bi-directional communication for the Web
  • 47. © 2015 Farata Systems HTTP - Request/Response, Half Duplex
 WebSocket - Full Duplex
  • 48. © 2015 Farata Systems Monitoring AJAX requests
  • 49. © 2015 Farata Systems WebSocket Workflow • Establish connection with the service endpoint upgrading the protocol from HTTP to WebSocket • Send messages in both directions at the same time (Full Duplex) • Close the connection
  • 50. © 2015 Farata Systems Apps for Websockets • Live trading/auctions/sports notifications • Controlling medical equipment over the web • Chat applications • Multiplayer online games • Any app that requires a data push from a server
  • 51. © 2015 Farata Systems WebSocket Client/Server handshake • Client sends an UPGRADE HTTP-request • Server confirms UPGRADE • Client receives UPGRADE response • Client setsreadyState=1 on the WebSocket object
  • 52. © 2015 Farata Systems The JavaScript Client if (window.WebSocket) { ws = new WebSocket("ws://www.websocket.org/echo"); ws.onopen = function() { console.log("onopen"); }; ws.onmessage = function(e) { console.log("echo from server : " + e.data); }; ws.onclose = function() { console.log("onclose"); }; ws.onerror = function() { console.log("onerror"); }; } else { console.log("WebSocket object is not supported"); } ws.send(“Hello Server”);Sending a request:
  • 53. © 2015 Farata Systems Java EE WebSocket Server’s APIs 1. Annotated WebSocket endpoint Annotate a POJO with @ServerEndpoint, and its methods with @OnOpen,@OnMessage, @OnError,and @OnClose 2. Programmatic endpoint Extend your class from javax.websocket.Endpoint and override onOpen(), onMessage(), onError(), and onClose().
  • 54. © 2015 Farata Systems HelloWebSocket Server @ServerEndpoint("/hello") public class HelloWebSocket { @OnOpen public void greetTheClient(Session session){ try { session.getBasicRemote().sendText("Hello stranger"); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } } } The server-side push without client’s requests A detailed description at http://bit.ly/1DHuKwg
  • 55. © 2015 Farata Systems Websockets with Spring Framework public class WebSocketEndPoint extends TextWebSocketHandler {
 private final static Logger LOG = LoggerFactory.getLogger(WebSocketEndPoint.class);
 
 private Gson gson;
 private WebSocketSession currentSession;
 
 @Override
 public void afterConnectionEstablished(WebSocketSession session) throws Exception {
 super.afterConnectionEstablished(session);
 
 setCurrentSession(session);
 }
 
 public boolean sendMeasurement(Measurement m) {
 if (getCurrentSession() != null) {
 TextMessage message = new TextMessage(getGson().toJson(m));
 
 try {
 getCurrentSession().sendMessage(message);
 } catch (IOException e) {
 e.printStackTrace();
 return false;
 }
 
 return true;
 } else {
 LOG.info("Can not send message, session is not established.");
 return false;
 }
 }

  • 56. Deploying with Spring Boot • Java EE REST services are deployed in a WAR under the external Java Server. • Spring Boot allows creating a standalone app (a JAR) with an embedded servlet container. • Starting our RESTful server: java -jar MyJar. • We used Tomcat. To use another server, exclude Tomcat in build configuration and specify another dependency. • A sample section from Gradle build replacing Tomcat with Jetty: dependencies { compile("org.springframework.boot:spring-boot-starter-web") { exclude module: "spring-boot-starter-tomcat" } compile("org.springframework.boot:spring-boot-starter-jetty") }
  • 57. Security • Device vendors should take security very seriously. • We don’t deal with security between the thing and its vendor. • The OAuth state attribute helps ensuring that the received redirect_uri is the same as provided during the app registration. • IoT integration apps are as as secure as any other Web app (see owasp.org).
  • 58. Thank you! • Farata Systems: faratasystems.com • email: yfain@faratasystems.com • Twitter: @yfain • My blog: yakovfain.com • My podcast: americhka.us