Replies: 3 comments 7 replies
-
Old question, but if someone is still reading this and trying to find a solution. You can define multiple authentication backends and just pass those to your |
Beta Was this translation helpful? Give feedback.
-
Not completely sure since I don't care about the Swagger functionality. I've never looked at what's going on in there. Complete mystery to me if Swagger even supports multiple authentication methods to the docs it creates. Nor have I touched that part of my code in a long time. I'm wondering why are you rewriting the whole strategy. Could you use the existing database strategy with the API key implementation?
|
Beta Was this translation helpful? Give feedback.
-
In addition to logging in to the system, I'd like to offer users to call my API programmatically. For that purpose, it seems a bit cumbersome to go through the login/JWT process.
So I was thinking to generate an individual API key for each user, that lets them make API requests directly. Conveniently, FastAPI already has the validation built-in (see
fastapi.security.api_key
).Now I'm looking for a way to marry that to fastapi-users as an alternative strategy.
Has somebody tried this before, or has any thoughts on this? Wouldn't this be a useful general addition to fastapi-users?
Any pointers are appreciated!
Beta Was this translation helpful? Give feedback.
All reactions