Repository navigation
Conversation
Contributor
|
This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have read the contributing guideline and understand the modifications.
An LLM assisted me in writing the code or text for this PR
An LLM agent wrote the code or text for this PR
Description:
Stop copying the Authelia auth-request
Set-Cookieinto the named 401 redirect. An anonymous request that completes after a successful portal login can otherwise replace the newly authenticated cookie with the earlier anonymous session. Portal responses still set their own cookies, and the authentication policy is unchanged.Benefits of this PR and context:
This addresses a session race in the shared SWAG Authelia sample, not an application-specific change. Existing users must update
authelia-server.confto pick up the change. Closes #634.I reviewed #366: it addressed
add_headerinheritance and subfolder compatibility. This change leaves the auth subrequest and portal routing intact. In the tested fixture, the redirected response also regains the inherited HSTS header.How Has This Been Tested?
On x86-64 with Docker Engine 29.8.2, the current
lscr.io/linuxserver/swag:latestimage (5.8.0-ls495), Authelia 4.39.28, and private disposable Docker networks with test certificates and accounts:nginx -t, first-factor login, TOTP step-up, access after the second factor, logout and rejection of the logged-out session passed. A public OIDC client completed authorization-code flow with S256 PKCE and a token exchange, an Authelia portal under/authelia/completed a first-factor login, and a deliberately invalid session cookie was replaced by a successful portal login. With a three-second test idle timeout, expiry required reauthentication and a remembered session remained valid.Built the committed source with
docker build --no-cache --pull, using a temporary Dockerfile that adds one precedingRUNto replace the Alpine APK mirror with an HTTPS mirror because the default mirror stalled. The build also used a local HTTP proxy; the committed Dockerfile is unchanged. The resulting test image started successfully with an isolated certificate and test configuration, generated anauthelia-server.confidentical to the committed sample, and passednginx -t. It passed the headless-browser late-response test; after restart with the existing/config, anonymous access redirected without a session cookie and portal login restored access. This is not a bit-for-bit build of the unmodified Dockerfile because of the temporary mirror step.Source / References:
OpenAI Codex (GPT-6) performed the investigation, wrote the patch and this description, and ran the tests. Human review is still needed; no human review is claimed here.