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
The Queue-it Security Framework is used to ensure that end users cannot bypass the queue by adding a server-side integration to your server. It was developed and verified with Lua v.5.1. **Running this SDK on Lua versions higher than this (ex. v.5.3) will not work**.
2
+
Before getting started please read the [documentation](https://github.com/queueit/Documentation/tree/main/serverside-connectors)to get acquainted with server-side connectors.
3
3
4
-
## Introduction
5
-
When a user is redirected back from the queue to your website, the queue engine can attach a query string parameter (`queueittoken`) containing some information about the user.
6
-
The most important fields of the `queueittoken` are:
4
+
The Lua connector can run on web platforms that support a LUA runtime. It was developed and verified with Lua v.5.1.
7
5
8
-
- q - the users unique queue identifier
9
-
- ts - a timestamp of how long this redirect is valid
10
-
- h - a hash of the token
6
+
**Using it with Lua versions higher than this (ex. v.5.3) will not work**.
2. The validation method sees that the has no Queue-it session cookie and no `queueittoken` and sends him to the correct queue based on the configuration
18
-
3. User waits in the queue
19
-
4. User is redirected back to your website, now with a `queueittoken`
20
-
5. The validation method validates the `queueittoken` and creates a Queue-it session cookie
21
-
6. The user browses to a new page and the Queue-it session cookie will let him go there without queuing again
22
-
23
-
## How to validate a user
24
-
To validate that the current user is allowed to enter your website (has been through the queue) these steps are needed:
25
-
26
-
1. Providing the queue configuration to the KnownUser validation
27
-
2. Validate the `queueittoken` and store a session cookie
28
-
29
-
### 1. Providing the queue configuration
30
-
The recommended way is to use the Go Queue-it self-service portal to setup the configuration.
31
-
The configuration specifies a set of Triggers and Actions. A Trigger is an expression matching one, more or all URLs on your website.
32
-
When a user enter your website and the URL matches a Trigger-expression the corresponding Action will be triggered.
33
-
The Action specifies which queue the users should be sent to.
34
-
In this way you can specify which queue(s) should protect which page(s) on the fly without changing the server-side integration.
35
-
36
-
This configuration can then be downloaded to your application server.
37
-
Read more about how *[here](https://github.com/queueit/KnownUser.V3.Lua/tree/master/Documentation)*.
38
-
39
-
### 2. Validate the `queueittoken` and store a session cookie
40
-
To validate that the user has been through the queue, use the `knownUser.validateRequestByIntegrationConfig` method.
41
-
This call will validate the timestamp and hash and if valid create a "QueueITAccepted-SDFrts345E-V3_[EventId]" cookie with a TTL as specified in the configuration.
42
-
If the timestamp or hash is invalid, the user is send back to the queue.
43
-
44
-
## Implementation
45
-
46
-
The Lua connector SDK can run on web platforms that support a LUA runtime.
47
-
It works by having all general code within the SDK (https://github.com/queueit/KnownUser.V3.Lua/tree/master/SDK) and platform specific code in handlers.
48
-
With this solution the SDK code stays unmodified and only a little work is needed to create or modify handlers (https://github.com/queueit/KnownUser.V3.Lua/tree/master/Handlers).
8
+
The connector works by having all general code within the [SDK](https://github.com/queueit/KnownUser.V3.Lua/tree/master/SDK) and platform specific code in handlers.
9
+
With this solution the SDK code stays unmodified and only a little work is needed to create or modify [handlers](https://github.com/queueit/KnownUser.V3.Lua/tree/master/Handlers).
49
10
50
11
Currently we offer handlers and tested example code for the following platforms:
51
12
@@ -54,25 +15,11 @@ Currently we offer handlers and tested example code for the following platforms:
54
15
55
16
However if you have another platform it's straitforward to implement the missing parts in a new handler.
56
17
57
-
To create a platform handler you will need to implement the missing parts in KnownUserImplementationHelpers.lua:
18
+
To create a platform handler you will need to implement the missing parts in `KnownUserImplementationHelpers.lua`:
58
19
- Read request URL
59
20
- Read request host (user agent IP address)
60
21
- Read request headers
61
22
- Read request cookies
62
23
- Write response cookies
63
24
64
-
Look at existing handlers for inspiration.
65
-
66
-
### Protecting ajax calls
67
-
If you need to protect AJAX calls beside page loads you need to add the below JavaScript tags to your pages:
0 commit comments