SlideShare a Scribd company logo
By : Nisha Baswal
OAuth provides a method for clients to access
server resources on behalf of a resource
owner(end-User).
It also provides a process for end-users to authorize
third-party access to their server resources without
sharing their credentials.
Why OAuth is Required?
OAuth Roles and definitions
OAuth Protocol Flow
LIMITATIONS with Password Sharing : In
order to provide third-party applications access to
restricted resources, the resource owner shares its
credentials with the third party.
Trust :Clear text password will be shared.
More Access than required.
Unable to revoke access once provided
OAuth is required for delegating Access
To Certain Party

For Certain Resources

For Limited Time

Which can be selectively revoked
    Resource Owner : An entity capable of granting access to a protected
     resources
    e.g- Picasa User

    Resource Server : The server hosting the protected resource capable of
     accepting and responding to protected resource requests using access tokens
    e.g-Picasa Hosting

    Client : An application making protected resource requests on behalf of the
     resource owner with its authorization
    e.g- any Third Party User or Application

    Authorization Server : The server issuing access tokens to the client after
     successfully authenticating the resource owner and obtaining authorization.
    e.g-Google Auth server
            Authorization Request

                                         Resource Owner
                 Authorization Grant


                  Authorization Grant

    Client          Access Token        Authorization Server


                     Access Token


                  Protected Resource     Resource Server
   Most web applications will use the web server client profile and authorization code access grant
    type to obtain an access token on behalf of an end user.
   Client applications, for example, JavaScript running in the browser or native mobile or desktop
    apps, run on a user's computer or other device. Such apps are able to protect per-user secrets,
    but, since they are widely distributed, a common client secret would not be secure. The user-
    agent flow allows these applications to obtain an access token
   when an access token expires
Demo
(web Server Implementation)
 Java application server.
 Apache Tomcat 7.0.x
 A Force.com account on EE or DE.



Steps for Setup:
•    Enable an SSL endpoint in your application server
    (Oauth does not work correctly with plain http:/ so configure server
     for https:/ )
•    Create a web application project
•    Create Remote Access on Sales-force Org.
Steps to install and configure SSL support on Tomcat
Create   a keystore file to store the server's private key and self-signed
certificate by executing the following command:
   %JAVA_HOME%bin keytool –genkey –alias tomcat –keyalg RSA



Uncommentthe "SSL HTTP/1.1 Connector" entry in
$CATALINA_BASE/conf/server.xml and modify to
   <Connector SSLEnabled="true" acceptCount="100" clientAuth="false"
   disableUploadTimeout="true" enableLookups="false" maxThreads="25"
   port="8443" keystoreFile=“<file-Path>/.keystore" keystorePass="password"
   protocol="HTTP/1.1" scheme="https"
   secure="true" sslProtocol="TLS" />
   Log in to Salesforce.com with your developer account, navigate to
    Setup ➤ Develop ➤ Remote Access
    and click New to create a new remote access
   After clicking Save, you will see your new application’s credentials.
    Consumer Key and Consumer Secret
   Copy the consumer key and consumer secret and paste them to existing
    servlet parameters , build application and Run.




   You will see an error message if the web app is not running on a secure
    port:
   Click the link and you are taken to the Salesforce.com login page:
   Login and a screen displays asking you to allow the sample app to access
    your data: This authorization page only appears the first time the web
    application requests access; subsequent sessions require authentication,
    but skip the authorization step.
   On authorizing access to your data, control returns to the sample web app, and it is
    able to interact with your Force.com data using a token issued during the OAuth
    process:
O auth 2

More Related Content

What's hot

Secure Code Warrior - Os command injection
Secure Code Warrior - Os command injectionSecure Code Warrior - Os command injection
Secure Code Warrior - Os command injection
Secure Code Warrior
 
An introduction to OAuth 2
An introduction to OAuth 2An introduction to OAuth 2
An introduction to OAuth 2
Sanjoy Kumar Roy
 
OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)
Emad Alashi
 
OAuth2 Introduction
OAuth2 IntroductionOAuth2 Introduction
OAuth2 Introduction
Arpit Suthar
 
OAuth
OAuthOAuth
OAuth
Tom Elrod
 
Secure Code Warrior - Local storage
Secure Code Warrior - Local storageSecure Code Warrior - Local storage
Secure Code Warrior - Local storage
Secure Code Warrior
 
O auth with facebook and google using .net
O auth with facebook and google using .netO auth with facebook and google using .net
O auth with facebook and google using .net
Sathyaish Chakravarthy
 
Authentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructuresAuthentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructures
Corley S.r.l.
 
Silicon Valley Code Camp 2009: OAuth: What, Why and How
Silicon Valley Code Camp 2009: OAuth: What, Why and HowSilicon Valley Code Camp 2009: OAuth: What, Why and How
Silicon Valley Code Camp 2009: OAuth: What, Why and How
Manish Pandit
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
Knoldus Inc.
 
Oauth 2.0 security
Oauth 2.0 securityOauth 2.0 security
Oauth 2.0 security
vinoth kumar
 
Secure Code Warrior - XQuery injection
Secure Code Warrior - XQuery injectionSecure Code Warrior - XQuery injection
Secure Code Warrior - XQuery injection
Secure Code Warrior
 
Choosing content management software for an organization
Choosing content management software for an organizationChoosing content management software for an organization
Choosing content management software for an organization
patrickalfredwaluchio
 
Secure Code Warrior - LDAP injection
Secure Code Warrior - LDAP injectionSecure Code Warrior - LDAP injection
Secure Code Warrior - LDAP injection
Secure Code Warrior
 
LinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroLinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To Hero
Taylor Singletary
 
OAuth Tokens
OAuth TokensOAuth Tokens
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTStateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWT
Gaurav Roy
 
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Aaron Parecki
 
An Introduction to OAuth2
An Introduction to OAuth2An Introduction to OAuth2
An Introduction to OAuth2
Aaron Parecki
 
Secure Code Warrior - Insufficient data encoding
Secure Code Warrior - Insufficient data encodingSecure Code Warrior - Insufficient data encoding
Secure Code Warrior - Insufficient data encoding
Secure Code Warrior
 

What's hot (20)

Secure Code Warrior - Os command injection
Secure Code Warrior - Os command injectionSecure Code Warrior - Os command injection
Secure Code Warrior - Os command injection
 
An introduction to OAuth 2
An introduction to OAuth 2An introduction to OAuth 2
An introduction to OAuth 2
 
OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)
 
OAuth2 Introduction
OAuth2 IntroductionOAuth2 Introduction
OAuth2 Introduction
 
OAuth
OAuthOAuth
OAuth
 
Secure Code Warrior - Local storage
Secure Code Warrior - Local storageSecure Code Warrior - Local storage
Secure Code Warrior - Local storage
 
O auth with facebook and google using .net
O auth with facebook and google using .netO auth with facebook and google using .net
O auth with facebook and google using .net
 
Authentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructuresAuthentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructures
 
Silicon Valley Code Camp 2009: OAuth: What, Why and How
Silicon Valley Code Camp 2009: OAuth: What, Why and HowSilicon Valley Code Camp 2009: OAuth: What, Why and How
Silicon Valley Code Camp 2009: OAuth: What, Why and How
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
Oauth 2.0 security
Oauth 2.0 securityOauth 2.0 security
Oauth 2.0 security
 
Secure Code Warrior - XQuery injection
Secure Code Warrior - XQuery injectionSecure Code Warrior - XQuery injection
Secure Code Warrior - XQuery injection
 
Choosing content management software for an organization
Choosing content management software for an organizationChoosing content management software for an organization
Choosing content management software for an organization
 
Secure Code Warrior - LDAP injection
Secure Code Warrior - LDAP injectionSecure Code Warrior - LDAP injection
Secure Code Warrior - LDAP injection
 
LinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroLinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To Hero
 
OAuth Tokens
OAuth TokensOAuth Tokens
OAuth Tokens
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTStateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWT
 
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
 
An Introduction to OAuth2
An Introduction to OAuth2An Introduction to OAuth2
An Introduction to OAuth2
 
Secure Code Warrior - Insufficient data encoding
Secure Code Warrior - Insufficient data encodingSecure Code Warrior - Insufficient data encoding
Secure Code Warrior - Insufficient data encoding
 

Viewers also liked

Bit torrent seminar
Bit torrent seminarBit torrent seminar
Bit torrent seminar
balu0503
 
Job hunting online April 2010
Job hunting online April 2010Job hunting online April 2010
Job hunting online April 2010
Skokie Public Library
 
3 giu 2010 post elezioni provinciali e scissione
3 giu 2010   post elezioni provinciali e scissione3 giu 2010   post elezioni provinciali e scissione
3 giu 2010 post elezioni provinciali e scissioneparaulas
 
Peer to-peer file sharing with incentives
Peer to-peer file sharing with incentivesPeer to-peer file sharing with incentives
Peer to-peer file sharing with incentives
MaboudiAmir
 
Bittorrent
BittorrentBittorrent
Bittorrent
Vatsal Gajera
 
Online Job Hunting
Online Job HuntingOnline Job Hunting
Online Job Hunting
JobServe
 
Semantic web Document
Semantic web DocumentSemantic web Document
Semantic web Document
ap
 
презентация
презентацияпрезентация
презентацияboga-sanyok
 

Viewers also liked (8)

Bit torrent seminar
Bit torrent seminarBit torrent seminar
Bit torrent seminar
 
Job hunting online April 2010
Job hunting online April 2010Job hunting online April 2010
Job hunting online April 2010
 
3 giu 2010 post elezioni provinciali e scissione
3 giu 2010   post elezioni provinciali e scissione3 giu 2010   post elezioni provinciali e scissione
3 giu 2010 post elezioni provinciali e scissione
 
Peer to-peer file sharing with incentives
Peer to-peer file sharing with incentivesPeer to-peer file sharing with incentives
Peer to-peer file sharing with incentives
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
Online Job Hunting
Online Job HuntingOnline Job Hunting
Online Job Hunting
 
Semantic web Document
Semantic web DocumentSemantic web Document
Semantic web Document
 
презентация
презентацияпрезентация
презентация
 

Similar to O auth 2

Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
Gaurav Sharma
 
O auth2 with angular js
O auth2 with angular jsO auth2 with angular js
O auth2 with angular js
Bixlabs
 
OAuth 2.0 - The fundamentals, the good , the bad, technical primer and commo...
OAuth 2.0  - The fundamentals, the good , the bad, technical primer and commo...OAuth 2.0  - The fundamentals, the good , the bad, technical primer and commo...
OAuth 2.0 - The fundamentals, the good , the bad, technical primer and commo...
Good Dog Labs, Inc.
 
.NET Core, ASP.NET Core Course, Session 19
 .NET Core, ASP.NET Core Course, Session 19 .NET Core, ASP.NET Core Course, Session 19
.NET Core, ASP.NET Core Course, Session 19
aminmesbahi
 
Devteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystifiedDevteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystified
Taswar Bhatti
 
Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares
Nino Ho
 
Ladies Be Architects - Study Group III: OAuth 2.0 (Ep 1)
Ladies Be Architects - Study Group III: OAuth 2.0 (Ep 1)Ladies Be Architects - Study Group III: OAuth 2.0 (Ep 1)
Ladies Be Architects - Study Group III: OAuth 2.0 (Ep 1)
gemziebeth
 
Protecting your APIs with Doorkeeper and OAuth 2.0
Protecting your APIs with Doorkeeper and OAuth 2.0Protecting your APIs with Doorkeeper and OAuth 2.0
Protecting your APIs with Doorkeeper and OAuth 2.0
Mads Toustrup-Lønne
 
OAuth
OAuthOAuth
OAuth
Adi Challa
 
Deep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected AppsDeep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected Apps
Salesforce Developers
 
Api security
Api security Api security
Api security
teodorcotruta
 
OAuth2 Presentaion
OAuth2 PresentaionOAuth2 Presentaion
OAuth2 Presentaion
Bhargav Surimenu
 
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
Stuart
 
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 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
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWTStateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWT
Mobiliya
 
OAuth in the Wild
OAuth in the WildOAuth in the Wild
OAuth in the Wild
Victor Rentea
 
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
Brian Campbell
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring Security
Orest Ivasiv
 
OAuth2
OAuth2OAuth2
OAuth2
SPARK MEDIA
 
Protecting your APIs with OAuth 2.0
Protecting your APIs with OAuth 2.0Protecting your APIs with OAuth 2.0
Protecting your APIs with OAuth 2.0
Ubisecure
 

Similar to O auth 2 (20)

Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
 
O auth2 with angular js
O auth2 with angular jsO auth2 with angular js
O auth2 with angular js
 
OAuth 2.0 - The fundamentals, the good , the bad, technical primer and commo...
OAuth 2.0  - The fundamentals, the good , the bad, technical primer and commo...OAuth 2.0  - The fundamentals, the good , the bad, technical primer and commo...
OAuth 2.0 - The fundamentals, the good , the bad, technical primer and commo...
 
.NET Core, ASP.NET Core Course, Session 19
 .NET Core, ASP.NET Core Course, Session 19 .NET Core, ASP.NET Core Course, Session 19
.NET Core, ASP.NET Core Course, Session 19
 
Devteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystifiedDevteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystified
 
Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares
 
Ladies Be Architects - Study Group III: OAuth 2.0 (Ep 1)
Ladies Be Architects - Study Group III: OAuth 2.0 (Ep 1)Ladies Be Architects - Study Group III: OAuth 2.0 (Ep 1)
Ladies Be Architects - Study Group III: OAuth 2.0 (Ep 1)
 
Protecting your APIs with Doorkeeper and OAuth 2.0
Protecting your APIs with Doorkeeper and OAuth 2.0Protecting your APIs with Doorkeeper and OAuth 2.0
Protecting your APIs with Doorkeeper and OAuth 2.0
 
OAuth
OAuthOAuth
OAuth
 
Deep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected AppsDeep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected Apps
 
Api security
Api security Api security
Api security
 
OAuth2 Presentaion
OAuth2 PresentaionOAuth2 Presentaion
OAuth2 Presentaion
 
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
 
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 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
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWTStateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWT
 
OAuth in the Wild
OAuth in the WildOAuth in the Wild
OAuth in the Wild
 
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring Security
 
OAuth2
OAuth2OAuth2
OAuth2
 
Protecting your APIs with OAuth 2.0
Protecting your APIs with OAuth 2.0Protecting your APIs with OAuth 2.0
Protecting your APIs with OAuth 2.0
 

O auth 2

  • 1. By : Nisha Baswal
  • 2. OAuth provides a method for clients to access server resources on behalf of a resource owner(end-User). It also provides a process for end-users to authorize third-party access to their server resources without sharing their credentials. Why OAuth is Required? OAuth Roles and definitions OAuth Protocol Flow
  • 3. LIMITATIONS with Password Sharing : In order to provide third-party applications access to restricted resources, the resource owner shares its credentials with the third party. Trust :Clear text password will be shared. More Access than required. Unable to revoke access once provided
  • 4. OAuth is required for delegating Access To Certain Party For Certain Resources For Limited Time Which can be selectively revoked
  • 5. Resource Owner : An entity capable of granting access to a protected resources e.g- Picasa User  Resource Server : The server hosting the protected resource capable of accepting and responding to protected resource requests using access tokens e.g-Picasa Hosting  Client : An application making protected resource requests on behalf of the resource owner with its authorization e.g- any Third Party User or Application  Authorization Server : The server issuing access tokens to the client after successfully authenticating the resource owner and obtaining authorization. e.g-Google Auth server
  • 6. Authorization Request Resource Owner Authorization Grant Authorization Grant Client Access Token Authorization Server Access Token Protected Resource Resource Server
  • 7. Most web applications will use the web server client profile and authorization code access grant type to obtain an access token on behalf of an end user.
  • 8. Client applications, for example, JavaScript running in the browser or native mobile or desktop apps, run on a user's computer or other device. Such apps are able to protect per-user secrets, but, since they are widely distributed, a common client secret would not be secure. The user- agent flow allows these applications to obtain an access token
  • 9. when an access token expires
  • 10.
  • 12.  Java application server.  Apache Tomcat 7.0.x  A Force.com account on EE or DE. Steps for Setup: • Enable an SSL endpoint in your application server (Oauth does not work correctly with plain http:/ so configure server for https:/ ) • Create a web application project • Create Remote Access on Sales-force Org.
  • 13. Steps to install and configure SSL support on Tomcat Create a keystore file to store the server's private key and self-signed certificate by executing the following command: %JAVA_HOME%bin keytool –genkey –alias tomcat –keyalg RSA Uncommentthe "SSL HTTP/1.1 Connector" entry in $CATALINA_BASE/conf/server.xml and modify to <Connector SSLEnabled="true" acceptCount="100" clientAuth="false" disableUploadTimeout="true" enableLookups="false" maxThreads="25" port="8443" keystoreFile=“<file-Path>/.keystore" keystorePass="password" protocol="HTTP/1.1" scheme="https" secure="true" sslProtocol="TLS" />
  • 14. Log in to Salesforce.com with your developer account, navigate to Setup ➤ Develop ➤ Remote Access and click New to create a new remote access
  • 15. After clicking Save, you will see your new application’s credentials. Consumer Key and Consumer Secret
  • 16. Copy the consumer key and consumer secret and paste them to existing servlet parameters , build application and Run.  You will see an error message if the web app is not running on a secure port:
  • 17. Click the link and you are taken to the Salesforce.com login page:
  • 18. Login and a screen displays asking you to allow the sample app to access your data: This authorization page only appears the first time the web application requests access; subsequent sessions require authentication, but skip the authorization step.
  • 19. On authorizing access to your data, control returns to the sample web app, and it is able to interact with your Force.com data using a token issued during the OAuth process: