Resource server: read the required scope in access token
This commit is contained in:
parent
f910834736
commit
b3e19b3e40
4 changed files with 129 additions and 37 deletions
|
@ -53,16 +53,14 @@ origins = [
|
|||
"https://philo.ydns.eu/",
|
||||
]
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
await get_providers_info()
|
||||
yield
|
||||
|
||||
|
||||
app = FastAPI(
|
||||
title="OIDC auth test",
|
||||
lifespan=lifespan
|
||||
)
|
||||
app = FastAPI(title="OIDC auth test", lifespan=lifespan)
|
||||
|
||||
|
||||
app.add_middleware(
|
||||
|
@ -284,7 +282,6 @@ async def non_compliant_logout(
|
|||
@app.get("/resource/{id}")
|
||||
async def get_resource_(
|
||||
id: str,
|
||||
request: Request,
|
||||
# user: Annotated[User, Depends(get_current_user)],
|
||||
# oidc_provider: Annotated[StarletteOAuth2App, Depends(get_oidc_provider)],
|
||||
# token: Annotated[OAuth2Token, Depends(get_token)],
|
||||
|
@ -294,7 +291,7 @@ async def get_resource_(
|
|||
return JSONResponse(await get_resource(id, user))
|
||||
|
||||
|
||||
# Routes for test
|
||||
# Routes for RBAC based tests
|
||||
|
||||
|
||||
@app.get("/public")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue