mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-08-18 06:32:24 +08:00

* Revamp authentication to allow multiple backends * Make router generate a login route for each backend * Apply black * Remove unused imports * Complete docstrings * Update documentation * WIP add cookie auth * Complete cookie auth unit tests * Add documentation for cookie auth * Fix cookie backend default name * Don't make cookie return a Response
17 lines
684 B
Markdown
17 lines
684 B
Markdown
# Authentication
|
|
|
|
**FastAPI Users** allows you to plug in several authentication methods.
|
|
|
|
## How it works?
|
|
|
|
You can have **several** authentication methods, e.g. a cookie authentication for browser-based queries and a JWT token authentication for pure API queries.
|
|
|
|
When checking authentication, each method is run one after the other. The first method yielding a user wins. If no method yields a user, an `HTTPException` is raised.
|
|
|
|
Each defined method will generate a [`/login/{name}`](../../usage/routes.md#post-loginname) route where `name` is defined on the authentication method object.
|
|
|
|
## Provided methods
|
|
|
|
* [JWT authentication](jwt.md)
|
|
* [Cookie authentication](cookie.md)
|