Skip to content

Commit def3da8

Browse files
add proposal Swen
1 parent c683578 commit def3da8

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

β€Žauth.md

+97
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,100 @@ sequenceDiagram
118118

119119
- Accept Ingestor-JWT as a valid login method. This may require token exchange, since
120120
scicat and the ingestor have different clientIds
121+
122+
123+
## Option C (Proposal Swen)
124+
125+
### Initial thoughts
126+
127+
**Ingestor**
128+
129+
- can run anywhere
130+
- therefore, it cannot contain any secret
131+
- needs to talk to SciCat and Archiver Service API
132+
- needs to be authorised with a user token
133+
134+
**User**
135+
136+
- does not want to log in all the time
137+
- is only interested in starting a job
138+
- archive data
139+
- unarchive data
140+
- his authentication token can time out
141+
142+
**SciCat**
143+
144+
- only accepts authenticated requests
145+
- issues its own SciCat tokens (JWT with HS256 algorithm, aka Β«self signedΒ»)
146+
- after a user has successfully logged in to Keycloak
147+
- currently only accepts SciCat tokens
148+
- so it acts as an authority instance
149+
- offers a self-made mechanism to check if a SciCat token is valid
150+
151+
**Archiver Service**
152+
153+
- only accepts authenticated requests
154+
- issues Keycloak service tokens (JWT with RS256, public key signed)
155+
- currently only accepts JWT tokens issued and signed by Keycloak
156+
157+
### What needs to be done
158+
159+
- Archiver Service
160+
- needs to be able to accept SciCat πŸ”‘ as well (see ScopeMArchiver#146)
161+
- needs to be able to create valid SciCat πŸ”‘ (variant A)
162+
- SciCat
163+
- can exchange Ingestor JWT πŸ”‘ for Ingestor SciCat πŸ”‘ (variant B)
164+
- accepts all JWT πŸ”‘ issued and signed by Keycloak (variants C+D)
165+
166+
**Note**: the diagram below does not yet include any authorisation information. It only includes authentication. In future we would like to use JWT πŸ”‘ that contain authorisation information, e.g. tokens for every dataset upload.
167+
168+
169+
```mermaid
170+
sequenceDiagram
171+
autonumber
172+
participant B as Browser
173+
participant S as Scicat Backend
174+
participant I as Ingestor Service
175+
participant G as Storage (Globus)
176+
participant A as ETHZ Archiver Service
177+
participant K as Keycloak
178+
179+
B -) S: Access
180+
S -) K: User Login (redirect)
181+
K --) S: User JWTπŸ”‘
182+
S ->> S: Exchange User JWT πŸ”‘ for SciCat πŸ”‘
183+
S --) B: User SciCat πŸ”‘
184+
B --) I: User SciCat πŸ”‘
185+
I --) A: User SciCat πŸ”‘
186+
alt tbd. ScopeMArchiver issue 146
187+
A -) S: verify + request User info (User SciCat πŸ”‘)
188+
S -) A: OK + User info
189+
end
190+
A -) K: request Ingestor JWT πŸ”‘ (user/pw)
191+
K --) A: Ingestor JWT πŸ”‘
192+
A --) I: Ingestor JWT πŸ”‘
193+
I ->> I: store refresh-token of Ingestor JWT πŸ”‘
194+
I -) A: request S3 credentials (Ingestor JWT πŸ”‘)
195+
A --) I: S3 credentials
196+
I ->> I: upload to S3 ⏳
197+
I -) A: report S3 upload finished (Ingestor JWT πŸ”‘)
198+
199+
alt Variant A: Archiver can create Ingestor SciCat πŸ”‘
200+
A -) S: request Ingestor SciCat πŸ”‘ (secret/Basic Auth)
201+
S --) A: Ingestor SciCat πŸ”‘
202+
A --) I: Ingestor SciCat πŸ”‘
203+
I -) S: report dataset upload finished (Ingestor SciCat πŸ”‘)
204+
else Variant B: SciCat exchanges Ingestor JWT πŸ”‘ for SciCat πŸ”‘
205+
I -) S: request Ingestor SciCat πŸ”‘ (Ingestor JWT πŸ”‘)
206+
S -->> S: Exchange Ingestor JWT πŸ”‘ for SciCat πŸ”‘
207+
S --) I: Ingestor SciCat πŸ”‘
208+
I -) S: report dataset upload finished (Ingestor SciCat πŸ”‘)
209+
else Variant C: SciCat accepts Ingestor JWT πŸ”‘
210+
I -) S: report archiving finished (Ingestor JWT πŸ”‘)
211+
else Variant D: Archiver report directly back to SciCat
212+
A ->> A: store Ingestor JWT πŸ”‘
213+
A ->> A: wait until upload is finished ⏳
214+
A -) S: report archiving finshed (Ingestor JWT πŸ”‘)
215+
end
216+
217+
```

0 commit comments

Comments
Β (0)