Skip to content

Sequence Diagram

kimsungwon edited this page Nov 29, 2023 · 12 revisions

Sign-in

sequenceDiagram
	participant Browser
	participant mrc-api
	participant Google

	Browser ->> +mrc-api: Initiate sign-in request
	activate Browser
	activate Browser
	
	mrc-api ->> mrc-api: Generate anti-forgery state
	
	mrc-api ->> -Browser: Provide authentication URL
	deactivate Browser

	Browser ->> +Google: Request user authentication
	activate Browser
	
	Google ->> -Browser: Return sign-in redirect URL and authorization code
	deactivate Browser

	Browser ->> +mrc-api: Request sign-in with authorization code
	activate Browser
	
	mrc-api ->> mrc-api: Confirm state
	
	mrc-api ->> +Google: Request access token and ID token
	activate mrc-api

	Google ->> Google: Validate authorization code
		
	Google ->> -mrc-api: Return access token and ID token
	deactivate mrc-api
	
	mrc-api ->> mrc-api: Build user token

	mrc-api ->> -Browser: Provide user token cookie and redirect URL
	deactivate Browser
	deactivate Browser
Loading

Sign-out

sequenceDiagram
	participant Browser
	participant mrc-api
	
	Browser ->>+ mrc-api: Request sign-out
	activate Browser
	

	mrc-api ->>- Browser: Clear cookie
	deactivate Browser
Loading
Clone this wiki locally