Skip to content

Commit e519f04

Browse files
authored
[auth0-fastapi] Adds scopes to profile endpoint example (#18)
1 parent 0de7722 commit e519f04

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/auth0_fastapi/README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,14 @@ from auth0_fastapi.auth.auth_client import AuthClient
204204

205205

206206
config = Auth0Config(
207-
domain="YOUR_AUTH0_DOMAIN", # e.g., "dev-1234abcd.us.auth0.com"
207+
domain="YOUR_AUTH0_DOMAIN", # e.g., "dev-1234abcd.us.auth0.com"
208208
client_id="YOUR_CLIENT_ID",
209209
client_secret="YOUR_CLIENT_SECRET",
210210
app_base_url="http://localhost:3000", # or your production URL
211-
secret="YOUR_SESSION_SECRET"
211+
secret="YOUR_SESSION_SECRET",
212+
authorization_params={
213+
"scope": "openid profile", # required get the user information from Auth0
214+
}
212215
)
213216

214217
auth_client = AuthClient(config)
@@ -230,6 +233,7 @@ async def profile(request: Request, response: Response, session=Depends(auth_cli
230233

231234
> [!IMPORTANT]
232235
> The above is to protect server-side rendering routes by the means of a session, and not API routes using a bearer token.
236+
> The `authorization_params` passing the `scope` is used in to retrieve the user information from Auth0. Can be omitted if you don't need the user information.
233237
234238

235239
#### Requesting an Access Token to call an API

0 commit comments

Comments
 (0)