SlideShare a Scribd company logo
Federated	
  Iden*ty	
  for	
  IoT	
  with	
  
OAuth	
  
Paul	
  Fremantle	
  
CTO,	
  WSO2	
  (paul@wso2.com)	
  
PhD	
  researcher,	
  Portsmouth	
  University	
  
(paul.fremantle@port.ac.uk)	
  	
  
@pzfreo	
  
How	
  this	
  will	
  work	
  
•  Quick	
  intro	
  to	
  Federated	
  Iden*ty	
  and	
  Access	
  
Management	
  
•  Even	
  quicker	
  introduc*on	
  to	
  OAuth2	
  
•  MQTT	
  overview	
  
•  Demo	
  
•  Issues	
  
•  Next	
  steps	
  
Federated Identity for IoT with OAuth2
What	
  is	
  Federated	
  Iden*ty	
  and	
  Access	
  
Management	
  (FIAM)?	
  
Federated	
  IAM	
  aims	
  to	
  give	
  You	
  control	
  over	
  
your	
  creden*als	
  and	
  access:	
  
•  You	
  don’t	
  give	
  your	
  userid/pw	
  to	
  anyone	
  
•  You	
  control	
  the	
  grant	
  of	
  permissions	
  
•  LinkedIn	
  example	
  
•  OAuth2	
  emerging	
  as	
  widely	
  used	
  approach	
  
	
  
	
  
Why	
  FIAM	
  for	
  IoT?	
  
•  Your	
  device	
  =	
  Your	
  data	
  
•  Tokens	
  are	
  beYer	
  than	
  u/p	
  for	
  devices	
  
•  Manage	
  tokens	
  and	
  scopes	
  independently	
  of	
  
the	
  device	
  	
  
Tokens	
  
Why	
  OAuth2?	
  
•  Widely	
  implemented	
  
•  PreYy	
  good	
  	
  
–  Of	
  course	
  there	
  is	
  never	
  100%	
  agreement	
  
–  Or	
  certainty	
  with	
  security	
  protocols	
  

•  Not	
  just	
  HTTP:	
  
–  hYp://tools.ie^.org/html/dra_-­‐ie^-­‐kiYen-­‐sasl-­‐
oauth-­‐12	
  
–  OAuth2	
  used	
  with	
  SSL	
  
	
  	
  
Three-­‐legged	
  OAuth	
  
MQTT	
  
MQTT	
  
•  Very	
  lightweight	
  messaging	
  protocol	
  

–  Designed	
  for	
  8-­‐bit	
  controllers,	
  SCADA,	
  etc	
  
–  Low	
  power,	
  low	
  bandwidth	
  
–  Binary	
  header	
  of	
  2	
  bytes	
  
–  Lots	
  of	
  implementa*ons	
  
•  MosquiYo	
  from	
  Eclipse	
  
•  Apache	
  Ac*veMQ	
  and	
  Apollo	
  

–  Clients:	
  

•  Arduino,	
  Perl,	
  Python,	
  PHP,	
  C,	
  Java,	
  JS/Node.js,	
  .Net,	
  etc	
  

•  Plus	
  an	
  even	
  lighter-­‐weight	
  version	
  for	
  Zigbee	
  
–  MQTT-­‐SN	
  (Sensor	
  Network)	
  
Federated Identity for IoT with OAuth2
CreateToken.py	
  

Demo	
  components	
  
	
  

1

Refresher.py	
  
2

Arduino	
  

3
5

4
MosquiYo	
  
(Open	
  Source	
  MQTT	
  
Broker)	
  
	
  
Ac*ng	
  as	
  “Resource	
  
Server”	
  
	
  
MosquiYo_py_auth	
  
	
  
mqY-­‐oauth2.py	
  

IdP	
  
	
  
WSO2	
  Iden*ty	
  
Server	
  

6

ESB	
  
Introspec*on	
  
API	
  
Demo	
  steps	
  
1.	
  Get	
  an	
  access-­‐token	
  /	
  refresh-­‐token	
  
2.	
  Encode	
  it	
  into	
  the	
  Arduino	
  code,	
  compile,	
  burn	
  
3.	
  Reboot	
  Arduino	
  
4.	
  Arduino	
  tries	
  access	
  token	
  
5.	
  Arduino	
  connects	
  as	
  “refresh	
  user”	
  and	
  requests	
  refresh	
  
token	
  
•  6.	
  Arduino	
  receives	
  updated	
  access	
  token	
  and	
  reconnects	
  	
  
•  7.	
  Arduino	
  starts	
  to	
  publish	
  data	
  (assuming	
  it	
  is	
  allowed!)	
  
•  8.	
  Python	
  client	
  receives	
  data	
  using	
  a	
  previously	
  authorized	
  
token	
  
• 
• 
• 
• 
• 
Step	
  1.	
  Get	
  a	
  token	
  
•  Simple	
  python	
  script	
  and	
  web	
  browser	
  
•  Encodes	
  the	
  requested	
  permission	
  “scopes”	
  as	
  
b64	
  encoded	
  JSON	
  (ugly	
  but	
  works!)	
  
•  scope	
  =	
  '[{"rw":"w","topic":"/pzf/#"}]’	
  
•  IdP	
  =	
  WSO2	
  Iden*ty	
  Server	
  
–  	
  open	
  source	
  Oauth	
  server	
  

•  Redirects	
  to	
  a	
  localhost	
  server	
  which	
  prints	
  
the	
  code	
  
Step	
  2.	
  Burn	
  into	
  Arduino	
  
•  LiYle	
  program	
  burns	
  into	
  EEPROM	
  
	
  
Step	
  3,	
  4,	
  5,	
  6	
  	
  
Recode	
  Arduino	
  with	
  App	
  
•  App	
  tries	
  access	
  token	
  to	
  CONNECT	
  
•  If	
  fails,	
  retries	
  as	
  user	
  “r”	
  (refresh)	
  
–  Ideally	
  this	
  would	
  be	
  a	
  separate	
  server	
  /	
  IdP-­‐based	
  
broker	
  

•  Sends	
  {clien*d,	
  refresh_token}	
  to	
  topic	
  /r	
  
•  Subscribes	
  to	
  /c/{clien*d}	
  
•  When	
  new	
  access_token	
  arrives,	
  saves	
  in	
  
EEPROM	
  and	
  reconnects	
  
Step	
  7.	
  Arduino	
  publishes	
  data	
  
•  MPU	
  9150	
  
•  Yaw,	
  Pitch,	
  Roll	
  
•  Every	
  publish	
  is	
  validated	
  against	
  the	
  IdP	
  
–  Should	
  be	
  cached	
  by	
  the	
  resource	
  server	
  
Step	
  8.	
  Python	
  client	
  subscribes	
  
•  Subscriber.py	
  
Lessons	
  learnt	
  
•  MQTT	
  and	
  MPU	
  /	
  I2C	
  code	
  is	
  97%	
  of	
  Duemilanove	
  

–  Adding	
  the	
  final	
  logic	
  to	
  do	
  OAuth2	
  flow	
  pushed	
  it	
  to	
  99%	
  
–  No	
  TLS	
  in	
  this	
  demo	
  is	
  a	
  big	
  issue	
  

•  Different	
  Oauth	
  implementa*ons	
  behave	
  differently	
  (e.g.	
  
changing	
  the	
  refresh	
  token	
  every	
  *me	
  you	
  refresh)	
  
•  Need	
  to	
  be	
  able	
  to	
  update	
  the	
  scope	
  of	
  token	
  if	
  this	
  will	
  
work	
  for	
  long	
  term	
  embedded	
  devices	
  
•  The	
  refresh	
  flow	
  should	
  not	
  really	
  go	
  via	
  the	
  Resource	
  
server	
  
–  Easy	
  fix	
  	
  

•  MQTT	
  should	
  have	
  a	
  well	
  defined	
  model	
  for	
  sending	
  a	
  
message	
  to	
  just	
  one	
  client	
  (securely)	
  
Next	
  steps	
  
• 
• 
• 
• 
• 

Do	
  the	
  same	
  for	
  CoAP	
  /	
  other	
  IoT	
  protocols	
  
Implement	
  solidly	
  J	
  
Gain	
  agreement	
  on	
  the	
  specific	
  MQTT	
  
Other	
  FIAM	
  approaches	
  for	
  IoT?	
  
Please	
  feel	
  free	
  to	
  contact	
  me:	
  
–  @pzfreo	
  
–  paul@wso2.com	
  
Ques*ons?	
  

More Related Content

PPTX
Securing the Internet of Things
PPTX
The use case for Cassandra at Ping Identity
PDF
OAuth2 for IoT Security: Why OpenID Connect & UMA Are They Key
PPTX
IoT World - creating a secure robust IoT reference architecture
PPTX
Anonymous Individual Integration for IoT
PPTX
Devising a practical approach to the Internet of Things
PPTX
IoT Security: Cases and Methods [CON5446]
PPTX
Jamie Bowser - A Touch(ID) of iOS Security
Securing the Internet of Things
The use case for Cassandra at Ping Identity
OAuth2 for IoT Security: Why OpenID Connect & UMA Are They Key
IoT World - creating a secure robust IoT reference architecture
Anonymous Individual Integration for IoT
Devising a practical approach to the Internet of Things
IoT Security: Cases and Methods [CON5446]
Jamie Bowser - A Touch(ID) of iOS Security

What's hot (20)

PPTX
OpenId Connect Protocol
PDF
IoT Security in Action - Boston Sept 2015
PDF
PPTX
Creator IoT Framework
PDF
CIS 2015 How to secure the Internet of Things? Hannes Tschofenig
PPTX
Security in microservices architectures
PPTX
PPTX
Cryptzone: What is a Software-Defined Perimeter?
PPTX
IoT on Azure
PPTX
Azure IoT suite - A look behind the curtain (Sam Vanhoutte @AZUG Event)
PPTX
Developing an IoT System FIWARE Based from the Scratch
PPTX
Iot top 10 vulnerabilities and misconceptions 2016
PPTX
Using an Open Source RESTful Backend for IoT Applications
PPTX
Cryptzone: The Software-Defined Perimeter
PDF
Microservices Security: dos and don'ts
PDF
Architectural Patterns in IoT Cloud Platforms
PPTX
IoT Security: Cases and Methods
PPTX
DotNetToscana - Azure IoT Hub - Il Concentratore
PPTX
FIWARE Developers Week_IoT basic exercises
PDF
AuthentiThings: The Pitfalls and Promises of Authentication in the IoT
OpenId Connect Protocol
IoT Security in Action - Boston Sept 2015
Creator IoT Framework
CIS 2015 How to secure the Internet of Things? Hannes Tschofenig
Security in microservices architectures
Cryptzone: What is a Software-Defined Perimeter?
IoT on Azure
Azure IoT suite - A look behind the curtain (Sam Vanhoutte @AZUG Event)
Developing an IoT System FIWARE Based from the Scratch
Iot top 10 vulnerabilities and misconceptions 2016
Using an Open Source RESTful Backend for IoT Applications
Cryptzone: The Software-Defined Perimeter
Microservices Security: dos and don'ts
Architectural Patterns in IoT Cloud Platforms
IoT Security: Cases and Methods
DotNetToscana - Azure IoT Hub - Il Concentratore
FIWARE Developers Week_IoT basic exercises
AuthentiThings: The Pitfalls and Promises of Authentication in the IoT
Ad

Viewers also liked (20)

PDF
Identity for IoT: An Authentication Framework for the IoT
PDF
Creating an Internet of Everything
PDF
Federated identity and trust management redp3678
PDF
No IoT Without Identity
PDF
Cybesecurity of the IoT
PPTX
Device Management with OMA Lightweight M2M
PPTX
IDENTITY IN THE WORLD OF IOT
PDF
Technical landscape of IoT
PPT
IBM Interconnect 2016 - Hybrid Cloud Messaging
PPT
Capgemini Digital Transformation - Beyond the Hype
PPTX
Authorization for Internet of Things using OAuth 2.0
PDF
Iot Software-As-A-Service Implementation Framework
PDF
How to use Innovative Architectures for Digital Enterprises
PDF
Delivering Digital Transformation and Leveraging a Digital Platform
PPTX
Capgemini Digital Reference Architecture with HPE
PDF
Building a Digital Transformation Roadmap
PDF
Driving Connectivity in the Scottish Islands: Droneways and Airmasts
PDF
An Introduction to IoT: Connectivity & Case Studies
PDF
5G Network Architecture and Design
PDF
3GPP Standards for the Internet-of-Things
Identity for IoT: An Authentication Framework for the IoT
Creating an Internet of Everything
Federated identity and trust management redp3678
No IoT Without Identity
Cybesecurity of the IoT
Device Management with OMA Lightweight M2M
IDENTITY IN THE WORLD OF IOT
Technical landscape of IoT
IBM Interconnect 2016 - Hybrid Cloud Messaging
Capgemini Digital Transformation - Beyond the Hype
Authorization for Internet of Things using OAuth 2.0
Iot Software-As-A-Service Implementation Framework
How to use Innovative Architectures for Digital Enterprises
Delivering Digital Transformation and Leveraging a Digital Platform
Capgemini Digital Reference Architecture with HPE
Building a Digital Transformation Roadmap
Driving Connectivity in the Scottish Islands: Droneways and Airmasts
An Introduction to IoT: Connectivity & Case Studies
5G Network Architecture and Design
3GPP Standards for the Internet-of-Things
Ad

Similar to Federated Identity for IoT with OAuth2 (20)

PDF
Securing IoT Applications
PPTX
Your Thing is Pwned - Security Challenges for the IoT
PDF
MQTT-REST Bridge using the Smart Object API
PDF
MQTT REST Bridge using the Smart Object API
PDF
MQTT - REST Bridge using the Smart Object API
PDF
MQTT – protocol for yours IoT
PPT
20130226 How Personal Is Your Cloud?
PDF
IoT4Devs (1)
PPTX
Web API Management meets the Internet of Things
PDF
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
PDF
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
PPTX
Access control iot_mqtt_ace
PDF
From the Internet of Things to Intelligent Systems A Developer's Primer - Gar...
PDF
MQTT - A practical protocol for the Internet of Things
PDF
IoT - Understanding internet of things
PPTX
IoT Introduction & Communication Protocol
PDF
Security challenges for IoT
PDF
Internet of Things (IoT) protocols COAP MQTT OSCON2014
PDF
Arduino basics
PDF
M2M, IoT, Device management: one protocol to rule them all? - EclipseCon 2014
Securing IoT Applications
Your Thing is Pwned - Security Challenges for the IoT
MQTT-REST Bridge using the Smart Object API
MQTT REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object API
MQTT – protocol for yours IoT
20130226 How Personal Is Your Cloud?
IoT4Devs (1)
Web API Management meets the Internet of Things
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
Access control iot_mqtt_ace
From the Internet of Things to Intelligent Systems A Developer's Primer - Gar...
MQTT - A practical protocol for the Internet of Things
IoT - Understanding internet of things
IoT Introduction & Communication Protocol
Security challenges for IoT
Internet of Things (IoT) protocols COAP MQTT OSCON2014
Arduino basics
M2M, IoT, Device management: one protocol to rule them all? - EclipseCon 2014

More from Paul Fremantle (15)

PDF
IoT and Blockchains - enhancing security and privacy
PPTX
Apache Stratos - Building a PaaS using OSGi and Equinox
PDF
Beyond Economics - Cloud as a Business Enabler
PDF
Evolution of PaaS
PDF
The Evolution of Integration
PPTX
High Volume Web API Management with the WSO2 ESB
PDF
Stratos Open PaaS OSCON 2011
PPT
Stratos and PaaS for London Java Community
PPT
Understanding Platform as a Service
PPT
Making Apache Tomcat Multi-tenant, Elastic and Metered
PPT
Building Cloud Native Software
PPT
Building Innovation with Open Source Approaches
PPT
Three SOA Case Studies
PPT
Fast SOA with Apache Synapse
PPT
REST vs WS-*: Myths Facts and Lies
IoT and Blockchains - enhancing security and privacy
Apache Stratos - Building a PaaS using OSGi and Equinox
Beyond Economics - Cloud as a Business Enabler
Evolution of PaaS
The Evolution of Integration
High Volume Web API Management with the WSO2 ESB
Stratos Open PaaS OSCON 2011
Stratos and PaaS for London Java Community
Understanding Platform as a Service
Making Apache Tomcat Multi-tenant, Elastic and Metered
Building Cloud Native Software
Building Innovation with Open Source Approaches
Three SOA Case Studies
Fast SOA with Apache Synapse
REST vs WS-*: Myths Facts and Lies

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
Teaching material agriculture food technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Modernizing your data center with Dell and AMD
PDF
Machine learning based COVID-19 study performance prediction
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Cloud computing and distributed systems.
PDF
Unlocking AI with Model Context Protocol (MCP)
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
NewMind AI Monthly Chronicles - July 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
Modernizing your data center with Dell and AMD
Machine learning based COVID-19 study performance prediction
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
cuic standard and advanced reporting.pdf
Empathic Computing: Creating Shared Understanding
Cloud computing and distributed systems.
Unlocking AI with Model Context Protocol (MCP)

Federated Identity for IoT with OAuth2

  • 1. Federated  Iden*ty  for  IoT  with   OAuth   Paul  Fremantle   CTO,  WSO2  (paul@wso2.com)   PhD  researcher,  Portsmouth  University   (paul.fremantle@port.ac.uk)     @pzfreo  
  • 2. How  this  will  work   •  Quick  intro  to  Federated  Iden*ty  and  Access   Management   •  Even  quicker  introduc*on  to  OAuth2   •  MQTT  overview   •  Demo   •  Issues   •  Next  steps  
  • 4. What  is  Federated  Iden*ty  and  Access   Management  (FIAM)?   Federated  IAM  aims  to  give  You  control  over   your  creden*als  and  access:   •  You  don’t  give  your  userid/pw  to  anyone   •  You  control  the  grant  of  permissions   •  LinkedIn  example   •  OAuth2  emerging  as  widely  used  approach      
  • 5. Why  FIAM  for  IoT?   •  Your  device  =  Your  data   •  Tokens  are  beYer  than  u/p  for  devices   •  Manage  tokens  and  scopes  independently  of   the  device    
  • 7. Why  OAuth2?   •  Widely  implemented   •  PreYy  good     –  Of  course  there  is  never  100%  agreement   –  Or  certainty  with  security  protocols   •  Not  just  HTTP:   –  hYp://tools.ie^.org/html/dra_-­‐ie^-­‐kiYen-­‐sasl-­‐ oauth-­‐12   –  OAuth2  used  with  SSL      
  • 10. MQTT   •  Very  lightweight  messaging  protocol   –  Designed  for  8-­‐bit  controllers,  SCADA,  etc   –  Low  power,  low  bandwidth   –  Binary  header  of  2  bytes   –  Lots  of  implementa*ons   •  MosquiYo  from  Eclipse   •  Apache  Ac*veMQ  and  Apollo   –  Clients:   •  Arduino,  Perl,  Python,  PHP,  C,  Java,  JS/Node.js,  .Net,  etc   •  Plus  an  even  lighter-­‐weight  version  for  Zigbee   –  MQTT-­‐SN  (Sensor  Network)  
  • 12. CreateToken.py   Demo  components     1 Refresher.py   2 Arduino   3 5 4 MosquiYo   (Open  Source  MQTT   Broker)     Ac*ng  as  “Resource   Server”     MosquiYo_py_auth     mqY-­‐oauth2.py   IdP     WSO2  Iden*ty   Server   6 ESB   Introspec*on   API  
  • 13. Demo  steps   1.  Get  an  access-­‐token  /  refresh-­‐token   2.  Encode  it  into  the  Arduino  code,  compile,  burn   3.  Reboot  Arduino   4.  Arduino  tries  access  token   5.  Arduino  connects  as  “refresh  user”  and  requests  refresh   token   •  6.  Arduino  receives  updated  access  token  and  reconnects     •  7.  Arduino  starts  to  publish  data  (assuming  it  is  allowed!)   •  8.  Python  client  receives  data  using  a  previously  authorized   token   •  •  •  •  • 
  • 14. Step  1.  Get  a  token   •  Simple  python  script  and  web  browser   •  Encodes  the  requested  permission  “scopes”  as   b64  encoded  JSON  (ugly  but  works!)   •  scope  =  '[{"rw":"w","topic":"/pzf/#"}]’   •  IdP  =  WSO2  Iden*ty  Server   –   open  source  Oauth  server   •  Redirects  to  a  localhost  server  which  prints   the  code  
  • 15. Step  2.  Burn  into  Arduino   •  LiYle  program  burns  into  EEPROM    
  • 16. Step  3,  4,  5,  6     Recode  Arduino  with  App   •  App  tries  access  token  to  CONNECT   •  If  fails,  retries  as  user  “r”  (refresh)   –  Ideally  this  would  be  a  separate  server  /  IdP-­‐based   broker   •  Sends  {clien*d,  refresh_token}  to  topic  /r   •  Subscribes  to  /c/{clien*d}   •  When  new  access_token  arrives,  saves  in   EEPROM  and  reconnects  
  • 17. Step  7.  Arduino  publishes  data   •  MPU  9150   •  Yaw,  Pitch,  Roll   •  Every  publish  is  validated  against  the  IdP   –  Should  be  cached  by  the  resource  server  
  • 18. Step  8.  Python  client  subscribes   •  Subscriber.py  
  • 19. Lessons  learnt   •  MQTT  and  MPU  /  I2C  code  is  97%  of  Duemilanove   –  Adding  the  final  logic  to  do  OAuth2  flow  pushed  it  to  99%   –  No  TLS  in  this  demo  is  a  big  issue   •  Different  Oauth  implementa*ons  behave  differently  (e.g.   changing  the  refresh  token  every  *me  you  refresh)   •  Need  to  be  able  to  update  the  scope  of  token  if  this  will   work  for  long  term  embedded  devices   •  The  refresh  flow  should  not  really  go  via  the  Resource   server   –  Easy  fix     •  MQTT  should  have  a  well  defined  model  for  sending  a   message  to  just  one  client  (securely)  
  • 20. Next  steps   •  •  •  •  •  Do  the  same  for  CoAP  /  other  IoT  protocols   Implement  solidly  J   Gain  agreement  on  the  specific  MQTT   Other  FIAM  approaches  for  IoT?   Please  feel  free  to  contact  me:   –  @pzfreo   –  paul@wso2.com