SlideShare a Scribd company logo
OAuth2 Presentaion
What is OAuth ?
Oauth is the industry-standard protocol for authorization.
Oauth is an specification/Protocol that enables
applications to obtain limited access to user accounts.
How it works ?
It works by delegating user authentication to the service
that hosts the user account, and authorizing third-party
applications to access the user account.
Who will use?
It provides authorization flows for web and desktop
applications, and mobile devices.
• Authorization Server
e.g. Face book, Google, Git hub etc.
https://en.wikipedia.org/wiki/List_of_OAuth_providers
• Resource Server
Limited User information
•Client (Third party App)
Application which requires authentication and authorization
• Resource Owner
User who has account in Authorization server
Redbus.in Application using Authorization with
Google/Facebook authorization servers
OAuth2 Presentaion
Access Tokens (Short lived)
With this token, we access the authorized resource
Refresh Tokens (Long lived)
When ever access token expires, we use refresh token to get
the new access token.
An authorization code is an intermediate token used in the server-
side app flow. An authorization code is returned to the client after
the authorization step, and then the client exchanges it for an
access token.
Scope is a way to limit an app’s access to a user’s data. Rather
than granting complete access to a user’s account, it is often useful
to give apps a way to request a more limited scope of what they
are allowed to do on behalf of a user.
e.g. read, write, trust or email etc..
Authorization End Point
https://authorization-server.com/authorize
Returns the response with authorization code and state
And also gives the screen to user saying Approve /Deny of sharingyour
public data with Client Application.
Token End point
https://authorization-server.com/token
{
"access_token": "381e44d1-3b79-4b2b-826e-b414f06989b8",
"token_type": "bearer",
"refresh_token": "3bb99a06-5d9b-4329-91df-42ad0b952853",
"expires_in": 43199,
"scope": "read write“
}
The OAuth 2.0 specification lists four different types of
authorization grants. Each type has different security
characteristics.
• Authorization Code Grants
• Implicit Grants
• Password Grants
• Client Credentials Grants
Authorization Code
Implicit
Resource Owner Password Credentials
Client Credentials
OAuth2 Presentaion
https://github.com/settings/applications/new
OAuth2 Presentaion
OAuth2 Presentaion
• Decouples resource owner credentials
over head from Resources.
• Client Application doesn’t have to
maintain authentication.
• Resource Owners (Users) don’t need to
have multiple logins.
https://projects.spring.io/spring-security-oauth/
https://spring.io/guides/tutorials/spring-boot-oauth2/
https://oauth.net/2/
http://www.bubblecode.net/en/2016/01/22/understanding-oauth2/
https://www.codeproject.com/Articles/1171546/OAuth-Framework-explained-
with-examples

More Related Content

PDF
OAuth2 primer
PDF
Introduction to OAuth2.0
PDF
Spring security oauth2
PPTX
OAuth2 & OpenID Connect
PPT
OAuth2 Protocol with Grails Spring Security
PPTX
An introduction to OAuth 2
PPTX
The State of OAuth2
PPT
OAuth 2.0 and OpenId Connect
OAuth2 primer
Introduction to OAuth2.0
Spring security oauth2
OAuth2 & OpenID Connect
OAuth2 Protocol with Grails Spring Security
An introduction to OAuth 2
The State of OAuth2
OAuth 2.0 and OpenId Connect

What's hot (20)

PDF
OAuth & OpenID Connect Deep Dive
PDF
Demystifying OAuth 2.0
PPTX
Securing your APIs with OAuth, OpenID, and OpenID Connect
PDF
Single Sign On with OAuth and OpenID
PDF
CIS14: Working with OAuth and OpenID Connect
PDF
OAuth 2.0
PDF
Security for oauth 2.0 - @topavankumarj
PPTX
OAuth2 + API Security
PPT
Silicon Valley Code Camp 2009: OAuth: What, Why and How
PPTX
CIS 2012 - Going Mobile with PingFederate and OAuth 2
PDF
CIS14: Consolidating Authorization for API and Web SSO using OpenID Connect
PPTX
JWT SSO Inbound Authenticator
ODP
OAuth2 - Introduction
PPTX
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
PDF
Stateless Auth using OAuth2 & JWT
PPTX
Single-Page-Application & REST security
PDF
CIS14: OAuth and OpenID Connect in Action
PDF
OpenID Connect - An Emperor or Just New Cloths?
PDF
CIS 2015 OpenID Connect and Mobile Applications - David Chase
PDF
Learn with WSO2 - API Security
OAuth & OpenID Connect Deep Dive
Demystifying OAuth 2.0
Securing your APIs with OAuth, OpenID, and OpenID Connect
Single Sign On with OAuth and OpenID
CIS14: Working with OAuth and OpenID Connect
OAuth 2.0
Security for oauth 2.0 - @topavankumarj
OAuth2 + API Security
Silicon Valley Code Camp 2009: OAuth: What, Why and How
CIS 2012 - Going Mobile with PingFederate and OAuth 2
CIS14: Consolidating Authorization for API and Web SSO using OpenID Connect
JWT SSO Inbound Authenticator
OAuth2 - Introduction
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
Stateless Auth using OAuth2 & JWT
Single-Page-Application & REST security
CIS14: OAuth and OpenID Connect in Action
OpenID Connect - An Emperor or Just New Cloths?
CIS 2015 OpenID Connect and Mobile Applications - David Chase
Learn with WSO2 - API Security
Ad

Similar to OAuth2 Presentaion (20)

PPTX
Oauth2 and OWSM OAuth2 support
PPTX
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
PPTX
OAuth 2.0 - The fundamentals, the good , the bad, technical primer and commo...
PDF
Deep Dive into OAuth for Connected Apps
KEY
OAuth Android Göteborg
PPTX
OAuth2 Introduction
PDF
SAML VS OAuth 2.0 VS OpenID Connect
PPTX
OAuth in the Wild
PPTX
Protecting your APIs with Doorkeeper and OAuth 2.0
PDF
A Survey on SSO Authentication protocols: Security and Performance
PPTX
Oauth 2.0 Introduction and Flows with MuleSoft
PPTX
PPTX
OAuth2 Implementation Presentation (Java)
PPT
O auth 2
PPTX
Ladies Be Architects - Study Group III: OAuth 2.0 (Ep 1)
PDF
Survey on Restful Web Services Using Open Authorization (Oauth)I01545356
PPTX
OAuth 2
PPTX
Microsoft Graph API Delegated Permissions
PDF
O auth2.0 guide
PDF
Keeping Pace with OAuth’s Evolving Security Practices.pdf
Oauth2 and OWSM OAuth2 support
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
OAuth 2.0 - The fundamentals, the good , the bad, technical primer and commo...
Deep Dive into OAuth for Connected Apps
OAuth Android Göteborg
OAuth2 Introduction
SAML VS OAuth 2.0 VS OpenID Connect
OAuth in the Wild
Protecting your APIs with Doorkeeper and OAuth 2.0
A Survey on SSO Authentication protocols: Security and Performance
Oauth 2.0 Introduction and Flows with MuleSoft
OAuth2 Implementation Presentation (Java)
O auth 2
Ladies Be Architects - Study Group III: OAuth 2.0 (Ep 1)
Survey on Restful Web Services Using Open Authorization (Oauth)I01545356
OAuth 2
Microsoft Graph API Delegated Permissions
O auth2.0 guide
Keeping Pace with OAuth’s Evolving Security Practices.pdf
Ad

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
cuic standard and advanced reporting.pdf
PPTX
Cloud computing and distributed systems.
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Approach and Philosophy of On baking technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
20250228 LYD VKU AI Blended-Learning.pptx
cuic standard and advanced reporting.pdf
Cloud computing and distributed systems.
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Network Security Unit 5.pdf for BCA BBA.
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
Reach Out and Touch Someone: Haptics and Empathic Computing
Approach and Philosophy of On baking technology
Understanding_Digital_Forensics_Presentation.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Artificial Intelligence
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation_ Review paper, used for researhc scholars
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Review of recent advances in non-invasive hemoglobin estimation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

OAuth2 Presentaion

Editor's Notes

  • #4: Authorization Server – Facebook or Google or Github etc.. Resource Server – User Accounts Client – Redbus.in Resource Owner – Users who has account in Facebook/Google/Github and wants to log in Redbus.in application
  • #5: Google Oauth https://accounts.google.com/signin/oauth/oauthchooseaccount?client_id=231171689615-idianhahjhk2s9rdlr1hrd9e2a09b3cj.apps.googleusercontent.com&as=-30c12e6fde8576ce&destination=https%3A%2F%2Fwww.redbus.in&approval_state=!ChRZb2hNenR2NmNUQmlSTk1hWUk4LRIfUTZNWWJUTzVhSEVhVU9xWmlfQjdtUjlrRUpzS0NoWQ%E2%88%99ACThZt4AAAAAWkceu1dXTeKbHkXCN-vEyg0EN4omYuT6&xsrfsig=AHgIfE-8qupE90XAlxCML8F4cCK8SD0-2w&flowName=GeneralOAuthFlow Facebook O Auth Link https://www.facebook.com/dialog/oauth?app_id=377581119008028&channel_url=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2FlY4eZXm_YWu.js%3Fversion%3D42%23cb%3Df412aaa45d5424%26domain%3Dwww.redbus.in%26origin%3Dhttps%253A%252F%252Fwww.redbus.in%252Ff3f1486533c3e04%26relation%3Dopener&client_id=377581119008028&display=popup&domain=www.redbus.in&e2e=%7B%7D&locale=en_US&origin=1&redirect_uri=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2FlY4eZXm_YWu.js%3Fversion%3D42%23cb%3Df3d20b7232ee724%26domain%3Dwww.redbus.in%26origin%3Dhttps%253A%252F%252Fwww.redbus.in%252Ff3f1486533c3e04%26relation%3Dopener%26frame%3Df4fa8c18f35e9c&response_type=token%2Csigned_request&scope=email&sdk=joey DigitalOcean OAuthLink https://cloud.digitalocean.com/v1/oauth/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=CALLBACK_URL&scope=read https://developer.github.com/apps/building-oauth-apps/authorization-options-for-oauth-apps/#non-web-application-flow
  • #8: More about Scope… Some apps only use OAuth in order to identify the user, so they only need access to a user ID and basic profile information. Other apps may need to know more sensitive information such as the user’s birthday, or they may need the ability to post content on behalf of the user, or modify profile data. Users will be more willing to authorize an application if they know exactly what the application can and cannot do with their account. Scope is a way to control access and help the user identify the permissions they are granting to the application.
  • #9: If you give Bearer ( Default on most implementation), an access_token is generated and sent back to you. Bearer can be simply understood as "give access to the bearer of this token." One valid token and no question asked. On the other hand if you choose Mac and sign_type(default hmac-sha-1 on most implementation), the access token is generated and kept as secret in Key Manager as a attribute, and an encrypted secret is sent back as access_token JWT – JSON Web Token. JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or integrity protected with a Message Authentication Code (MAC) and/or encrypted.
  • #12: Authorization Code Grant When it should be used? It should be used as soon as the client is a web server. It allows you to obtain a long-lived access token since it can be renewed with a refresh token (if the authorization server enables it). Example: Resource Owner: you Resource Server: a Google server Client: any website Authorization Server: a Google server Scenario: A website wants to obtain information about your Google profile. You are redirected by the client (the website) to the authorization server (Google). If you authorize access, the authorization server sends an authorization code to the client (the website) in the callback response. Then, this code is exchanged against an access token between the client and the authorization server. The website is now able to use this access token to query the resource server (Google again) and retrieve your profile data. You never see the access token, it will be stored by the website (in session for example). Google also sends other information with the access token, such as the token lifetime and eventually a refresh token. This is the ideal scenario and the safer one because the access token is not passed on the client side (web browser in our example).
  • #13: t is typically used when the client is running in a browser using a scripting language such as Javascript. This grant type does not allow the issuance of a refresh token. Example: Resource Owner: you Resource Server: a Facebook server Client: a website using AngularJS for example Authorization Server: a Facebook server Scenario: The client (AngularJS) wants to obtain information about your Facebook profile. You are redirected by the browser to the authorization server (Facebook). If you authorize access, the authorization server redirects you to the website with the access token in the URI fragment (not sent to the web server). Example of callback: http://example.com/oauthcallback#access_token=MzJmNDc3M2VjMmQzN. This access token can now be retrieved and used by the client (AngularJS) to query the resource server (Facebook). Example of query: https://graph.facebook.com/me?access_token=MzJmNDc3M2VjMmQzN. Access-Control-Allow-Origin Maybe you wonder how the client can make a call to the Facebook API with Javascript without being blocked because of the Same Origin Policy? his cross-domain request is possible because Facebook authorizes it thanks to a header called Access-Control-Allow-Origin present in the response. Java Script Applications Mobile Apps
  • #14: POST https://api.authorization-server.com/token grant_type=password& username=USERNAME& password=PASSWORD& client_id=CLIENT_ID A common use for this grant type is to enable password logins for your service’s own apps.  The response will include an access token in the same format as the other grant types When it should be used? With this type of authorization, the credentials (and thus the password) are sent to the client and then to the authorization server. It is therefore imperative that there is absolute trust between these two entities. It is mainly used when the client has been developed by the same authority as the authorization server. For example, we could imagine a website named example.com seeking access to protected resources of its own subdomain api.example.com. The user would not be surprised to type his login/password on the site example.com since his account was created on it. Example: Resource Owner: you having an account on acme.com website of the Acme company Resource Server: Acme company exposing its API at api.acme.com Client: acme.com website from Acme company Authorization Server: an Acme server Scenario: Acme company, doing things well, thought to make available a RESTful API to third-party applications. This company thinks it would be convenient to use its own API to avoid reinventing the wheel. Company needs an access token to call the methods of its own API. For this, company asks you to enter your login credentials via a standard HTML form as you normally would. The server-side application (website acme.com) will exchange your credentials against an access token from the authorization server (if your credentials are valid, of course). This application can now use the access token to query its own resource server (api.acme.com).
  • #15: The Client Credentials grant is used when applications request an access token to access their own resources, not on behalf of a user. http://www.mysmartprice.com/ When it should be used? This type of authorization is used when the client is himself the resource owner. There is no authorization to obtain from the end-user. Example: Resource Owner: any website Resource Server: Google Cloud Storage Client: the resource owner Authorization Server: a Google server Scenario: A website stores its files of any kind on Google Cloud Storage. The website must go through the Google API to retrieve or modify files and must authenticate with the authorization server. Once authenticated, the website obtains an access token that can now be used for querying the resource server (Google Cloud Storage). Here, the end-user does not have to give its authorization for accessing the resource server.
  • #17: https://github.com/settings/applications/new
  • #19: Resource http://localhost:8000/resource/ords Authorization http://localhost:9000/service/oauth/authorize http://localhost:9000/service/oauth/token