Donuts.js 8/8/2018, SORT 10/9/2018
Bruce Campbell
A standard way to secure and share a resource
Particularly good at access delegation... granting access from one app to another without giving out your password
👨🏼💼
🧡
Do you want to grant
the access to...
☑️ Friendlist
☑️ Birthday
☑️ Email Address
☑️ Post to your timeline
Yes
No
👨🏼💼
👨🏼💼
👨🏼💼
App
Auth Provider
smells like single-sign-on
http://myapp.mydomain.com
What can be done
Who the current user is and their presence in the application
vs
(AuthZ)
(AuthN)
OAuth 2.0
OpenID Connect
The server the user interacts with to approve or deny requests to access their account, as well as the source of tokens
The application attempting to access a resource on a User's behalf
identifier (or username) that identifies a client to the authorization server
uh... the password
Strings that represent a relationship between a user, a client, and the OAuth server
string that represents that a user successfully authenticated - traded to the OAuth server for Tokens
The token given to the application to access the protected resource on the user or application's behalf
The token given to the application to request a new access token on its expiration
e4572e3e-2949-442b-90a0-aa00b6a7d6c5
Browser
node.js
app server
service a
service b
Architecture
Auth
Server
"client"
"user"
Browser
service a
service b
Auth
Server
"client"
"user"
User navigates to https://myapp.lds.org/demo
node.js
app server
Browser
service a
service b
Auth
Server
"client"
"user"
app server sends a redirect to the login screen
and the browser follows the redirect
node.js
app server
Browser
service a
service b
Auth
Server
"client"
"user"
User authenticates...
submitting credentials to the auth server
node.js
app server
Browser
service a
service b
Auth
Server
"client"
"user"
Auth Server responds with a redirect back to the app server... and includes an "authorization code"
node.js
app server
auth code
Browser
service a
service b
Auth
Server
"client"
"user"
The app server exchanges the auth code for
a pair of tokens (access & refresh)
node.js
app server
auth code
tokens
Browser
service a
service b
Auth
Server
"client"
"user"
app server needs data to render the page so...
makes an api call and includes the access token
node.js
app server
access token
Browser
service a
service b
Auth
Server
"client"
"user"
"service a" verifies the access token using it's own client id and client secret
node.js
app server
access token
👍
Browser
service a
service b
Auth
Server
"client"
"user"
"service a" responds with the data, the app server renders the page and responds to the browser
node.js
app server
👞 👟 👠
👡 👢