-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbasic_auth0.py
More file actions
31 lines (24 loc) · 798 Bytes
/
basic_auth0.py
File metadata and controls
31 lines (24 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
This example shows how to configure an OpenID Connect integration with Auth0, obtaining
only an id_token, exchanged with the client using a response cookie.
"""
import uvicorn
from blacksheep.server.application import Application
from blacksheep.server.authentication.oidc import (
OpenIDSettings,
use_openid_connect,
)
from common.routes import register_routes
app = Application(show_error_details=True)
# basic Auth0 integration that handles only an id_token
use_openid_connect(
app,
OpenIDSettings(
authority="https://neoteroi.eu.auth0.com",
client_id="OOGPl4dgG7qKsm2IOWq72QhXV4wsLhbQ",
callback_path="/signin-oidc",
),
)
register_routes(app)
if __name__ == "__main__":
uvicorn.run(app, host="127.0.0.1", port=5000, log_level="debug")