File tree Expand file tree Collapse file tree 3 files changed +18
-11
lines changed Expand file tree Collapse file tree 3 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 13
13
# import os
14
14
# import sys
15
15
# sys.path.insert(0, os.path.abspath('.'))
16
-
16
+ from typing import List
17
17
18
18
# -- Project information -----------------------------------------------------
19
19
51
51
# Add any paths that contain custom static files (such as style sheets) here,
52
52
# relative to this directory. They are copied after the builtin static files,
53
53
# so a file named "default.css" will overwrite the builtin "default.css".
54
- html_static_path = ["_static" ]
54
+ html_static_path : List [ str ] = []
Original file line number Diff line number Diff line change 1
1
Welcome to fastapi-oidc's documentation!
2
2
========================================
3
3
4
- Verify ID Tokens Issued by Third Party
4
+ Verify and decrypt 3rd party OpenID Connect tokens to protect your
5
+ `FastAPI <https://github.com/tiangolo/fastapi >`_ endpoints.
5
6
6
- This is great if you just want to use something like Okta or google to handle
7
- your auth. All you need to do is verify the token and then you can extract
8
- user ID info from it.
7
+ Easily used with authenticators such as:
8
+
9
+ - `Keycloak <https://www.keycloak.org/ >`_ (open source)
10
+ - `SuperTokens <https://supertokens.io/ >`_ (open source)
11
+ - `Auth0 <https://auth0.com/ >`_
12
+ - `Okta <https://www.okta.com/products/authentication/ >`_
13
+
14
+
15
+ FastAPI's generated interactive documentation supports the grant flows
16
+ ``authorization_code ``, ``implicit ``, ``password `` and ``client_credentials ``.
9
17
10
18
.. toctree ::
11
19
:maxdepth: 2
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
"""
3
- Module for validating OIDC ID Tokens. Configured via config.py
3
+ Module for validating Open ID Connect ID Tokens.
4
4
5
5
Usage
6
6
=====
7
7
8
8
.. code-block:: python3
9
9
10
10
# This assumes you've already configured get_auth in your_app.py
11
- from you_app .auth import authenticate_user
11
+ from your_app .auth import authenticate_user
12
12
13
13
@app.get("/auth")
14
14
def test_auth(authenticated_user: AuthenticatedUser = Depends(authenticate_user)):
@@ -37,16 +37,15 @@ def get_auth(
37
37
audience : Optional [str ] = None ,
38
38
signature_cache_ttl : int = 3600 ,
39
39
) -> Callable [[str ], Dict ]:
40
- """Take configurations and return the authenticate_user function.
40
+ """Take configurations and returns the :func:` authenticate_user` function.
41
41
42
42
This function should only be invoked once at the beggining of your
43
43
server code. The function it returns should be used to check user credentials.
44
44
45
45
Args:
46
46
openid_connect_url (URL): URL to the "well known" openid connect config
47
47
e.g. https://dev-123456.okta.com/.well-known/openid-configuration
48
- issuer (URL): Same as base_authorization. This is used to generating OpenAPI3.0
49
- docs which is broken (in OpenAPI/FastAPI) right now.
48
+ issuer (URL): (Optional) The issuer URL from your auth server.
50
49
audience (str): (Optional) The audience string configured by your auth server.
51
50
signature_cache_ttl (int): How many seconds your app should cache the
52
51
authorization server's public signatures.
You can’t perform that action at this time.
0 commit comments