SlideShare a Scribd company logo
Prepared by – Kumaresh Chandra Baruri
Software Engineer
 Oauth 2 delegates user authentication to the service that holds user account. Like-
 Gmail account provided by Google service.
 FB account by Facebook service.
 It authorizes third-party applications to access that user account. Like- a web
application is using Oauth 2 to login and consequently to use account info.
 OAuth 2 provides authorization flows for web and desktop applications, as well as
mobile devices.
OAuth 2 is an authorization framework that enables applications
— such as Facebook, GitHub, Google or others — to obtain
limited access to user accounts on an HTTP service.
1. Resource Owner: The resource owner is the user who authorizes an
application to access their account. The application’s access to the
user’s account is limited to the scope of the authorization granted
(e.g. read or write access)
2. Client: The client is the application that wants to access the user’s
account. Before it may do so, it must be authorized by the user, and
the authorization must be validated by the API.
3. Resource Server: The resource server hosts the protected user
accounts.
4. Authorization Server: The authorization server verifies the identity of
the user then issues access tokens to the application.
There are four different roles in OAUTH 2.
The following information is required to register the application-
1. Application Name
2. Application Website
3. Redirect URI or Callback URL where the service will redirect the user
after they authorize (or deny).
App means the one which is going to use Oauth 2 for
authorization. Before using Oauth 2 with your
application, developer must register the application with
the service like- Google, FB etc.
1. Client ID
 Publicly exposed string that is used by the service API to identify the
application.
 Used to build authorization URLs that are presented to users.
2. Client Secret
 Used to authenticate the identity of the application to the service API.
 It must be kept private between the application and the API.
After registering the app, the service will issue client
credentials in the form of a client identifier and a client
secret.
1. Authorization Code: used with server-side Applications.
2. Client Credentials: used with Applications that have API access.
3. Device Code: used for devices that lack browsers or have input
limitations.
OAuth 2 supports three primary grant types.
*** This article covers Auth Code based authorization
Application
(Client)
Auth Server
(Service API)
User
(Resource
owner)
User-agent
(Web browser)
1. User authorization request
2. User authorizes Application
3. Authorization code grant
4. Access token request
5. Access token grant
1. **https://cloud.domain.com/v1/oauth/authorize**: the API authorization endpoint
2. client_id=client_id: the application’s client ID (how the API identifies the
application)
3. redirect_uri=CALLBACK_URL: where the service redirects the user-agent after
an authorization code is granted
4. response_type=code: specifies that your application is requesting an
authorization code grant
5. scope=read: specifies the level of access that the application is requesting
Link:
https://cloud.domain.com/v1/oauth/authorize?response_type=code&client_id=CLIE
NT_ID&redirect_uri=CALLBACK_URL&scope=read
1. The user will be prompted by the service to authorize or deny the application
access to their account.
2. Authorize application:
3. The application is requesting read access.
4. The user accepts and permission provided.
When the user clicks the link, button they must first log in to the service to
authenticate their identity
1. Service redirects the user-agent to the application redirect URI along with
Auth Code.
2. Redirection link-
https://app-domain.com/callback?code=AUTHORIZATION_CODE
When the use authorizes the application-
1. Requests an access token from the API by passing the authorization code
along with authentication details, including the client secret, to the API token
endpoint.
2. Access token request would be like-
https://cloud.domain.com/v1/oauth/token?client_id=CLIENT_ID&client_secret=
CLIENT_SECRET&grant_type=authorization_code&code=AUTHORIZATIO
N_CODE&redirect_uri=CALLBACK_URL
After receiving auth code, app
1. API service sends response with –
a) Access Token.
b) Refresh Token.
2. Response will be like this –
In case of valid auth code-
1. https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2
2. https://www.slideshare.net/kumareshbaruri/authentication-and-single-sign-on-sso
3. https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow
Introduction to OAuth2

More Related Content

Similar to Introduction to OAuth2 (20)

PPTX
OAuth 2.0 - The fundamentals, the good , the bad, technical primer and commo...
Good Dog Labs, Inc.
 
PPTX
Oauth 2.0
Manish Kumar Singh
 
PDF
Lecture #25 : Oauth 2.0
Dr. Ramchandra Mangrulkar
 
PPTX
Intro to OAuth2 and OpenID Connect
LiamWadman
 
PPTX
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Aaron Parecki
 
PDF
OAuth 2.0 and OpenID Connect
Jacob Combs
 
PDF
Implementing open authentication_in_your_app
Nuhil Mehdy
 
PPTX
Extended Security with WSO2 API Management Platform
WSO2
 
PPTX
OAuth2 Implementation Presentation (Java)
Knoldus Inc.
 
PPTX
Authentication and single sign on (sso)
Kumaresh Chandra Baruri
 
PDF
Protecting your APIs with OAuth 2.0
Ubisecure
 
PPTX
OAuth
Adi Challa
 
PPTX
Oauth 2.0 Introduction and Flows with MuleSoft
shyamraj55
 
PPTX
OAuth2 Introduction
Arpit Suthar
 
PPTX
Microsoft Graph API Delegated Permissions
Stefan Weber
 
PPTX
Securing api with_o_auth2
sivachandra mandalapu
 
PPTX
OAuth in the Wild
Victor Rentea
 
PPT
Silicon Valley Code Camp 2009: OAuth: What, Why and How
Manish Pandit
 
PPTX
OAuth v2.0 demo
Santanu Dey
 
OAuth 2.0 - The fundamentals, the good , the bad, technical primer and commo...
Good Dog Labs, Inc.
 
Lecture #25 : Oauth 2.0
Dr. Ramchandra Mangrulkar
 
Intro to OAuth2 and OpenID Connect
LiamWadman
 
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Aaron Parecki
 
OAuth 2.0 and OpenID Connect
Jacob Combs
 
Implementing open authentication_in_your_app
Nuhil Mehdy
 
Extended Security with WSO2 API Management Platform
WSO2
 
OAuth2 Implementation Presentation (Java)
Knoldus Inc.
 
Authentication and single sign on (sso)
Kumaresh Chandra Baruri
 
Protecting your APIs with OAuth 2.0
Ubisecure
 
OAuth
Adi Challa
 
Oauth 2.0 Introduction and Flows with MuleSoft
shyamraj55
 
OAuth2 Introduction
Arpit Suthar
 
Microsoft Graph API Delegated Permissions
Stefan Weber
 
Securing api with_o_auth2
sivachandra mandalapu
 
OAuth in the Wild
Victor Rentea
 
Silicon Valley Code Camp 2009: OAuth: What, Why and How
Manish Pandit
 
OAuth v2.0 demo
Santanu Dey
 

More from Kumaresh Chandra Baruri (9)

PPTX
Introduction to git, a version control system
Kumaresh Chandra Baruri
 
PDF
Test Driven Development
Kumaresh Chandra Baruri
 
PDF
Fundamentasl of DFD
Kumaresh Chandra Baruri
 
PDF
Solid principles
Kumaresh Chandra Baruri
 
PPTX
Variations of git merging
Kumaresh Chandra Baruri
 
PPTX
Git branching policy and review comment's prefix
Kumaresh Chandra Baruri
 
PPTX
Introduction to flutter's basic concepts
Kumaresh Chandra Baruri
 
PPTX
WEB API Gateway
Kumaresh Chandra Baruri
 
PPTX
Model based testing using finite state machine(FSM)
Kumaresh Chandra Baruri
 
Introduction to git, a version control system
Kumaresh Chandra Baruri
 
Test Driven Development
Kumaresh Chandra Baruri
 
Fundamentasl of DFD
Kumaresh Chandra Baruri
 
Solid principles
Kumaresh Chandra Baruri
 
Variations of git merging
Kumaresh Chandra Baruri
 
Git branching policy and review comment's prefix
Kumaresh Chandra Baruri
 
Introduction to flutter's basic concepts
Kumaresh Chandra Baruri
 
WEB API Gateway
Kumaresh Chandra Baruri
 
Model based testing using finite state machine(FSM)
Kumaresh Chandra Baruri
 
Ad

Recently uploaded (20)

PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Ad

Introduction to OAuth2

  • 1. Prepared by – Kumaresh Chandra Baruri Software Engineer
  • 2.  Oauth 2 delegates user authentication to the service that holds user account. Like-  Gmail account provided by Google service.  FB account by Facebook service.  It authorizes third-party applications to access that user account. Like- a web application is using Oauth 2 to login and consequently to use account info.  OAuth 2 provides authorization flows for web and desktop applications, as well as mobile devices. OAuth 2 is an authorization framework that enables applications — such as Facebook, GitHub, Google or others — to obtain limited access to user accounts on an HTTP service.
  • 3. 1. Resource Owner: The resource owner is the user who authorizes an application to access their account. The application’s access to the user’s account is limited to the scope of the authorization granted (e.g. read or write access) 2. Client: The client is the application that wants to access the user’s account. Before it may do so, it must be authorized by the user, and the authorization must be validated by the API. 3. Resource Server: The resource server hosts the protected user accounts. 4. Authorization Server: The authorization server verifies the identity of the user then issues access tokens to the application. There are four different roles in OAUTH 2.
  • 4. The following information is required to register the application- 1. Application Name 2. Application Website 3. Redirect URI or Callback URL where the service will redirect the user after they authorize (or deny). App means the one which is going to use Oauth 2 for authorization. Before using Oauth 2 with your application, developer must register the application with the service like- Google, FB etc.
  • 5. 1. Client ID  Publicly exposed string that is used by the service API to identify the application.  Used to build authorization URLs that are presented to users. 2. Client Secret  Used to authenticate the identity of the application to the service API.  It must be kept private between the application and the API. After registering the app, the service will issue client credentials in the form of a client identifier and a client secret.
  • 6. 1. Authorization Code: used with server-side Applications. 2. Client Credentials: used with Applications that have API access. 3. Device Code: used for devices that lack browsers or have input limitations. OAuth 2 supports three primary grant types. *** This article covers Auth Code based authorization
  • 7. Application (Client) Auth Server (Service API) User (Resource owner) User-agent (Web browser) 1. User authorization request 2. User authorizes Application 3. Authorization code grant 4. Access token request 5. Access token grant
  • 8. 1. **https://cloud.domain.com/v1/oauth/authorize**: the API authorization endpoint 2. client_id=client_id: the application’s client ID (how the API identifies the application) 3. redirect_uri=CALLBACK_URL: where the service redirects the user-agent after an authorization code is granted 4. response_type=code: specifies that your application is requesting an authorization code grant 5. scope=read: specifies the level of access that the application is requesting Link: https://cloud.domain.com/v1/oauth/authorize?response_type=code&client_id=CLIE NT_ID&redirect_uri=CALLBACK_URL&scope=read
  • 9. 1. The user will be prompted by the service to authorize or deny the application access to their account. 2. Authorize application: 3. The application is requesting read access. 4. The user accepts and permission provided. When the user clicks the link, button they must first log in to the service to authenticate their identity
  • 10. 1. Service redirects the user-agent to the application redirect URI along with Auth Code. 2. Redirection link- https://app-domain.com/callback?code=AUTHORIZATION_CODE When the use authorizes the application-
  • 11. 1. Requests an access token from the API by passing the authorization code along with authentication details, including the client secret, to the API token endpoint. 2. Access token request would be like- https://cloud.domain.com/v1/oauth/token?client_id=CLIENT_ID&client_secret= CLIENT_SECRET&grant_type=authorization_code&code=AUTHORIZATIO N_CODE&redirect_uri=CALLBACK_URL After receiving auth code, app
  • 12. 1. API service sends response with – a) Access Token. b) Refresh Token. 2. Response will be like this – In case of valid auth code-