Skip to content

Sequence Diagram

kimsungwon edited this page Nov 9, 2023 · 12 revisions

Sign-in

sequenceDiagram
Client ->> Server: Request sign-in with ID token
activate Server

Server ->> Firebase: Verify ID token
activate Firebase
Firebase ->> Server: Return result of ID token's verification
deactivate Firebase

	alt is verified
		Server ->> Server: Issue user token
		Server ->> Client: Set user token as cookie
	else is not verified
		Server ->> Client: 401 UNAUTHORIZED
	end
deactivate Server
Loading

Sign-out

sequenceDiagram
Client ->> Server: Request sign-out
activate Server
Server ->> Client: Clear cookie
deactivate Server
Loading
sequenceDiagram
participant User
participant Browser
mrc-ui ->> mrc-api: Request for sign-in
activate mrc-ui
activate mrc-api
mrc-api ->> mrc-api: Create an anti-forgery state token
mrc-api ->> /oauth2/v2/auth: Request for authentication
activate /oauth2/v2/auth
/oauth2/v2/auth -->> mrc-api: Return redirect url for authentication
deactivate /oauth2/v2/auth
mrc-api -->> Browser: Redirect to google authentication page
deactivate mrc-api
User ->> Browser: Input credentials (id, pw)
Browser ->> /oauth2/v2/auth: Request for authenticate
/oauth2/v2/auth ->> mrc-api: Redirects to sign-in url
mrc-api ->> mrc-api: Confirm state token
mrc-api ->> /token: Request Access token and ID token
activate mrc-api
/token -->> mrc-api: Return Access token and ID token
mrc-api ->> mrc-api: Build MRC Token
mrc-api -->> mrc-ui: Return MRC Token
deactivate mrc-api
deactivate mrc-ui
Loading
Clone this wiki locally