147 Commits

Author SHA1 Message Date
Yume05-dev
71dc760fdc docs: update httpx-oauth link to /oauth2/ 2026-03-12 08:26:49 +01:00
Joschka Thurner
23784b24af remove unused oauth cooke parameter from docs 2025-12-19 10:22:41 +01:00
François Voron
7cf413cd76 Add a double-submit cookie in the OAuth flow
Prevents CSRF attacks by ensuring that the state parameter is tied to a cookie.

Fix https://github.com/fastapi-users/fastapi-users/security/advisories/GHSA-5j53-63w8-8625
2025-12-19 08:26:26 +01:00
François Voron
fcf9a2041a Drop Python 3.9 support 2025-10-25 08:19:03 +02:00
Ramon
2b64cb304b Update HTTPX OAuth link oauth.md
The old link was opening some broken/incomplete website.

Updated the link to point to https://frankie567.github.io/httpx-oauth/usage/
2025-10-24 17:30:52 +02:00
Jaeung Jang
c3729da0cf fix typo
duplicate text: "call the"
2025-10-24 17:27:34 +02:00
Nima Xin
514e5bab40 Fix database URL examples in docs 2024-11-07 15:53:37 +01:00
François Voron
caa17889e1 Drop Python 3.8 support 2024-11-03 12:51:32 +00:00
Marios Pitsiali
42ddc241b9 Fix typo in auth docs stategies/database.md (#1437) 2024-09-13 17:46:25 +02:00
François Voron
f7a31c579d Replace passlib in favor of pwdlib 2024-03-11 14:04:50 +01:00
Brandon H. Goding
2ffb7006ff [Issue #1312]: full examples use lifespan instead of on_startup (#1363)
* docs(examples): full examples use lifespan instead of on_startup for database initialization

* Update beanie.md

Replaced the annotations on the notes that I missed
2024-03-05 09:09:49 +01:00
Mark Donnelly
d6e337a2e5 Create a user programmatically documentation - change example to return things. (#1356)
* Changed method to return user or raise an exception

* Re-raise UserAlreadyExists exception instead of creating a new one.
2024-02-20 08:42:23 +01:00
raindata5
87c73e974c Update cookie.md to reflect correct status code on login (#1349)
* Update cookie.md to reflect correct status code on login

* Add complete HTTP response code

* Update HTTP response code in docs for cookie transport
2024-02-15 09:57:30 +01:00
David Brochart
3bf0f888ee Fix typo (#1248) 2023-07-12 09:33:54 +02:00
François Voron
d71e229ad5 Update on_after_login doc 2023-04-29 13:53:49 +02:00
François Voron
031fa78120 Update docs about transports 2023-04-29 13:53:49 +02:00
François Voron
8fd097cbc8 Revamp Transport so they always build a full Response object (#1049)
* Revamp Transport so they always build a full Response object

* Fix linting

* Add private methods to set cookies on CookieTransport

* Change on_after_login login_return parameter to response
2023-04-27 09:32:49 +02:00
Essa Alshammri
6a6d752cc2 correct a misspelled word "wist" -> "wish (#1195) 2023-04-21 07:54:20 +02:00
Börge Kiss
0f4cf0c694 Add doc about custom settings when using Beanie (#1193) 2023-04-18 11:09:33 +02:00
Téva KRIEF
4e426d6823 Add login_return to on_after_login method (#1187) 2023-04-14 16:10:22 +02:00
François Voron
4bd618503b Update Beanie docs 2023-04-14 15:46:11 +02:00
Guilherme Caminha
be475e391a Explicitly cite the expire_on_commit setting in the docs (#1177)
https://github.com/fastapi-users/fastapi-users/issues/1175
2023-03-23 18:20:51 +01:00
François Voron
9b57fa2e73 Allow to set is_verified to True after OAuth callback 2023-02-13 17:42:31 +01:00
François Voron
5c48283155 Update docs for SQLAlchemy 2.0 2023-02-13 17:28:49 +01:00
Börge Kiss
9d374add50 Add important hint to documentation (#1149)
The documentation was missing a hint that the `AccessToken` ODM model has to be added to the `document_models` array argument for Beanie to know this model.
2023-01-25 09:06:50 +01:00
François Voron
33a7bb3fd9 Update SQLAlchemy examples 2023-01-16 11:08:23 +01:00
Börge Kiss
0b50757a9b Fix typos in configuration/authentication docs (#1145) 2023-01-12 14:23:58 +01:00
François Voron
aa4c5ef672 Add doc about new OAuth callback error 2022-11-04 09:40:21 +01:00
sandalwoodbox
c8ae5c1cc2 Corrected reset password error response docs (#1116) 2022-11-04 09:13:39 +01:00
Toni Alatalo
7ad5f8073d on_after_login hook (#1092)
* on_after_login minimal impl.

Questions: is the spot logical for after method? Is after the internal login call.
Would before_login be needed? Maybe not, as auth is the way to do pre-login things.

Added fastapi request as a param just in case, as other callbacks had it too.

Docs addition is missing.

* tried to complete the implementation, but the test with user_manager.on_after_login.called fails though

* move on_after_login tests to right place, to TestLogin. These ones pass.

TODO: check TestCallback

* on_after_login tests to TestCallback too, for oauth. Apparently test_redirect_url_router fires the callback too, I guess that's correct, am not using oauth myself.

* fix formatting with make format

* docs for on_after_login

Co-authored-by: Toni Alatalo <toni.alatalo@gmail.com>
2022-10-18 08:02:01 +02:00
François Voron
6c03d51a64 Fix Beanie OAuth example 2022-08-08 08:45:17 +02:00
François Voron
d7a1e3420c Fix #1043: Add a prefix to the generated key in RedisStrategy 2022-07-23 07:53:57 +00:00
Andrey
4ab3bef0a6 docs: added example of db_urls (#1033) 2022-07-18 15:43:54 +02:00
François Voron
b999ec9967 Add docs for OAuth association router 2022-06-20 17:19:19 +02:00
schwannden
3bb3728261 add on delete hook (#1014)
Co-authored-by: Schwannden Kuo <schwannden@mobagel.com>
2022-06-20 13:26:02 +02:00
François Voron
c5ac2b0e6e Use newer version of Redis dependency incorporating async support 2022-06-07 08:43:41 +02:00
⭕Alexander Rymdeko-Harvey
924d163792 Update Documentation installation and fix new beanie install method (#982)
* Update installation types and fix beanie install

* Move install instructions to redis authentication

* Add Redis install instructions
2022-05-09 15:28:56 +02:00
François Voron
78be936297 Put exceptions in a dedicated module to avoid circular imports 2022-05-06 13:17:22 +02:00
François Voron
72aa68c462 Native model and generic ID (#971)
* Use a generic Protocol model for User instead of Pydantic

* Remove UserDB Pydantic schema

* Harmonize schema variable naming to avoid confusions

* Revamp OAuth account model management

* Revamp AccessToken DB strategy to adopt generic model approach

* Make ID a generic instead of forcing UUIDs

* Improve generic typing

* Improve Strategy typing

* Tweak base DB typing

* Don't set Pydantic schemas on FastAPIUsers class: pass it directly on router creation

* Add IntegerIdMixin and export related classes

* Start to revamp doc for V10

* Revamp OAuth documentation

* Fix code highlights

* Write the 9.x.x ➡️ 10.x.x migration doc

* Fix pyproject.toml
2022-05-05 14:51:19 +02:00
François Voron
403bec9c05 Update mkdocs and configure docs versioning 2022-05-04 10:23:42 +02:00
François Voron
20682ec4e8 Add docs for PasswordHelper customization 2022-03-22 14:46:12 +01:00
Joe Taylor
b054383fbf Enable RS256/ES256 and other algorithms for JWT strategy (#943)
* Implement RS256 for JWT auth

* Update docs with RS256 example

* Added ES256 tests

* Format with isort and black

* Removed example RSA key pair (so as not to tempt people to use it)

* Added pyjwt[crypto] to requirements

* Removed pycryptodome by hardcoding example keys

* Removed unnecessary Tuple import from typing
2022-03-22 10:28:00 +01:00
Leon Thurner
913af971fe Fix wrong import in MongoDB strategy example (#901) 2022-02-02 14:50:27 +01:00
Hazedd
de97d6597a UserTable relation table name correction (#849)
OAuthAccount should be correct table name SQLAlchemyBaseOAuthAccountTable
2022-01-09 10:08:54 +01:00
François Voron
8b865f7609 Fix create user programmatically cookbook 2022-01-07 10:31:52 +01:00
François Voron
89daead99b Fix #843: remove connect_args on examples 2022-01-06 10:19:05 +01:00
François Voron
d937c4e05b Update doc for SQLALchemy2 adapter 2022-01-04 16:01:14 +01:00
David Brochart
79557eead4 Allow lifetime_seconds=None (#835) 2022-01-03 12:05:55 +01:00
François Voron
c1083f77b5 Update documentation for DB strategy and fix DB dependencies versions 2022-01-03 11:26:14 +01:00
François Voron
c4de66b81c Revamp authentication (#831)
* Implement Transport classes

* Implement authentication strategy classes

* Revamp authentication with Transport and Strategy

* Revamp strategy and OAuth so that they can use a callable dependency

* Update docstring

* Make ErrorCode a proper Enum and cleanup unused OpenAPI utils

* Remove useless check

* Tweak typing in authenticator

* Update docs

* Improve logout/destroy token logic

* Update docs

* Update docs

* Update docs and full examples

* Apply formatting to examples

* Update OAuth doc and examples

* Add migration doc

* Implement Redis session token

* Add Redis Session documentation

* RedisSession -> Redis

* Fix links in docs
2021-12-30 15:22:07 +01:00