SlideShare a Scribd company logo
9
Most read
11
Most read
14
Most read
OAuth2 Implementation
Presented By – Aasif Ali
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
 Punctuality
Join the session 5 minutes prior to the session start time. We start on
time and conclude on time!
 Feedback
Make sure to submit a constructive feedback for all sessions as it is very
helpful for the presenter.
 Silent Mode
Keep your mobile devices in silent mode, feel free to move out of session
in case you need to attend an urgent call.
 Avoid Disturbance
Avoid unwanted chit chat during the session.
1. Introduction to OAuth 2.0
2. OAuth 2.0 Roles
3. OAuth 2.0 Grant Types
4. Authorization Process
5. How It Works: The Building Blocks of OAuth 2.0
6. Setting up OAuth 2 in Spring Boot: Demo Example
OAuth2 Implementation Presentation (Java)
What is Authorization
 Authorization is the process of determining whether an authenticated user or client has the necessary
permissions to access a specific resource or perform a particular action within a system or application.
 "Are you allowed to do this?"
 It ensures that only authorized users or clients can access certain data or functionalities, protecting sensitive
information and maintaining the security of the system.
What is OAuth 2?
 OAuth 2.0 (Open Authorization 2.0) is an authorization framework that enables third-party applications
to access resources on behalf of a resource owner (user), with the resource owner's permission.
 It is widely used for securing APIs and enabling secure access to protected resources on the web.
 OAuth 2.0 is an evolution of OAuth 1.0, offering improvements in security, simplicity, and flexibility.
 OAuth 2.0 provides consented access and restricts actions of what the client app can perform on
resources on behalf of the user, without ever sharing the user's credentials.
 OAuth 2.0 is an authorization protocol and NOT an authentication protocol. As such, it is designed
primarily as a means of granting access to a set of resources, for example, remote APIs or user data.
OAuth1 vs OAuth2
 Complexity: More complex and difficult to
implement due to cryptographic requirements.
 Token Type: Uses both request and access
tokens.
 Signature: Requests are signed for verification,
ensuring authenticity.
OAuth1
 Simplicity: Simpler and more streamlined
compared to OAuth 1.
 Token Type: Utilizes only access tokens.
 Scalability: More scalable, supporting a wider
range of use cases.
OAuth2
02
Resource Owner
 An entity capable of
granting access to a
protected resource.
Typically, this is the
end-user.
OAuth 2 Roles
Client
 An application requesting
access to a protected
resource on behalf of the
resource owner.
 To access resources, the
Client must hold the
appropriate Access
Token.
Authorization Server
 The server that
authenticates the
resource owner and
issues access tokens
after obtaining
authorization.
Resource Server
 The server hosting the
protected resources,
capable of accepting
and responding to
requests using access
tokens.
03
Authorization Code
 The authorization code grant type is widely used for server-side applications, ensuring Client Secret
confidentiality. It involves redirection, where the app communicates with the user's browser to receive
authorization codes.
OAuth 2 Grant Types
Implicit
 A simplified flow where the Access Token is returned directly to the Client. In the Implicit flow, the authorization
server may return the Access Token as a parameter in the callback URI or as a response to a form post.
Resource Owner Password Credentials
 This grant requires the Client first to acquire the resource owner’s credentials, which are passed to the
Authorization server. Allows users to provide their credentials directly to the application, which then exchanges
them for an access token. It's useful for trusted applications like native mobile apps.
Client Credentials
 Used for non-interactive applications e.g., automated processes, microservices, etc. It allows a client to request
an access token using the resource owner's username and password directly, rather than going through an
authorization process with redirects.
04
Authorization Process
 The Client requests authorization (authorization request) from the Authorization server, supplying the client
id and secret to as identification; it also provides the scopes and an endpoint URI (redirect URI) to send the
Access Token or the Authorization Code to.
 The Authorization server authenticates the Client and verifies that the requested scopes are permitted.
 The Resource owner interacts with the Authorization server to grant access.
 The Authorization server redirects back to the Client with either an Authorization Code or Access Token,
depending on the grant type.
 With the Access Token, the Client requests access to the resource from the Resource server.
A typical use-case
05
Scopes and Consent
 Scopes are mechanisms that define permissions and set boundaries for what an application or service
does or does not have access to.
 When an app sends an authorization request, the user is presented with the specific scope of the request
and must authorize consent.
 This consent serves as proof of authorization and allows an access token to be granted.
Actors
 The resource owner owns the data for which access is requested. The resource owner can be an individual
end-user or a company.
 The resource server is the API or server that securely stores the data the application or service has
requested to access. The resource server must accept and validate an access token from the requesting
application to grant access to the data.
 The client is the application or service requesting access to the data the resource server is protecting.
Clients gain access to the requested resources by presenting a valid access token to the resource server.
 The authorization server handles token management. It manages tokens, which are like keys to access
resources. When a client wants access to something, like your photos, it asks the authorization server.
Once you say yes, the server gives the client a new access token, like a special key, to use on the
resource server.
Clients
 Confidential clients keep secrets and operate in secure areas inaccessible to end-users.
 Public clients, on the other hand, are less secure and include browsers, mobile apps, and IoT devices.
Tokens
 Access tokens are granted by the authorization server and used to access the data in the
resource server. They typically allow clients to access resources for a few minutes up to a few
hours.
 Refresh tokens are only granted to confidential clients with secure authentication protocols
and can be valid for days, months, or even years - they can also be used to get new access
tokens for other clients.
06
OAuth2 Implementation Presentation (Java)
Ad

Recommended

O auth
O auth
Ashok Kumar N
 
OAuth 2 Spring Boot 3 Integration Presentation
OAuth 2 Spring Boot 3 Integration Presentation
Knoldus Inc.
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
Gaurav Sharma
 
OAuth2
OAuth2
SPARK MEDIA
 
Spring Security
Spring Security
Knoldus Inc.
 
An introduction to OAuth 2
An introduction to OAuth 2
Sanjoy Kumar Roy
 
Spring4 security oauth2
Spring4 security oauth2
Sang Shin
 
Spring4 security oauth2
Spring4 security oauth2
axykim00
 
Demystifying OAuth 2.0
Demystifying OAuth 2.0
Karl McGuinness
 
OAuth2 + API Security
OAuth2 + API Security
Amila Paranawithana
 
(1) OAuth 2.0 Overview
(1) OAuth 2.0 Overview
anikristo
 
OAuth 2
OAuth 2
ChrisWood262
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2
Rodrigo Cândido da Silva
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWT
Mobiliya
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWT
Gaurav Roy
 
Lecture #25 : Oauth 2.0
Lecture #25 : Oauth 2.0
Dr. Ramchandra Mangrulkar
 
Devteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystified
Taswar Bhatti
 
Oauth2.0 tutorial
Oauth2.0 tutorial
HarikaReddy115
 
O auth 2.0 authorization framework
O auth 2.0 authorization framework
John Temoty Roca
 
OAuth
OAuth
Tom Elrod
 
oauth-for-credentials-security-in-rest-api-access
oauth-for-credentials-security-in-rest-api-access
idsecconf
 
Spring security oauth2
Spring security oauth2
axykim00
 
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
 
slides-101-edu-sesse-introduction-to-oauth-20-01.pdf
slides-101-edu-sesse-introduction-to-oauth-20-01.pdf
GopalKrishna703039
 
O auth2.0 guide
O auth2.0 guide
Dilip Mohapatra
 
OAuth
OAuth
Adi Challa
 
Draft Ietf Oauth V2 12
Draft Ietf Oauth V2 12
Vishal Shah
 
Extended Security with WSO2 API Management Platform
Extended Security with WSO2 API Management Platform
WSO2
 
Angular Hydration Presentation (FrontEnd)
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Knoldus Inc.
 

More Related Content

Similar to OAuth2 Implementation Presentation (Java) (20)

Demystifying OAuth 2.0
Demystifying OAuth 2.0
Karl McGuinness
 
OAuth2 + API Security
OAuth2 + API Security
Amila Paranawithana
 
(1) OAuth 2.0 Overview
(1) OAuth 2.0 Overview
anikristo
 
OAuth 2
OAuth 2
ChrisWood262
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2
Rodrigo Cândido da Silva
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWT
Mobiliya
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWT
Gaurav Roy
 
Lecture #25 : Oauth 2.0
Lecture #25 : Oauth 2.0
Dr. Ramchandra Mangrulkar
 
Devteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystified
Taswar Bhatti
 
Oauth2.0 tutorial
Oauth2.0 tutorial
HarikaReddy115
 
O auth 2.0 authorization framework
O auth 2.0 authorization framework
John Temoty Roca
 
OAuth
OAuth
Tom Elrod
 
oauth-for-credentials-security-in-rest-api-access
oauth-for-credentials-security-in-rest-api-access
idsecconf
 
Spring security oauth2
Spring security oauth2
axykim00
 
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
 
slides-101-edu-sesse-introduction-to-oauth-20-01.pdf
slides-101-edu-sesse-introduction-to-oauth-20-01.pdf
GopalKrishna703039
 
O auth2.0 guide
O auth2.0 guide
Dilip Mohapatra
 
OAuth
OAuth
Adi Challa
 
Draft Ietf Oauth V2 12
Draft Ietf Oauth V2 12
Vishal Shah
 
Extended Security with WSO2 API Management Platform
Extended Security with WSO2 API Management Platform
WSO2
 
(1) OAuth 2.0 Overview
(1) OAuth 2.0 Overview
anikristo
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2
Rodrigo Cândido da Silva
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWT
Mobiliya
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWT
Gaurav Roy
 
Devteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystified
Taswar Bhatti
 
O auth 2.0 authorization framework
O auth 2.0 authorization framework
John Temoty Roca
 
oauth-for-credentials-security-in-rest-api-access
oauth-for-credentials-security-in-rest-api-access
idsecconf
 
Spring security oauth2
Spring security oauth2
axykim00
 
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
 
slides-101-edu-sesse-introduction-to-oauth-20-01.pdf
slides-101-edu-sesse-introduction-to-oauth-20-01.pdf
GopalKrishna703039
 
Draft Ietf Oauth V2 12
Draft Ietf Oauth V2 12
Vishal Shah
 
Extended Security with WSO2 API Management Platform
Extended Security with WSO2 API Management Platform
WSO2
 

More from Knoldus Inc. (20)

Angular Hydration Presentation (FrontEnd)
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Knoldus Inc.
 
Self-Healing Test Automation Framework - Healenium
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
Kanban Metrics Presentation (Project Management)
Kanban Metrics Presentation (Project Management)
Knoldus Inc.
 
Java 17 features and implementation.pptx
Java 17 features and implementation.pptx
Knoldus Inc.
 
Chaos Mesh Introducing Chaos in Kubernetes
Chaos Mesh Introducing Chaos in Kubernetes
Knoldus Inc.
 
GraalVM - A Step Ahead of JVM Presentation
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
DAPR - Distributed Application Runtime Presentation
DAPR - Distributed Application Runtime Presentation
Knoldus Inc.
 
Introduction to Azure Virtual WAN Presentation
Introduction to Azure Virtual WAN Presentation
Knoldus Inc.
 
Introduction to Argo Rollouts Presentation
Introduction to Argo Rollouts Presentation
Knoldus Inc.
 
Intro to Azure Container App Presentation
Intro to Azure Container App Presentation
Knoldus Inc.
 
Insights Unveiled Test Reporting and Observability Excellence
Insights Unveiled Test Reporting and Observability Excellence
Knoldus Inc.
 
Introduction to Splunk Presentation (DevOps)
Introduction to Splunk Presentation (DevOps)
Knoldus Inc.
 
Code Camp - Data Profiling and Quality Analysis Framework
Code Camp - Data Profiling and Quality Analysis Framework
Knoldus Inc.
 
AWS: Messaging Services in AWS Presentation
AWS: Messaging Services in AWS Presentation
Knoldus Inc.
 
Amazon Cognito: A Primer on Authentication and Authorization
Amazon Cognito: A Primer on Authentication and Authorization
Knoldus Inc.
 
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Knoldus Inc.
 
Managing State & HTTP Requests In Ionic.
Managing State & HTTP Requests In Ionic.
Knoldus Inc.
 
Angular Hydration Presentation (FrontEnd)
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Knoldus Inc.
 
Self-Healing Test Automation Framework - Healenium
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
Kanban Metrics Presentation (Project Management)
Kanban Metrics Presentation (Project Management)
Knoldus Inc.
 
Java 17 features and implementation.pptx
Java 17 features and implementation.pptx
Knoldus Inc.
 
Chaos Mesh Introducing Chaos in Kubernetes
Chaos Mesh Introducing Chaos in Kubernetes
Knoldus Inc.
 
GraalVM - A Step Ahead of JVM Presentation
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
DAPR - Distributed Application Runtime Presentation
DAPR - Distributed Application Runtime Presentation
Knoldus Inc.
 
Introduction to Azure Virtual WAN Presentation
Introduction to Azure Virtual WAN Presentation
Knoldus Inc.
 
Introduction to Argo Rollouts Presentation
Introduction to Argo Rollouts Presentation
Knoldus Inc.
 
Intro to Azure Container App Presentation
Intro to Azure Container App Presentation
Knoldus Inc.
 
Insights Unveiled Test Reporting and Observability Excellence
Insights Unveiled Test Reporting and Observability Excellence
Knoldus Inc.
 
Introduction to Splunk Presentation (DevOps)
Introduction to Splunk Presentation (DevOps)
Knoldus Inc.
 
Code Camp - Data Profiling and Quality Analysis Framework
Code Camp - Data Profiling and Quality Analysis Framework
Knoldus Inc.
 
AWS: Messaging Services in AWS Presentation
AWS: Messaging Services in AWS Presentation
Knoldus Inc.
 
Amazon Cognito: A Primer on Authentication and Authorization
Amazon Cognito: A Primer on Authentication and Authorization
Knoldus Inc.
 
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Knoldus Inc.
 
Managing State & HTTP Requests In Ionic.
Managing State & HTTP Requests In Ionic.
Knoldus Inc.
 
Ad

Recently uploaded (20)

Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Ad

OAuth2 Implementation Presentation (Java)

  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes  Punctuality Join the session 5 minutes prior to the session start time. We start on time and conclude on time!  Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter.  Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call.  Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3. 1. Introduction to OAuth 2.0 2. OAuth 2.0 Roles 3. OAuth 2.0 Grant Types 4. Authorization Process 5. How It Works: The Building Blocks of OAuth 2.0 6. Setting up OAuth 2 in Spring Boot: Demo Example
  • 5. What is Authorization  Authorization is the process of determining whether an authenticated user or client has the necessary permissions to access a specific resource or perform a particular action within a system or application.  "Are you allowed to do this?"  It ensures that only authorized users or clients can access certain data or functionalities, protecting sensitive information and maintaining the security of the system.
  • 6. What is OAuth 2?  OAuth 2.0 (Open Authorization 2.0) is an authorization framework that enables third-party applications to access resources on behalf of a resource owner (user), with the resource owner's permission.  It is widely used for securing APIs and enabling secure access to protected resources on the web.  OAuth 2.0 is an evolution of OAuth 1.0, offering improvements in security, simplicity, and flexibility.  OAuth 2.0 provides consented access and restricts actions of what the client app can perform on resources on behalf of the user, without ever sharing the user's credentials.  OAuth 2.0 is an authorization protocol and NOT an authentication protocol. As such, it is designed primarily as a means of granting access to a set of resources, for example, remote APIs or user data.
  • 7. OAuth1 vs OAuth2  Complexity: More complex and difficult to implement due to cryptographic requirements.  Token Type: Uses both request and access tokens.  Signature: Requests are signed for verification, ensuring authenticity. OAuth1  Simplicity: Simpler and more streamlined compared to OAuth 1.  Token Type: Utilizes only access tokens.  Scalability: More scalable, supporting a wider range of use cases. OAuth2
  • 8. 02
  • 9. Resource Owner  An entity capable of granting access to a protected resource. Typically, this is the end-user. OAuth 2 Roles Client  An application requesting access to a protected resource on behalf of the resource owner.  To access resources, the Client must hold the appropriate Access Token. Authorization Server  The server that authenticates the resource owner and issues access tokens after obtaining authorization. Resource Server  The server hosting the protected resources, capable of accepting and responding to requests using access tokens.
  • 10. 03
  • 11. Authorization Code  The authorization code grant type is widely used for server-side applications, ensuring Client Secret confidentiality. It involves redirection, where the app communicates with the user's browser to receive authorization codes. OAuth 2 Grant Types Implicit  A simplified flow where the Access Token is returned directly to the Client. In the Implicit flow, the authorization server may return the Access Token as a parameter in the callback URI or as a response to a form post. Resource Owner Password Credentials  This grant requires the Client first to acquire the resource owner’s credentials, which are passed to the Authorization server. Allows users to provide their credentials directly to the application, which then exchanges them for an access token. It's useful for trusted applications like native mobile apps. Client Credentials  Used for non-interactive applications e.g., automated processes, microservices, etc. It allows a client to request an access token using the resource owner's username and password directly, rather than going through an authorization process with redirects.
  • 12. 04
  • 13. Authorization Process  The Client requests authorization (authorization request) from the Authorization server, supplying the client id and secret to as identification; it also provides the scopes and an endpoint URI (redirect URI) to send the Access Token or the Authorization Code to.  The Authorization server authenticates the Client and verifies that the requested scopes are permitted.  The Resource owner interacts with the Authorization server to grant access.  The Authorization server redirects back to the Client with either an Authorization Code or Access Token, depending on the grant type.  With the Access Token, the Client requests access to the resource from the Resource server.
  • 15. 05
  • 16. Scopes and Consent  Scopes are mechanisms that define permissions and set boundaries for what an application or service does or does not have access to.  When an app sends an authorization request, the user is presented with the specific scope of the request and must authorize consent.  This consent serves as proof of authorization and allows an access token to be granted.
  • 17. Actors  The resource owner owns the data for which access is requested. The resource owner can be an individual end-user or a company.  The resource server is the API or server that securely stores the data the application or service has requested to access. The resource server must accept and validate an access token from the requesting application to grant access to the data.  The client is the application or service requesting access to the data the resource server is protecting. Clients gain access to the requested resources by presenting a valid access token to the resource server.  The authorization server handles token management. It manages tokens, which are like keys to access resources. When a client wants access to something, like your photos, it asks the authorization server. Once you say yes, the server gives the client a new access token, like a special key, to use on the resource server.
  • 18. Clients  Confidential clients keep secrets and operate in secure areas inaccessible to end-users.  Public clients, on the other hand, are less secure and include browsers, mobile apps, and IoT devices.
  • 19. Tokens  Access tokens are granted by the authorization server and used to access the data in the resource server. They typically allow clients to access resources for a few minutes up to a few hours.  Refresh tokens are only granted to confidential clients with secure authentication protocols and can be valid for days, months, or even years - they can also be used to get new access tokens for other clients.
  • 20. 06