feat(auth): add external_consent param to suppress misleading warning#3473
Merged
jlowin merged 2 commits intoPrefectHQ:mainfrom Mar 14, 2026
Merged
Conversation
jlowin
requested changes
Mar 13, 2026
Member
There was a problem hiding this comment.
It's a good outcome but the solution is complicated and introduces tightly coupled kwargs.
My suggestion is to type
require_authorization_consent: bool | Literal["external"] = True
so that users who want to indicate that it is required but handled externally can do so. Passing external would suppress the warning.
This also needs to be implemented as a forwarded keyword argument from every OAuthProxy subclass (otherwise, it can't be used) and documented.
It may be considerably simpler to add a note to the logged warning that says "if consent is handled externally by your IdP, this is expected" and avoid all the incremental complexity.
When set to "external", the built-in consent screen is skipped (same as False) but no security warning is logged, since consent is handled externally by the upstream IdP. Forwarded through all OAuthProxy subclasses: GoogleProvider, GitHubProvider, AzureProvider, DiscordProvider, WorkOSProvider, OIDCProxy, Auth0Provider, AWSCognitoProvider, and OCIProvider.
47597c0 to
f073897
Compare
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.
Summary
external_consent: bool = Falseparameter toOAuthProxy.__init__require_authorization_consent=Falseandexternal_consent=True, emits aninfo-level log instead of the security warningexternal_consentis not set — existing warning is preservedMotivation
When using
OAuthProxywithrequire_authorization_consent=Falsebecause consent is handled by a custom external login page (pointed to viaupstream_authorization_endpoint), the warning "Authorization consent screen disabled - only use for local development or testing" is misleading. Consent is being collected — just not by FastMCP's built-in screen.Closes #3472
## Usageexternal_consent=True, # suppresses misleading warning
Edit: new usage will be: