feat(kanidm): Upgrade to rc.16 and fix an issue with CORS..........

This commit is contained in:
Tom Hubrecht 2024-02-22 12:47:18 +01:00
parent dd721feb2f
commit 39da96f325

View file

@ -1,4 +1,4 @@
{ config, ... }: { config, sources, ... }:
let let
domain = "sso.dgnum.eu"; domain = "sso.dgnum.eu";
@ -18,6 +18,8 @@ in
services.kanidm = { services.kanidm = {
enableServer = true; enableServer = true;
package = (import sources.nixos-unstable { }).kanidm;
serverSettings = { serverSettings = {
inherit domain; inherit domain;
@ -55,6 +57,8 @@ in
set $origin 'https://${domain}'; set $origin 'https://${domain}';
} }
proxy_hide_header Access-Control-Allow-Origin;
if ($request_method = 'OPTIONS') { if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' "$origin" always; add_header 'Access-Control-Allow-Origin' "$origin" always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PATCH, PUT, DELETE, OPTIONS' always; add_header 'Access-Control-Allow-Methods' 'GET, POST, PATCH, PUT, DELETE, OPTIONS' always;