Repository navigation
Document redirect-based login flows for custom auth managers - #76422
Open
hrithiksaini99 wants to merge 1 commit into
Open
hrithiksaini99 wants to merge 1 commit into
hrithiksaini99 wants to merge 1 commit into
Conversation
Custom auth managers that authenticate through a redirect chain can send the browser back to the UI before the token cookie is available. The UI then loads unauthenticated, its first API request returns 401, and the login flow starts again. Describe the two requirements from the FAB fix (apache#61287): set the token cookie on the redirect response, and mark the Flask session as modified before returning it.
This branch has not been deployed
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.
closes: #63521
Custom auth managers can implement
get_url_loginas the first hop of a redirect chain, for example through an identity provider. If the response that finally sends the browser back to the UI does not carry the_tokencookie, the UI loads unauthenticated, its first API request returns 401, and the login flow starts again. A Flask-based auth manager has the same problem when the session backing the login is not persisted before that response is sent.This follows the suggestion in #63521 to document the pattern used by the FAB auth manager in #61287. The new section covers:
_token, with a pointer to the existing FastAPI example in "JWT token management by auth managers";session.modified = Truebefore returning that response, asCustomAuthOAuthViewdoes in the FAB provider.Docs-only change; no behavior changes.
Verification:
codespellwith the repository wordlist: clean.rst2htmlparses the page with no structural warnings and resolves the new cross-reference.Was generative AI tooling used to co-author this PR?
Generated-by: DeepSeek V4.1 Flash Free following the guidelines