useful sequence diagrams
jchris opened this issue · 0 comments
jchris commented
Here are 3 sequence diagrams of how this works, that you can plug into https://www.websequencediagrams.com/ when you are making slides or whatever.
title Authentication
Browser->Sign In: Initial request
Sign In -> Facebook: Redirect
note over Facebook: Approve login
Facebook -> Callback: Redirect
Callback -> FaunaDB: Find or create user
FaunaDB -> Callback: Database secret for user
Callback -> Browser: Set authorization header
title Authorization
Browser -> Content Service: API Request
Content Service -> Authorizer: Authorization to Policy
Authorizer -> Content Service: Policy w/ FaunaDB Secret
Content Service <-> FaunaDB: Load application data
Content Service -> Browser: Render API response
title Refresh
Browser -> Content Service: API Request
Content Service -> Authorizer: Authorization to Policy
Authorizer -> Content Service: Access denied
Content Service -> Browser: Access denied
Browser -> Refresh: XHR Request with refresh token
Refresh -> FaunaDB: Find user for token
FaunaDB -> Refresh: Database secret for user
Refresh -> Browser: Set Authorization Header
Looks like this: