We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69b56ae commit 5a41fe9Copy full SHA for 5a41fe9
backend/templates/_openid_connect.conf
@@ -18,6 +18,27 @@
18
ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
19
end
20
21
+ {% if openidc_restrict_users_enabled -%}
22
+ local function contains(table, val)
23
+ for i=1,#table do
24
+ if table[i] == val then
25
+ return true
26
+ end
27
28
+ return false
29
30
+
31
+ local allowed_users = {
32
+ {% for user in openidc_allowed_users %}
33
+ "{{ user }}",
34
+ {% endfor %}
35
+ }
36
37
+ if not contains(allowed_users, res.id_token.email) then
38
+ ngx.exit(ngx.HTTP_FORBIDDEN)
39
40
+ {% endif -%}
41
42
43
ngx.req.set_header("X-OIDC-SUB", res.id_token.sub)
44
ngx.req.set_header("X-OIDC-EMAIL", res.id_token.email)
0 commit comments