Different OAuth2 flows per route ? #11616
Unanswered
Abdelgha-4
asked this question in
Questions
Replies: 1 comment 1 reply
-
Hi! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Description
The OAuth2 scopes section in FastAPI Docs clearly explains how it is possible to use multiple
SecurityScopes
per routes as necessary. However, for my use-case I need to define different OAuth2 flows as well, basically something like this:Security
Does not support a way to specify authorizedflows
. The scenario above for instance would enable only authorizing "implicit" users with the scope "scope1", and the general feature I'm looking for is specifying any combination of scopes and flows per route.I thinks that one way of achieving this is building
oauth2_scheme
for each one of the desired combinations but that defeats the intended flexibly offered bySecurity
andSecurityScopes
so I hope there is a better solution.Operating System
Windows
FastAPI Version
0.111.0
Pydantic Version
2.7.1
Python Version
3.11
Beta Was this translation helpful? Give feedback.
All reactions