WellData Implementation Guide
0.1.0 - ci-build
WellData Implementation Guide - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
The OIDC/SOLID-OIDC specification defines how owners of the pods need to authenticate towards an IDP and how resource servers can verify the identity of pod owners based on that authentication. The SOLID-OIDC flow is described in detail here
For the Welldata implementation we filled in the correct endpoints for our ACC environment.
The Solid OIDC flow is initiated by the user, triggering a login action on the Welldata Frontend application
In the call from the frontend to the backend the redirect url should be passed to which the user should return after the Solid OIDC flow is completed:
https://<backend>/login?redirectUrl=<front end redirecturl>
The backend initiates a redirect of the user to the IDP which can authenticate the user:
https://authenticatie-ti.vlaanderen.be/op/v1/auth?client_id=<>&scope=openid+offline_access+webid+rrn&response_type=code&redirect_uri=<backend-url>/oidc-redirect&code_challenge<>&state=<>&code_challenge_method=S256&prompt=consent
The folowing parameters are passed in the call
code
, which means the request follows the Authorization Code Flow, where the authorization server returns a one-time code that must be exchanged for an access token.In the next 2 steps the user is prompted to authenticate himself using credentials.
After authentication the user is redirected with a call to the Welldata backend.
https://<backend>/oidc-redirect?code=<>&state=<>
With this call 2 parameters are passed:
Next call is a post to the IDP broker to exchange the authorization code for the right tokens
https://authenticatie-ti.vlaanderen.be/op/v1/token body {grant_type=authorization_code&code=<>&redirect_uri=<frontend>&client_id=<>&code_verifier=<>}
The following parameters in the body are required for this call:
The IDP broker will now return the access token and id token of the user and the user is logged in.
The We Are consortium developed a demo application showcasing all the different steps necessary to read, write and share resources in a pod.
Starting an authentication flow from the frontend application is explained in the Authentication part of the front end demo application, which can be found here.
This angular front end app will then redirect the user to login
endpoint of the We Are Backend application. In order to successfully start the login flow, the right environment variables need to be set on the backend application:
CITIZEN_OIDC_CLIENT_ID
CITIZEN_OIDC_CLIENT_SECRET