outpost/proxyv2: use fallback url if state is missing#20831
Open
chetan wants to merge 1 commit intogoauthentik:mainfrom
Open
outpost/proxyv2: use fallback url if state is missing#20831chetan wants to merge 1 commit intogoauthentik:mainfrom
chetan wants to merge 1 commit intogoauthentik:mainfrom
Conversation
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20831 +/- ##
==========================================
- Coverage 93.45% 93.41% -0.04%
==========================================
Files 993 993
Lines 55906 55968 +62
==========================================
+ Hits 52245 52282 +37
- Misses 3661 3686 +25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Details
Occasionally when opening a site protected w/ an outpost and while already logged in, an old cookie (I think?) on the protected hostname causes a session mismatch, even though a valid session is available on the auth host.
{"event":"mismatched session ID","is":"UOQAE7NDSD3I7NIBK7YZLNUHIYS...","level":"warning","logger":"authentik.outpost.proxyv2.application","name":"provider-foo","should":"ZGFF27AG5NQMIJGOHVYK6EU....","timestamp":"2026-03-10T15:04:51Z"} {"event":"invalid state","level":"warning","logger":"authentik.outpost.proxyv2.application","name":"provider-foo","timestamp":"2026-03-10T15:04:51Z"} {"event":"mismatched session ID","is":"UOQAE7NDSD3I7NIBK7YZLNUHIYS...","level":"warning","logger":"authentik.outpost.proxyv2.application","name":"provider-foo","should":"ZGFF27AG5NQMIJGOHVYK6EU...","timestamp":"2026-03-10T15:04:51Z"} {"event":"/outpost.goauthentik.io/callback?X-authentik-auth-callback=true&code=b56...snip...&state=ey...snip...","host":"hub.bixby.io","level":"info","logger":"authentik.outpost.proxyv2.application","method":"GET","name":"provider-foo","remote":"172.18.0.43:55790","runtime":"0.361","scheme":"http","size":0,"status":400,"timestamp":"2026-03-10T15:04:51Z","user":"chetan","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0"}Instead of failing with 400 Bad Request, we should always redirect the user back to the app as a fallback, so that the auth process can start again (the current workaround when you see bad request).
Closes #10848
Checklist
ak test authentik/)make lint-fix)If an API change has been made
make gen-build)If changes to the frontend have been made
make web)If applicable
make docs)