본문 바로가기

ETC/끄적끄적

OAuth 서드파티 시퀀스 다이어그램

레퍼런스 : https://plantuml.com/ko/guide

 

PlantUML Language Reference Guide

 

plantuml.com

 

GitHub TPA 로그인 플로우를 만들어보려고 고민하면서 시퀀스 다이어그램을 끄적끄적...

 

 

@startuml test
skinparam SequenceBoxBackgroundColor #FFFFFF30
skinparam SequenceBoxBorderColor #00000070

box "LOCAL"
actor       PLAYER              as user
participant GAME_CLIENT         as client
end box

box "REMOTE"
participant GAME_AUTH_SERVER    as server
database    GAME_DB             as db
end box

control     TPA_OAUTH_WEB       as web
participant TPA_SERVER          as tpa

user    ->  client  : Open App
client  ->  client  : Initialize
' user    <-- client  : Initialize done.

note over user : Login

' user    ->  client  : sign in with tpa
client  ->  client  : query cached token

opt cached token exist
client  ->  server  : sigin_in_with_tpa_token \n(/w token)
server  ->  server  : validate registered token
server  ->  db      : query token
server  <-- db      : query result

server  ->  tpa     : validate token
tpa     ->  tpa     : validate expiration
server  <-- tpa     : validation result

alt expired
server  ->  server  : generate oauth link
client  <-- server  : oauth_url
client  ->  client  : open_port
client  ->  server  : register_local_port \n(/w port_number)
server  ->  server  : create mapping uid-port
client  <-- server  : mapping result
client  ->  web     : open url
web     ->  web     : login
web     ->  tpa     : oauth_result
server  <-- tpa     : fallback \n(/r tpa_user_info)
server  ->  server  : update info
' server  ->  db      : write
' server  <-- db      : 
client  <-- server  : login_result


else valid token
server  ->  tpa     : request_tpa_user_info
tpa     ->  tpa     : get_tpa_info
server  <-- tpa     : tpa_user_info
server  ->  db      : query user_info
server  <-- db      : query result
client  <-- server  : login_result
end

end

opt not logged in
client  ->  server  : request_tpa_policy \n(/w client_info)
server  ->  server  : validate service id, client id
client  <-- server  : result_tpa_policy

user    <-- client  : show tpa list
user    ->  client  : select tpa to sign in

client  ->  server  : get_tpa_link \n(/w token)
server  ->  server  : generate oauth link
client  <-- server  : oauth_url
client  ->  client  : open_port
client  ->  server  : register_local_port \n(/w port_number)
server  ->  server  : create mapping uid-port
client  <-- server  : mapping result
client  ->  web     : open url
web     ->  web     : login
web     ->  tpa     : oauth_result
server  <-- tpa     : fallback \n(/r tpa_user_info)
server  ->  server  : create user_info
server  ->  db      : write
server  <-- db      : 
client  <-- server  : login_result

end

user    <-- client  : login result

@enduml

'ETC > 끄적끄적' 카테고리의 다른 글

언리얼 엔진 5 루멘 챌린지 작업 후기  (0) 2021.07.28
[C#] Enum의 모든 값 가져오기  (0) 2021.06.30