You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: auth.md
+86-62
Original file line number
Diff line number
Diff line change
@@ -122,96 +122,120 @@ sequenceDiagram
122
122
123
123
## Option C (Proposal Swen)
124
124
125
-
### Initial thoughts
125
+
### Initial thoughts and running environment
126
126
127
127
**Ingestor**
128
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
129
+
- can run _either_ as a
130
+
- central service
131
+
- client application
132
+
- if run as a client application:
133
+
- cannot contain any secret (e.g. service account for SciCat)
134
+
- app must be authorised by the user
133
135
134
136
**User**
135
137
136
-
- does not want to log in all the time
137
-
- is only interested in starting a job
138
+
- does not want to log in all the time (single sign-on preferred)
139
+
- is only interested in _starting_ a job (fire and forget), e.g.
138
140
- archive data
139
141
- unarchive data
140
-
-his authentication token can time out
142
+
-the job itself needs to be able to report when its done, independently of the user
141
143
142
144
**SciCat**
143
145
144
146
- only accepts authenticated requests
147
+
- currently only SciCat tokens
148
+
- refresh tokens are not supported
149
+
- Service Accounts
145
150
- issues its own SciCat tokens (JWT with HS256 algorithm, aka Β«self signedΒ»)
146
151
- 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
152
+
-acts as an authority instance
153
+
- issues SciCat tokens
154
+
- offers a self-made mechanism to check validity of a SciCat token
150
155
151
-
**Archiver Service**
156
+
**ETHZ Archiver Service**
152
157
153
158
- 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.
159
+
- JWT RS256 tokens issued and signed by Keycloak
160
+
- JWT HS256 tokens issued by SciCat
161
+
- can issue a Ingester token for a valid SciCat token
162
+
- has service account for SciCat
163
+
- must be able to report the status of a dataset any time to SciCat
164
+
165
+
### Use-case: User archives data (MinIO S3 Storage)
166
+
167
+
**Notes**:
168
+
169
+
- the diagram below does not include any authorisation information, only authentication.
170
+
- In future we would like to use JWT π that contain authorisation information, e.g. tokens for every dataset upload.
171
+
- ETH use-case:
172
+
- Ingestor can run as a service or a client application
173
+
- does not contain any service account
174
+
- exchanges the User SciCat π to a Ingestor π when starting upload (fire and forget)
175
+
- use of MinIO S3 instead of Globus for upload
176
+
- ETHZ Archiver Service has service accounts for:
177
+
-**S3** to get pre-signed URLs for data upload
178
+
-**SciCat** to report upload finish and schedule dataset archival
179
+
- PSI use-case:
180
+
- a) Ingestor is run as a service
181
+
- Ingestor can contain a service account
182
+
- Ingestor can report back to SciCat
183
+
- b) Ingestor is run as a client application
184
+
- Ingestor _cannot_ contain a service account
185
+
- Ingestor _cannot_ report back to SciCat
186
+
- instead, PSI needs to implement something similar like the ETHZ Archiver Service
167
187
168
188
169
189
```mermaid
170
190
sequenceDiagram
171
191
autonumber
172
192
participant B as Browser
173
193
participant S as Scicat Backend
174
-
participant I as Ingestor Service
175
-
participant G as Storage (Globus)
194
+
participant I as Ingestor Application/Service
176
195
participant A as ETHZ Archiver Service
196
+
participant M as MinIO S3 Storage
177
197
participant K as Keycloak
178
198
179
-
B -) S: Access
199
+
Note over B, K: Authorise User
200
+
B -) S: request access
180
201
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 π)
0 commit comments