fix SSO
CI/CD (dev on branch, prod on tag) / setup (push) Canceled after 0s
CI/CD (dev on branch, prod on tag) / build-and-deploy (push) Canceled after 0s

This commit is contained in:
s871077
2026-09-22 10:39:17 +08:00
parent 167eb0807d
commit a79a01437a
3 changed files with 18 additions and 1 deletions
+3 -1
View File
@@ -32,7 +32,9 @@
"Bash(/tmp/windows-amd64/helm.exe template:*)", "Bash(/tmp/windows-amd64/helm.exe template:*)",
"Bash(echo \"exit=$?\")", "Bash(echo \"exit=$?\")",
"Read(//tmp/**)", "Read(//tmp/**)",
"Bash(tail:*)" "Bash(tail:*)",
"Bash(mkdir:*)",
"Bash(python3:*)"
] ]
} }
} }
+3
View File
@@ -7,6 +7,9 @@ metadata:
{{- include "it-cost-dashboard.componentLabels" (dict "ctx" . "component" "server") | nindent 4 }} {{- include "it-cost-dashboard.componentLabels" (dict "ctx" . "component" "server") | nindent 4 }}
annotations: annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "10m" nginx.ingress.kubernetes.io/proxy-body-size: "10m"
# Headroom for large request headers (chunked Auth.js session cookies).
nginx.ingress.kubernetes.io/proxy-buffer-size: "16k"
nginx.ingress.kubernetes.io/proxy-buffers-number: "4"
cert-manager.io/cluster-issuer: sectigo-acme cert-manager.io/cluster-issuer: sectigo-acme
spec: spec:
ingressClassName: {{ .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className }}
+12
View File
@@ -20,6 +20,18 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
clientSecret: process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET, clientSecret: process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET,
// Tenant-specific issuer restricts sign-in to our organization only. // Tenant-specific issuer restricts sign-in to our organization only.
issuer: process.env.AUTH_MICROSOFT_ENTRA_ID_ISSUER, issuer: process.env.AUTH_MICROSOFT_ENTRA_ID_ISSUER,
// The provider's default profile() pulls the Graph photo and inlines it as a
// base64 data-URI into user.image -> the `picture` JWT claim. Since sessions
// are JWTs, that becomes a multi-KB chunked session cookie whose combined
// Cookie header overflows nginx's proxy buffer -> 502 before the request ever
// reaches this app. We never render an avatar, so keep the token lean.
authorization: { params: { scope: "openid profile email" } },
profile: (profile) => ({
id: profile.sub,
name: profile.name,
email: profile.email,
image: null,
}),
}), }),
Credentials({ Credentials({
name: "Local account", name: "Local account",