SlideShare a Scribd company logo
OAuth with Facebook and Google
Using .NET
Sathyaish Chakravarthy, Independent Consultant
O auth with facebook and google using .net
O auth with facebook and google using .net
O auth with facebook and google using .net
You
Contacts
Gmail
Resource
Owner
Resource
Server
Client
O auth with facebook and google using .net
You
Contacts
Gmail
Resource
Owner
Resource
Server
Client
O auth with facebook and google using .net
O auth with facebook and google using .net
O auth with facebook and google using .net
OAuth is not about authentication.
OAuth allows you to give a third-party application the
permission to use some of your resources on a resource
server without giving the third party your user name
and password on the resource server.
“
”
O auth with facebook and google using .net
O auth with facebook and google using .net
REGISTERING CLIENTS
console.developers.google.com
developers.facebook.com
ROLES & FLOWS
Implicit
Flow
Authorization
Code
Flow
Resource Server
Client
Credentials
Flow
Resource
Owner
Password
Credentials
Flow
Authorization Code Flow from an End-User’s Perspective
Authorization Code Flow Under the Covers
You
Resource
Owner
Resource
Server
Client
Authorization
Server
2
1
4
5
3
Exchange auth code for access token
2.0
1.0
1.0a
Not backward compatible
Authorization Code Flow Under the Covers
You
Resource
Owner
Client
2
1
GET
client_id
Who is making this request?
scope
What do they want to know about the user?
response_type (reserved: code)
What do they want from me just now?
redirect_uri
Where should I send them this stuff?
state (optional but recommended)
CSRF token
1 2and
?
Authorization Code Flow Under the Covers
You
Resource
Owner
Client
2
1
RESPONSE (302)
code
Authorization code
error
Location: client_redirect_uri?code=ljfvknfANB3454
Location: client_redirect_uri?error=access_denied
Or
2
state (CSRF token)
If you’d sent it
?
Authorization Code Flow Under the Covers
You
Resource
Owner
Client
2
1
GET
code
Authorization code
error
client_redirect_uri?code=ljfvknfANB3454
client_redirect_uri?error=access_denied
Or
3
3
Authorization Code Flow Under the Covers
Client
Authorization
Server4
Exchange auth code for access token
GET or POST
client_id
Who is making this request?
client_secret
What’s the password I gave you earlier? Prove your identity.
grant_type
What’s this flow? Oh, you’re a web server, so this must be the “authorization code” flow.
code
Okay, show us the authorization code?
state (optional but recommended)
CSRF token
4
Authorization Code Flow Under the Covers
Client
Authorization
Server4
Exchange auth code for access token
RESPONSE (query string or request body)
access_token
state (optional but recommended)
CSRF token
4
Authorization Code Flow Under the Covers
Resource
Server
Client
5
GET OR POST
Access_token
As querystring or request body or basic
authentication / bearer authentication
(HTTP authorization header)
5
Authorization Code Flow Under the Covers
You
Resource
Owner
Resource
Server
Client
Authorization
Server
2
1
4
5
3
Exchange auth code for access token
Roles
• You, the resource owner
• Client, the server side web app
• Resource server
• Authorization Server
DEMO: GOOGLE OAUTH CLIENT
(AUTHORIZATION CODE FLOW)
DEMO: FACEBOOK OAUTH CLIENT
(AUTHORIZATION CODE FLOW)
Summary: What’s in it for me?
Summary: What’s in it for me?
User
Client
Summary: What’s in it for me?
Limitations of OAuth 2.0
• No discovery
• Requires HTTPS
• Open redirectors – RFC 6819 – OAuth 2.0 Thread
Model and Security Considerations
• Implementations differ widely
Further Reading
• RFC 6749 – The OAuth 2.0 Authorization Framework
http://tools.ietf.org/html/rfc6749
• Google
https://developers.google.com/identity/protocols/O
Auth2WebServer
• Facebook (Facebook Login) -
https://developers.facebook.com/docs/facebook-
login/v2.3
O auth with facebook and google using .net
O auth with facebook and google using .net

More Related Content

ODP
Mohanraj - Securing Your Web Api With OAuth
PPTX
OAuth2 + API Security
PPTX
Protecting your APIs with Doorkeeper and OAuth 2.0
PPTX
Securing RESTful Payment APIs Using OAuth 2
PPTX
Secure Your REST API (The Right Way)
PPTX
Securing your APIs with OAuth, OpenID, and OpenID Connect
PPTX
Secure RESTful API Automation With JavaScript
Mohanraj - Securing Your Web Api With OAuth
OAuth2 + API Security
Protecting your APIs with Doorkeeper and OAuth 2.0
Securing RESTful Payment APIs Using OAuth 2
Secure Your REST API (The Right Way)
Securing your APIs with OAuth, OpenID, and OpenID Connect
Secure RESTful API Automation With JavaScript

What's hot (20)

PPTX
Securing RESTful APIs using OAuth 2 and OpenID Connect
PPTX
RESTful API Automation with JavaScript
PDF
OAuth - Open API Authentication
PDF
Spring4 security oauth2
PPTX
Creating Cloud-Ready Enterprise Applications with the SharePoint 2013 Add-In ...
PPTX
Making Sense of API Access Control
PDF
Spring4 security oauth2
PPTX
The State of OAuth2
PPTX
Oauth 2.0 security
PPTX
OAuth 2
PPT
Silicon Valley Code Camp 2009: OAuth: What, Why and How
ODP
OAuth2 - Introduction
PDF
OAuth2 primer
PDF
Pentesting RESTful webservices
PPTX
An introduction to OAuth 2
PDF
PDF
Introduction to OAuth2.0
PDF
Building an API Security Ecosystem
PDF
Facebook data breach and OAuth2
PPT
OAuth2 Protocol with Grails Spring Security
Securing RESTful APIs using OAuth 2 and OpenID Connect
RESTful API Automation with JavaScript
OAuth - Open API Authentication
Spring4 security oauth2
Creating Cloud-Ready Enterprise Applications with the SharePoint 2013 Add-In ...
Making Sense of API Access Control
Spring4 security oauth2
The State of OAuth2
Oauth 2.0 security
OAuth 2
Silicon Valley Code Camp 2009: OAuth: What, Why and How
OAuth2 - Introduction
OAuth2 primer
Pentesting RESTful webservices
An introduction to OAuth 2
Introduction to OAuth2.0
Building an API Security Ecosystem
Facebook data breach and OAuth2
OAuth2 Protocol with Grails Spring Security
Ad

Similar to O auth with facebook and google using .net (20)

PPTX
Devteach 2017 OAuth and Open id connect demystified
PPTX
Oauth2 and OWSM OAuth2 support
PDF
Stateless Auth using OAUTH2 & JWT
PDF
Stateless Auth using OAuth2 & JWT
PDF
Spring security oauth2
PPTX
OAuth 2.0
PDF
Oauth2.0 tutorial
PPT
Oauth2.0
PPTX
O auth 2.0 authorization framework
PPTX
OAuth
PDF
What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020
PDF
What the Heck is OAuth and OIDC - UberConf 2018
PPTX
OAuth with Salesforce - Demystified
PDF
Oauth Behind The Scenes
PPTX
(1) OAuth 2.0 Overview
PDF
OAuth: Trust Issues
KEY
OAuth Android Göteborg
PDF
Stateless authentication for microservices applications - JavaLand 2015
PPTX
Introduction to OAuth2
PDF
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
Devteach 2017 OAuth and Open id connect demystified
Oauth2 and OWSM OAuth2 support
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAuth2 & JWT
Spring security oauth2
OAuth 2.0
Oauth2.0 tutorial
Oauth2.0
O auth 2.0 authorization framework
OAuth
What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020
What the Heck is OAuth and OIDC - UberConf 2018
OAuth with Salesforce - Demystified
Oauth Behind The Scenes
(1) OAuth 2.0 Overview
OAuth: Trust Issues
OAuth Android Göteborg
Stateless authentication for microservices applications - JavaLand 2015
Introduction to OAuth2
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
Ad

Recently uploaded (20)

PDF
composite construction of structures.pdf
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
additive manufacturing of ss316l using mig welding
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
Digital Logic Computer Design lecture notes
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPT
introduction to datamining and warehousing
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
composite construction of structures.pdf
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Model Code of Practice - Construction Work - 21102022 .pdf
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
CH1 Production IntroductoryConcepts.pptx
bas. eng. economics group 4 presentation 1.pptx
additive manufacturing of ss316l using mig welding
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Embodied AI: Ushering in the Next Era of Intelligent Systems
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Digital Logic Computer Design lecture notes
Foundation to blockchain - A guide to Blockchain Tech
Lecture Notes Electrical Wiring System Components
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
introduction to datamining and warehousing
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026

O auth with facebook and google using .net