Skip to content

Commit e14b485

Browse files
committed
doc: better auth docs with links to required/optional
1 parent b503b21 commit e14b485

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

fastapi_third_party_auth/auth.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,13 @@ def __init__(
5353
signature_cache_ttl: int = 3600,
5454
idtoken_model: Type[IDToken] = IDToken,
5555
):
56-
"""Configure authentication and use method :func:`require` or :func:`optional`
57-
to check user credentials.
56+
"""Configure authentication :func:`auth = Auth(...) <Auth>` and then:
57+
58+
1. Show authentication in the interactive docs with :func:`Depends(auth) <Auth>`
59+
when setting up FastAPI.
60+
2. Use :func:`Security(auth.required) <Auth.required>` or
61+
:func:`Security(auth.optional) <Auth.optional>` in your endpoints to
62+
check user credentials.
5863
5964
Args:
6065
openid_connect_url (URL): URL to the "well known" openid connect config

0 commit comments

Comments
 (0)