SlideShare a Scribd company logo
OAuth 2.0
http://oauth.net/2/
Agenda
❖ Overview and History
❖ OAuth 2.0 Roles
❖ User cases and OAuth 2.0 Grant types
❖ OAuth 2.0 Tokens
❖ OAuth 2.0 Java Implementations
❖ Demo
OAuth 2.0 Overview
OAuth 2.0 is an open authorization protocol specification
defined by IETF OAuth WG (Working Group) which enables
applications to access each other’s data.
The prime focus of this protocol is to define a standard where
an application, say gaming site, can access the user’s data
maintained by another application like facebook, google or
other resource server.
OAuth History
❖ OAuth started circa 2007
❖ 2008 - IETF normalization started in 2008
❖ 2010 - RFC 5849 defines OAuth 1.0
❖ 2010 - WRAP (Web Resource Authorization Profiles) proposed by
Microsoft, Yahoo! And Google
❖ 2010 - OAuth 2.0 work begins in IETF
❖ 2012
➢ RFC 6749 - The OAuth 2.0 Authorization Framework
➢ RFC 6750 - The OAuth 2.0 Authorization Framework: Bearer
Token Usage
OAuth 2.0 Roles
OAuth 2.0 defines the following roles of users and
applications:
❖ Resource Owner: The user
❖ Resource Server: The API server
❖ Client Application: The third-party application
❖ Authorization Server: Often the same as the API server
User cases
❖ Web-server apps
❖ Browser-based apps
❖ Username & Password access
❖ Application access
❖ Mobile apps
User cases → Grant types
❖ Web-server apps → authorization_code
❖ Browser-based and Mobile apps → implicit
❖ Username & Password access → password
❖ Application access → client_credentials
authorization_code
implicit
password
client_credentials
OAuth 2.0 Tokens
❖ Types
➢ Bearer
■ Large random token
■ Need SSL to protect it in transit
■ Server needs to store it securely hashed like a user password
➢ MAC (OAuth 1.0 only supported)
❖ Access Token
➢ Short-lived token
❖ Refresh Token
➢ Long-lived token
OAuth 2.0 Pros & Cons
❖ Pros
➢ Integration of third-party apps to any sites
➢ Access can be granted for limited scope and duration
➢ No need for users to give on third-party site
❖ Cons
➢ Writing authorization is somewhat complex
➢ Interoperability issues
➢ Bad implementations can be security issues
OAuth 2.0 Java Implementations
❖ Some java implementation available
➢ Jersey
➢ Apache Oltu
➢ Spring Security OAuth 2.0
➢ Others (CXF, Google OAuth2 API, etc)
❖ Not available as Java EE standard yet
Spring Security OAuth
❖ Provides OAuth (1a) and OAuth2
❖ Implements 4 types for authorization grants
❖ Support the OAuth2 full features
➢ Authorization Server, Resources Server, Client
❖ Good integration with JAX-RS and Spring MVC
❖ Configuration using annotation support
❖ Integrates with the Spring ecosystem
Spring Authorization Server
❖ @EnableAuthorizationServer
➢ Annotation used to configure OAuth2 Authorization
Server
➢ There is also XML configuration related
<authorization-server/>
❖ ClientDetailsServiceConfigurer
➢ Defines the client details service
➢ In-memory or JDBC implement
Spring Authorization Server (cont)
❖ AuthorizationServerTokenServices
➢ Operations to manage OAuth2 tokens
➢ Token in-memory, JDBC or JSON Web Token (JWT)
❖ AuthorizationServerEndpointConfigurer
➢ Grant types supported by the server
➢ All grant types are supported except password types
Spring Resource Server
❖ Can be same as Authorization Server
➢ or deployed in a separate application
❖ Provides an authentication filter for web protection
❖ @EnableResourceServer
➢ Annotation used to configure OAuth2 resource server
➢ There is also XML configuration related <resource-
server/>
Spring Resource Server (cont)
❖ Supports expression-based access control
➢ oauth2.clientHasRole
➢ oauth2.clientHasAnyRole
➢ oauth2.denyClient
Spring OAuth2 Client
❖ Creates a filter to store the current request and context
❖ Manages the redirection to and from the OAuth
authentication URI
❖ @EnableOAuth2Client
➢ Annotation used to configure OAuth2 client
➢ There is also XML configuration related <client/>
❖ OAuthRestTemplate
➢ Wapper client object to access the resource
DEMO
References
1. http://projects.spring.io/spring-security-oauth/docs/oauth2.html
2. http://stackoverflow.com/questions/22764556/spring-security-oauth2-
authorization-process
3. https://github.com/hcadavid/spring4-rest-oauth2
4. https://github.com/neel4software/SpringSecurityOAuth2/tree/master/Spri
ngRestSecurityOauth
Q&A
Tran Thanh Thi
Sr. Software Developer | (+84) 93.739.5658
Dai Viet Controls & Instrumentation Company Ltd.
No.11 Street 2G, Nam Hung Vuong Res., An Lac Ward, Binh Tan
Dist., Ho Chi Minh City, Vietnam.
Tel: +84-8-6268.2523/4 (ext.120) | Fax: +84-8-62682520 Email:
info@daviteq.com | www.daviteq.com
Thank you!

More Related Content

What's hot

ColdFusion_Code_Security_Best_Practices_NCDevCon_2015
ColdFusion_Code_Security_Best_Practices_NCDevCon_2015ColdFusion_Code_Security_Best_Practices_NCDevCon_2015
ColdFusion_Code_Security_Best_Practices_NCDevCon_2015
Denard Springle IV
 
Authenticating Angular Apps with JWT
Authenticating Angular Apps with JWTAuthenticating Angular Apps with JWT
Authenticating Angular Apps with JWT
Jennifer Estrada
 
2016 pycontw web api authentication
2016 pycontw web api authentication 2016 pycontw web api authentication
2016 pycontw web api authentication
Micron Technology
 
Microservice Protection With WSO2 Identity Server
Microservice Protection With WSO2 Identity ServerMicroservice Protection With WSO2 Identity Server
Microservice Protection With WSO2 Identity Server
Anupam Gogoi
 
WCF Security, FSec
WCF Security, FSecWCF Security, FSec
WCF Security, FSec
Ante Gulam
 
[POSS 2019] MicroServices authentication and authorization with LemonLDAP::NG
[POSS 2019] MicroServices authentication and authorization with LemonLDAP::NG[POSS 2019] MicroServices authentication and authorization with LemonLDAP::NG
[POSS 2019] MicroServices authentication and authorization with LemonLDAP::NG
Worteks
 

What's hot (6)

ColdFusion_Code_Security_Best_Practices_NCDevCon_2015
ColdFusion_Code_Security_Best_Practices_NCDevCon_2015ColdFusion_Code_Security_Best_Practices_NCDevCon_2015
ColdFusion_Code_Security_Best_Practices_NCDevCon_2015
 
Authenticating Angular Apps with JWT
Authenticating Angular Apps with JWTAuthenticating Angular Apps with JWT
Authenticating Angular Apps with JWT
 
2016 pycontw web api authentication
2016 pycontw web api authentication 2016 pycontw web api authentication
2016 pycontw web api authentication
 
Microservice Protection With WSO2 Identity Server
Microservice Protection With WSO2 Identity ServerMicroservice Protection With WSO2 Identity Server
Microservice Protection With WSO2 Identity Server
 
WCF Security, FSec
WCF Security, FSecWCF Security, FSec
WCF Security, FSec
 
[POSS 2019] MicroServices authentication and authorization with LemonLDAP::NG
[POSS 2019] MicroServices authentication and authorization with LemonLDAP::NG[POSS 2019] MicroServices authentication and authorization with LemonLDAP::NG
[POSS 2019] MicroServices authentication and authorization with LemonLDAP::NG
 

Similar to OAuth 2.0 at the Globiots

JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2
Rodrigo Cândido da Silva
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2
Rodrigo Cândido da Silva
 
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
Andreas Falk
 
Web API 2 Token Based Authentication
Web API 2 Token Based AuthenticationWeb API 2 Token Based Authentication
Web API 2 Token Based Authentication
jeremysbrown
 
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry BuzdinModern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
Java User Group Latvia
 
#iiw 13th report at #idcon 10th
#iiw 13th report at #idcon 10th#iiw 13th report at #idcon 10th
#iiw 13th report at #idcon 10th
Nov Matake
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
Knoldus Inc.
 
OAuth - Don’t Throw the Baby Out with the Bathwater
OAuth - Don’t Throw the Baby Out with the Bathwater OAuth - Don’t Throw the Baby Out with the Bathwater
OAuth - Don’t Throw the Baby Out with the Bathwater
Apigee | Google Cloud
 
GSoC Mideterm-OAuth2 Module
GSoC Mideterm-OAuth2 ModuleGSoC Mideterm-OAuth2 Module
GSoC Mideterm-OAuth2 Module
Mayank Sharma
 
Accessing APIs using OAuth on the federated (WordPress) web
Accessing APIs using OAuth on the federated (WordPress) webAccessing APIs using OAuth on the federated (WordPress) web
Accessing APIs using OAuth on the federated (WordPress) web
Felix Arntz
 
OAuth - Open API Authentication
OAuth - Open API AuthenticationOAuth - Open API Authentication
OAuth - Open API Authentication
leahculver
 
UserCentric Identity based Service Invocation
UserCentric Identity based Service InvocationUserCentric Identity based Service Invocation
UserCentric Identity based Service Invocation
guestd5dde6
 
INTERFACE by apidays - TxAuth: the future of OAuth? by Dick Hardt
INTERFACE by apidays - TxAuth: the future of OAuth? by Dick HardtINTERFACE by apidays - TxAuth: the future of OAuth? by Dick Hardt
INTERFACE by apidays - TxAuth: the future of OAuth? by Dick Hardt
apidays
 
Oauth
OauthOauth
An Authentication and Authorization Architecture for a Microservices World
An Authentication and Authorization Architecture for a Microservices WorldAn Authentication and Authorization Architecture for a Microservices World
An Authentication and Authorization Architecture for a Microservices World
VMware Tanzu
 
OAuth2
OAuth2OAuth2
OAuth2
SPARK MEDIA
 
Building IAM for OpenStack
Building IAM for OpenStackBuilding IAM for OpenStack
Building IAM for OpenStack
Steve Martinelli
 
Securing FIWARE Architectures
Securing FIWARE ArchitecturesSecuring FIWARE Architectures
Securing FIWARE Architectures
FIWARE
 
Api security
Api security Api security
Api security
teodorcotruta
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
Gaurav Sharma
 

Similar to OAuth 2.0 at the Globiots (20)

JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2
 
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
 
Web API 2 Token Based Authentication
Web API 2 Token Based AuthenticationWeb API 2 Token Based Authentication
Web API 2 Token Based Authentication
 
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry BuzdinModern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
 
#iiw 13th report at #idcon 10th
#iiw 13th report at #idcon 10th#iiw 13th report at #idcon 10th
#iiw 13th report at #idcon 10th
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
OAuth - Don’t Throw the Baby Out with the Bathwater
OAuth - Don’t Throw the Baby Out with the Bathwater OAuth - Don’t Throw the Baby Out with the Bathwater
OAuth - Don’t Throw the Baby Out with the Bathwater
 
GSoC Mideterm-OAuth2 Module
GSoC Mideterm-OAuth2 ModuleGSoC Mideterm-OAuth2 Module
GSoC Mideterm-OAuth2 Module
 
Accessing APIs using OAuth on the federated (WordPress) web
Accessing APIs using OAuth on the federated (WordPress) webAccessing APIs using OAuth on the federated (WordPress) web
Accessing APIs using OAuth on the federated (WordPress) web
 
OAuth - Open API Authentication
OAuth - Open API AuthenticationOAuth - Open API Authentication
OAuth - Open API Authentication
 
UserCentric Identity based Service Invocation
UserCentric Identity based Service InvocationUserCentric Identity based Service Invocation
UserCentric Identity based Service Invocation
 
INTERFACE by apidays - TxAuth: the future of OAuth? by Dick Hardt
INTERFACE by apidays - TxAuth: the future of OAuth? by Dick HardtINTERFACE by apidays - TxAuth: the future of OAuth? by Dick Hardt
INTERFACE by apidays - TxAuth: the future of OAuth? by Dick Hardt
 
Oauth
OauthOauth
Oauth
 
An Authentication and Authorization Architecture for a Microservices World
An Authentication and Authorization Architecture for a Microservices WorldAn Authentication and Authorization Architecture for a Microservices World
An Authentication and Authorization Architecture for a Microservices World
 
OAuth2
OAuth2OAuth2
OAuth2
 
Building IAM for OpenStack
Building IAM for OpenStackBuilding IAM for OpenStack
Building IAM for OpenStack
 
Securing FIWARE Architectures
Securing FIWARE ArchitecturesSecuring FIWARE Architectures
Securing FIWARE Architectures
 
Api security
Api security Api security
Api security
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
 

Recently uploaded

“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 

Recently uploaded (20)

“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 

OAuth 2.0 at the Globiots

  • 2. Agenda ❖ Overview and History ❖ OAuth 2.0 Roles ❖ User cases and OAuth 2.0 Grant types ❖ OAuth 2.0 Tokens ❖ OAuth 2.0 Java Implementations ❖ Demo
  • 3. OAuth 2.0 Overview OAuth 2.0 is an open authorization protocol specification defined by IETF OAuth WG (Working Group) which enables applications to access each other’s data. The prime focus of this protocol is to define a standard where an application, say gaming site, can access the user’s data maintained by another application like facebook, google or other resource server.
  • 4. OAuth History ❖ OAuth started circa 2007 ❖ 2008 - IETF normalization started in 2008 ❖ 2010 - RFC 5849 defines OAuth 1.0 ❖ 2010 - WRAP (Web Resource Authorization Profiles) proposed by Microsoft, Yahoo! And Google ❖ 2010 - OAuth 2.0 work begins in IETF ❖ 2012 ➢ RFC 6749 - The OAuth 2.0 Authorization Framework ➢ RFC 6750 - The OAuth 2.0 Authorization Framework: Bearer Token Usage
  • 5. OAuth 2.0 Roles OAuth 2.0 defines the following roles of users and applications: ❖ Resource Owner: The user ❖ Resource Server: The API server ❖ Client Application: The third-party application ❖ Authorization Server: Often the same as the API server
  • 6. User cases ❖ Web-server apps ❖ Browser-based apps ❖ Username & Password access ❖ Application access ❖ Mobile apps
  • 7. User cases → Grant types ❖ Web-server apps → authorization_code ❖ Browser-based and Mobile apps → implicit ❖ Username & Password access → password ❖ Application access → client_credentials
  • 12. OAuth 2.0 Tokens ❖ Types ➢ Bearer ■ Large random token ■ Need SSL to protect it in transit ■ Server needs to store it securely hashed like a user password ➢ MAC (OAuth 1.0 only supported) ❖ Access Token ➢ Short-lived token ❖ Refresh Token ➢ Long-lived token
  • 13. OAuth 2.0 Pros & Cons ❖ Pros ➢ Integration of third-party apps to any sites ➢ Access can be granted for limited scope and duration ➢ No need for users to give on third-party site ❖ Cons ➢ Writing authorization is somewhat complex ➢ Interoperability issues ➢ Bad implementations can be security issues
  • 14. OAuth 2.0 Java Implementations ❖ Some java implementation available ➢ Jersey ➢ Apache Oltu ➢ Spring Security OAuth 2.0 ➢ Others (CXF, Google OAuth2 API, etc) ❖ Not available as Java EE standard yet
  • 15. Spring Security OAuth ❖ Provides OAuth (1a) and OAuth2 ❖ Implements 4 types for authorization grants ❖ Support the OAuth2 full features ➢ Authorization Server, Resources Server, Client ❖ Good integration with JAX-RS and Spring MVC ❖ Configuration using annotation support ❖ Integrates with the Spring ecosystem
  • 16. Spring Authorization Server ❖ @EnableAuthorizationServer ➢ Annotation used to configure OAuth2 Authorization Server ➢ There is also XML configuration related <authorization-server/> ❖ ClientDetailsServiceConfigurer ➢ Defines the client details service ➢ In-memory or JDBC implement
  • 17. Spring Authorization Server (cont) ❖ AuthorizationServerTokenServices ➢ Operations to manage OAuth2 tokens ➢ Token in-memory, JDBC or JSON Web Token (JWT) ❖ AuthorizationServerEndpointConfigurer ➢ Grant types supported by the server ➢ All grant types are supported except password types
  • 18. Spring Resource Server ❖ Can be same as Authorization Server ➢ or deployed in a separate application ❖ Provides an authentication filter for web protection ❖ @EnableResourceServer ➢ Annotation used to configure OAuth2 resource server ➢ There is also XML configuration related <resource- server/>
  • 19. Spring Resource Server (cont) ❖ Supports expression-based access control ➢ oauth2.clientHasRole ➢ oauth2.clientHasAnyRole ➢ oauth2.denyClient
  • 20. Spring OAuth2 Client ❖ Creates a filter to store the current request and context ❖ Manages the redirection to and from the OAuth authentication URI ❖ @EnableOAuth2Client ➢ Annotation used to configure OAuth2 client ➢ There is also XML configuration related <client/> ❖ OAuthRestTemplate ➢ Wapper client object to access the resource
  • 21. DEMO
  • 22. References 1. http://projects.spring.io/spring-security-oauth/docs/oauth2.html 2. http://stackoverflow.com/questions/22764556/spring-security-oauth2- authorization-process 3. https://github.com/hcadavid/spring4-rest-oauth2 4. https://github.com/neel4software/SpringSecurityOAuth2/tree/master/Spri ngRestSecurityOauth
  • 23. Q&A Tran Thanh Thi Sr. Software Developer | (+84) 93.739.5658 Dai Viet Controls & Instrumentation Company Ltd. No.11 Street 2G, Nam Hung Vuong Res., An Lac Ward, Binh Tan Dist., Ho Chi Minh City, Vietnam. Tel: +84-8-6268.2523/4 (ext.120) | Fax: +84-8-62682520 Email: info@daviteq.com | www.daviteq.com