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: docs/architecture.md
+59-4Lines changed: 59 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,9 +122,34 @@ Authentication and authorization are critical components of the APEx Dispatch AP
122
122
In this scenario, all jobs are executed on the external platforms using a generic APEx service account that has access to them. This means that each job or upscaling task triggered through the API is executed on the platform under the APEx account, rather than the actual user’s identity. However, the Dispatch API maintains the link between the platform job ID and the user who initiated the request in its database.
* Propagating user identity across platforms is a technical challenge and currently lacks a proven, ready-to-use solution.
159
-
* May require modifications on the target platform to support user impersonation, depending on the chosen implementation strategy.
184
+
* May require modifications on the target platform to support user impersonation, depending on the chosen implementation strategy.
185
+
186
+
187
+
#### Implementation: OIDC Token Exchange via APEx Keycloak
188
+
The APEx Dispatch API implements user impersonation by utilising the OpenID Connect (OIDC) Token Exchange flow, which is facilitated through the APEx Keycloak instance. In this scenario, APEx Keycloak serves as an OIDC broker, interacting with external OIDC instances to enable secure and seamless user authentication across multiple platforms.
189
+
190
+
To start, users authenticate via the standard login process through the APEx Keycloak. Leveraging the provided tools or scripts, the user’s APEx Keycloak access token is used to submit requests to the APEx Dispatch API by including their access token within the request headers. When the Dispatch API needs to interact with an external API, such as GEP’s OGC API - Process API or CDSE’s openEO API, it triggers a token exchange operation with the APEx Keycloak instance.
Through this process, the APEx Keycloak uses the submitted user access token to issue an exchanged token corresponding to the external Identity Provider (IdP) of the target platform (e.g., GEP or CDSE). The resulting token functions as an external access token, recognised by the respective external platform and including the identity of the original requester. This token is then returned to the APEx Dispatch API.
199
+
200
+
Upon receiving the exchanged token, the APEx Dispatch API proceeds to authenticate with the external API by presenting the external access token. This mechanism ensures that the external system accurately identifies the user, thereby maintaining continuity and integrity in user access and identity management across various platforms.
201
+
202
+
##### Prerequisites
203
+
The implementation of the Token Exchange process requires the following:
204
+
205
+
* Every platform needs to be set up as an external IdP in APEx Keycloak, which includes creating a client on the external platform.
206
+
* The client used by the APEx Dispatch API must be authorised to perform token exchanges for the IdPs associated with supported platforms. This can be managed within the APEx Keycloak environment.
207
+
* For user token exchange, the user's account must be linked via the platform's IdP. Users can link their accounts through the APEx account dashboard or by signing into APEx with the corresponding external IdP.
208
+
209
+
##### Considerations
210
+
The following considerations should be noted in this scenario:
211
+
212
+
* This scenario requires the user to possess a valid account on the platform with appropriate authorisation to access various resources.
213
+
* Each platform must be onboarded individually as an external identity provider.
214
+
* The association between the user's account and the external platform is subject to expiration, requiring the user to periodically re-link their account.
0 commit comments