Skip to content

Commit b4d1919

Browse files
Add notes about supplying client user ID.
1 parent 1b474ac commit b4d1919

File tree

2 files changed

+61
-4
lines changed

2 files changed

+61
-4
lines changed

workshops/lab-lookup-consumption/workshop/content/07-requesting-workshops.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ The JSON request object needs to be of the form:
1818
{
1919
"tenantName": "<name>",
2020
"workshopName": "<name>",
21-
"clientUserId": "<id>",
2221
"clientIndexUrl": "<url>",
22+
"clientUserId": "<id>",
2323
"clientActionId": "<id>",
2424
"workshopParams": [
2525
{
@@ -36,10 +36,10 @@ The request properties are as follows:
3636
being made.
3737
* `workshopName` - The name of the workshop for which a session is being
3838
requested.
39-
* `clientUserId` - A unique identifier for the end user using the custom front
40-
end web portal.
4139
* `clientIndexUrl` - A URL to which the user should be redirected when the
4240
workshop session has been completed or has expired.
41+
* `clientUserId` - An optional unique identifier for the end user using the
42+
custom front end web portal.
4343
* `clientActionId` - An optional tracking ID to identify the request for a
4444
workshop session.
4545
* `workshopParams` - An optional list of parameters to be injected into the
@@ -91,6 +91,18 @@ The key property of interest in the response is `sessionActivationUrl` and all
9191
others are provided for debugging and auditing purposes only.
9292

9393
The custom front end web portal should redirect the user web browser to the URL
94-
given in `sessionActivationUrl`. This can be as a new browser window, or an
94+
given in `sessionActivationUrl`. This can be as a new browser window, or a
9595
browser HTML `iframe` could be used to load the URL resulting in the session
9696
being embedded with the custom front end web portal web page.
97+
98+
Note that redirection of the users browser to the session activation URL should
99+
be done immediately and the URL should not be cached for later use. This is
100+
because the URL session activation token included in the URL will expire after
101+
60 seconds.
102+
103+
Click on the session activation URL displayed in the terminal window to open
104+
a new browser window on the workshop session.
105+
106+
If you get that the page could not be found because you did not click before the
107+
activation token expired, request the workshop again, then click on the URL for
108+
the new session. Leave the workshop session browser page running for now.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: End User Identifier
3+
---
4+
5+
When requesting a workshop, a unique identifier for an end user making use of
6+
the custom front end web portal can be supplied. This is passed via the
7+
`clientUserId` property. This ID would usually be something like a uuid, but
8+
an email address might also be used.
9+
10+
If this property is not supplied, every time a workshop request is made against
11+
a specific workshop, even if initiated for the same end user, then a new
12+
workshop session will be returned. This will be the case even if that end user
13+
had already had an instance of that workshop running.
14+
15+
In order that a user is prevented from creating multiple workshop sessions for
16+
the same workshop, and to allow an end user to be reconnected to an existing
17+
workshop session in the event they may have accidentally closed their browser
18+
window, a unique identifier for every end user should be supplied when
19+
requesting a workshop. By doing this a workshop request will always return the
20+
existing workshop session if one already exists for that user.
21+
22+
To illustrate this mechanism in action, request the same workshop again using
23+
the same end user client ID. This should show the same result as before provided
24+
the workshop session is still running.
25+
26+
```terminal:execute
27+
command: |-
28+
curl --silent -X POST -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "Content-Type: application/json" -d '{"tenantName": "example-tenant", "workshopName": "lab-k8s-fundamentals", "clientIndexUrl": "https://www.example.com", "clientUserId": "end-user-id-1"}' http://educates-api.hub.{{< param session_name >}}.{{< param ingress_domain >}}/api/v1/workshops | jq
29+
```
30+
31+
Another benefit of always supplying a unique identifier for a user is that it is
32+
possible to also restrict the number of different workshops sessions that can be
33+
created for different workshops, when all the workshops are hosted by the same
34+
training portal.
35+
36+
Do note though that this last restriction on concurrent workshop sessions isn't
37+
a restriction which is enabled by default, and requires a training portal be
38+
configured to limit the number of concurrent workshop sessions a user can run
39+
across the set of workshops running on that training portal.
40+
41+
It is planned to also add in the future the ability to place such restrictions
42+
on the number of concurrent sessions a specific user can run in the lookup
43+
service itself. This will also allow the restriction to be enforced at the level
44+
of a tenant, meaning that the cap would apply across training portals on the
45+
same or different clusters.

0 commit comments

Comments
 (0)