-
Notifications
You must be signed in to change notification settings - Fork 0
/
token-exchange.puml
81 lines (77 loc) · 1.86 KB
/
token-exchange.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
@startuml
actor "User" as U
participant "Jupyterhub" as JH
box "//''Authorization Server''//" #LightSteelBlue
participant "Keycloak (Identity broker)" as KC
participant "Google IDP" as IDP
end box
box "//''Resources''//" #LightGreen
participant "Internal services" as RS
participant "Google services" as GCS
end box
U -> JH: Access resource
JH -> KC: Authorization request
activate KC
note over KC
Authorization request:
client_id
scope
response_type=code
end note
KC --> U: List of Identity Providers
U-> KC: Select Identity Provider (Google)
KC -> IDP: Authentication request
activate IDP
deactivate KC
U -> IDP: Login & authorization consent
IDP -> IDP: Validates and \nsigns in the user
IDP --> KC: Authentication response
deactivate IDP
activate KC
KC -> KC: Local authentication + identity federation
KC --> JH: Authorization code
JH -> KC: /oauth2/token
note over KC
Access token request:
grant_type="authorization_code"
client_id="Jupyterhub"
client_secret
authorization_code
end note
KC -> IDP: /oauth2/authorize
activate IDP
IDP --> KC: redirect_uri + \nauthorization code
KC -> IDP: /oauth2/token
note over IDP
Access token request:
grant_type="authorization_code"
client_id="Keycloak"
client_secret
authorization_code
end note
IDP --> KC: Google access token + \nrefresh token
deactivate IDP
KC --> JH: Keycloak access token + \nrefresh token
JH -> KC: request for token exchange
note over KC
Exchange token request:
grant_type="token-exchange"
subject_type=access_token
client_id="Jupyterhub"
client_secret
end note
KC --> JH: Google access token
deactivate KC
break
loop
JH -> RS: API call + Keycloak access token
activate RS
RS --> JH: API call response
deactivate RS
JH -> GCS: API call + Google access token
activate GCS
GCS --> JH: API call response
deactivate GCS
end
break
@enduml