Skip to content

Document redirect-based login flows for custom auth managers - #76422

Open
hrithiksaini99 wants to merge 1 commit into
apache:mainfrom
hrithiksaini99:docs/63521-redirect-login-flows
Open

hrithiksaini99 wants to merge 1 commit into
apache:mainfrom
hrithiksaini99:docs/63521-redirect-login-flows

Conversation

@hrithiksaini99

Copy link
Copy Markdown

closes: #63521

Custom auth managers can implement get_url_login as 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 _token cookie, 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:

  • the final redirect response must set _token, with a pointer to the existing FastAPI example in "JWT token management by auth managers";
  • a Flask-based auth manager must set session.modified = True before returning that response, as CustomAuthOAuthView does in the FAB provider.

Docs-only change; no behavior changes.

Verification:

  • codespell with the repository wordlist: clean.
  • rst2html parses the page with no structural warnings and resolves the new cross-reference.

Was generative AI tooling used to co-author this PR?
  • Yes (DeepSeek V4.1 Flash Free via OpenCode)

Generated-by: DeepSeek V4.1 Flash Free following the guidelines

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misleading authentication error during login for auth manager's with redirect auth flows

1 participant