Skip to content

Commit 0362e29

Browse files
adjustment for hti flow
1 parent c0feb8a commit 0362e29

File tree

3 files changed

+33
-15
lines changed

3 files changed

+33
-15
lines changed
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
@startuml
2-
title Solid OIDC Flow
2+
title Authentication Flow with HTI Token
33
actor "User" as user
44
participant "Welldata FE" as welldataFE
55
participant "Welldata BE" as welldataBE
66
participant "ACM/IDM" as acm
7+
participant "We Are" as weare
78

89

910
group Solid OIDC Flow
1011
user->welldataFE: login
1112

1213
welldataFE->welldataBE: GET https://<backend>/login
13-
welldataBE->acm: GET https://authenticatie-ti.vlaanderen.be/op/v1/auth
14+
welldataBE->weare: redirect GET https://we-are-acc.vito.be/nl/hti/launch?client_id=&redirect_uri=
15+
weare->acm: redirect GET https://authenticatie-ti.vlaanderen.be/op/v1/auth
1416
acm->user:prompt authentication
1517
user-->acm: provide credentials
16-
acm-->welldataBE: GET https://<backend>/oidc-redirect?code=<>&state=<>
17-
welldataBE->acm: POST https://authenticatie-ti.vlaanderen.be/op/v1/token
18-
acm-->welldataBE: access token and id token incl. webId
19-
welldataBE->welldataFE: user logged in and redirect back to original redirect url
18+
acm-->weare: GET https://<backend>/oidc-redirect?code=<>&state=<>
19+
weare->acm: POST https://authenticatie-ti.vlaanderen.be/op/v1/token
20+
acm-->weare: access token and id token incl. webId
21+
weare->weare: create HTI token
22+
weare->welldataFE: user logged in and redirect back to original redirect url via post and HTI token in post body
2023

2124
end
2225
@enduml

input/images/HTI-flow.png

29.4 KB
Loading

input/pagecontent/technical-user-authentication.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
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.
22
The SOLID-OIDC flow is described in detail [here](https://solidproject.org/TR/oidc-primer#solid-oidc-flow)
33

4-
For the Welldata implementation we filled in the correct endpoints for our ACC environment.
4+
All applications who are registered in the We Are IDP, can make use of the HTI token flow. The flow is show below:
5+
6+
<img src="HTI-flow.png" alt="Anonymous login" style="width: 50%; float: none;"/>
7+
8+
All applications are first directed to the We Are login flow. There the user needs to choose a valid IDP. For now supported are ACM/IDM and NUTS via Microsoft Authenticator.
9+
When selecting an IDP the user is directed to either the NUTS OIDC flow or ACM/IDM Solid OIDC flow. Upon authentication a token will be generated and provided to the We Are Platform.
10+
There the token will be unpacked and the webId will be extracted and a new token is created: the HTI-token. This token contains the webId in the sub, which is the necessary information that the application (Welldata/Zipster/Selfcare/GG) needs to start the Access Request flow to acces the pod of the user.
11+
12+
We describe the complete flow with as example the Welldata application:
513

614
{::nomarkdown}
715
{% include solid-oidc.svg %}
816
{:/}
917

1018
### User initiates login
1119

12-
The Solid OIDC flow is initiated by the user, triggering a login action on the Welldata Frontend application
20+
The We Are login flow is initiated by the user, triggering a login action on the Welldata Frontend application
1321

1422
### Calling backend
1523

@@ -19,15 +27,19 @@ In the call from the frontend to the backend the redirect url should be passed t
1927
https://<backend>/login?redirectUrl=<front end redirecturl>
2028
```
2129

22-
### Redirect to IDP
30+
### Redirect to We Are
2331

24-
The backend initiates a redirect of the user to the IDP which can authenticate the user:
32+
The backend initiates a redirect of the user to We Are and We Are will then redirect the user to the IDP which can authenticate the user:
2533

2634
```
35+
redirect GET https://we-are-acc.vito.be/nl/hti/launch?client_id=&redirect_uri=
2736
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
2837
```
38+
The parameters for the HTI flow passed to We Are are:
39+
- client_id: Identifies the client application that wants to start the We Are login flow. This client needs to be registered in the We Are IDP.
40+
- redirect_uri: the redirect URI to which the users needs to be redirected back upon completion of authentication.
2941

30-
The folowing parameters are passed in the call
42+
Next We Are will forward the user to the authentication endpoint of the IDP passing the following parameters:
3143

3244
- client_id: Identifies the client application that is making the request. This is assigned by the identity provider (in this case, authenticatie-ti.vlaanderen.be).
3345
- scope: Specifies the access rights the application is requesting. In this case:
@@ -50,7 +62,7 @@ In the next 2 steps the user is prompted to authenticate himself using credentia
5062

5163
### Authorization code is exchanged with the backend
5264

53-
After authentication the user is redirected with a call to the Welldata backend.
65+
After authentication the user is redirected with a call to the We Are backend.
5466
```
5567
https://<backend>/oidc-redirect?code=<>&state=<>
5668
```
@@ -79,16 +91,19 @@ The following parameters in the body are required for this call:
7991

8092
The IDP broker will now return the access token and id token of the user and the user is logged in.
8193

94+
### We Are creates the HTI token and passes it to the Welldata application
95+
96+
Next step the HTI token is created with the corresponding webId in the sub of the HTI token. The token is then passed via a post to the Welldata application and directs the user back to the redirect URL of Welldata.
8297

8398
### Example implementation in We Are Demo Application
8499

85-
The We Are consortium developed a demo application showcasing all the different steps necessary to read, write and share resources in a pod.
100+
The We Are consortium developed a demo application showcasing all the different steps necessary to read, write and share resources in a pod.
86101

87-
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](https://github.com/VITObelgium/We-Are-Demo-Front-End).
102+
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](https://github.com/VITObelgium/We-Are-Demo-Front-End).
88103

89104
This angular front end app will then redirect the user to `login`endpoint of the [We Are Backend application](https://github.com/VITObelgium/We-Are-Demo-Back-End). In order to successfully start the login flow, the right environment variables need to be set on the backend application:
90105

91106
```
92107
CITIZEN_OIDC_CLIENT_ID
93108
CITIZEN_OIDC_CLIENT_SECRET
94-
```
109+
```

0 commit comments

Comments
 (0)