OAuth Flashcards
When should you use the Web Server flow?
When the server hosting the web app is able to protect the connected app’s identity - defined by client ID and client secret
What are the end to end steps in the Web server flow?
- Request an authorization code using client ID
- User authenticates and authorises access
- SF grants authorization code
- Web app requests an access token using client ID & client secret
- SF grants the access token
What is the HTTP operation for requesting and getting the Authorization code for a web server flow?
HTTP Redirect
How are scopes handled in the web server flow?
Scopes can be passed as an additional parameter - otherwise the flow uses what is defined in the connected app
What is the endpoint for the authorize call in a web server flow?
https://login.salesforce.com/services/oauth2/authorize
How is the authorization code granted in a web server flow?
Redirects to the callback URL with code = xyz
How long lived is the authorization code in a web server flow?
15 minutes
Can you persist state in the authorization flow?
Yes - the state parameter is passed back if included in the initial authorization request
What are the key parameters in the authorization code request call of a web server flow?
client_id
What is the HTTP operation to request an access token in the web server flow?
POST to services/oauth2/token
What is the grant type to request an access token in the web server flow?
grant_type=authorization_code
What are the key parameters in the authorization code request call of a web server flow?
code, client_id, client_secret
When should you use the User-Agent flow
You have a client side mobile/browser application that cannot secure the client secret
What is the response type in the authorization code request call of a web server flow?
code
What is the response type in the authorization code request call of a user agent flow?
token or token id_token
What are the key parameters in the authorization code request call of a user agent flow?
client_id
Can the user agent flow issue a refresh token?
Yes