|
| 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