Skip to content

Commit a458d77

Browse files
committed
update all the examples files
1 parent 4c92d41 commit a458d77

10 files changed

Lines changed: 31 additions & 0 deletions

‎examples/ConnectedAccounts.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ server_client = ServerClient(
2727
)
2828
```
2929

30+
`ServerClient` creates no default stores — provide a `state_store` and a `transaction_store`. See [ConfigureStore.md](ConfigureStore.md).
31+
3032
## Login to the application
3133

3234
Use the login methods to authenticate to the application and get a refresh token in order to use MRRT to call the My Account API. If you are also intending to authorize access to any custom API, you may optionally specify an audience and any relevant scopes but you must at a minimum include the `offline_access` scope to ensure you obtain a refresh token.

‎examples/CustomTokenExchange.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ if response.id_token:
3737
print(f"ID Token: {response.id_token}")
3838
```
3939

40+
`ServerClient` creates no default stores — provide a `state_store` and a `transaction_store`. See [ConfigureStore.md](ConfigureStore.md).
41+
4042
## 2. Login with Token Exchange
4143

4244
Exchange a custom token AND establish a user session.

‎examples/InteractiveLogin.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ server_client = ServerClient(
2323
}
2424
)
2525
```
26+
27+
`ServerClient` creates no default stores — provide a `state_store` and a `transaction_store`. See [ConfigureStore.md](ConfigureStore.md).
28+
2629
Now call `start_interactive_login()` to obtain the authorization URL and redirect the user:
2730
```python
2831
authorization_url = await server_client.start_interactive_login()

‎examples/MFA.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ except MfaRequiredError as error:
124124
mfa_token = context.mfa_token # Raw token for MFA API calls
125125
```
126126

127+
`ServerClient` creates no default stores — provide a `state_store` and a `transaction_store`. See [ConfigureStore.md](ConfigureStore.md).
128+
127129
> [!NOTE]
128130
> `get_access_token()` is not the only origin of `MfaRequiredError`. A passkey login (`signin_with_passkey`) raises the same error when a second factor is required — but there is **no session yet** at that point, which changes how you complete and persist the flow. See [Passkeys.md → Completing MFA on a passkey login](Passkeys.md#completing-mfa-on-a-passkey-login-and-where-the-session-comes-from).
129131

‎examples/MultipleCustomDomains.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ client = ServerClient(
2929
)
3030
```
3131

32+
`ServerClient` creates no default stores — provide a `state_store` and a `transaction_store`. See [ConfigureStore.md](ConfigureStore.md).
33+
3234
### Method 2: Dynamic Domain Resolver (MCD)
3335

3436
For MCD support, provide a domain resolver function that receives a `DomainResolverContext`:

‎examples/MutualTLS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ auth0 = ServerClient(
4343
)
4444
```
4545

46+
`ServerClient` creates no default stores — provide a `state_store` and a `transaction_store`. See [ConfigureStore.md](ConfigureStore.md).
47+
4648
The SDK passes `ssl_context` as `verify=ssl_context` to every `httpx.AsyncClient` it constructs, including the authlib client used for the authorization-code exchange. You never call `load_cert_chain` inside the SDK - the caller owns the TLS material.
4749

4850
## Mutual exclusion

‎examples/OrganizationLogin.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ authorization_url = await auth0.start_interactive_login(
3434
)
3535
```
3636

37+
`ServerClient` creates no default stores — provide a `state_store` and a `transaction_store`. See [ConfigureStore.md](ConfigureStore.md).
38+
3739
`organization` accepts either an org ID (with the `org_` prefix) or a human-readable org name. The SDK validates the corresponding `org_id` or `org_name` claim in the returned ID token.
3840

3941
## Multi-Org Login

‎examples/Passkeys.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,26 @@ A passkey ceremony is always **two steps**, because the WebAuthn signature happe
3131
```python
3232
from auth0_server_python.auth_server.server_client import ServerClient
3333

34+
# Passkey sign-in persists a server-side session, and the challenge step stores
35+
# short-lived transaction data — so ServerClient needs a state store and a
36+
# transaction store (it does not create defaults). If your framework wrapper
37+
# (e.g. auth0-fastapi) already provides these, reuse them; otherwise create your
38+
# own implementations of the StateStore / TransactionStore ABCs.
39+
state_store = YourStateStore(...) # or the store your framework provides
40+
transaction_store = YourTransactionStore(...) # or the store your framework provides
41+
3442
server_client = ServerClient(
3543
domain="YOUR_CUSTOM_DOMAIN",
3644
client_id="YOUR_CLIENT_ID",
3745
client_secret="YOUR_CLIENT_SECRET",
3846
secret="YOUR_SECRET",
47+
state_store=state_store,
48+
transaction_store=transaction_store,
3949
)
4050
```
4151

52+
For store implementations (cookie, Redis, database) and how to pass `store_options`, see [examples/ConfigureStore.md](ConfigureStore.md).
53+
4254
The **Passkey** grant (`urn:okta:params:oauth:grant-type:webauthn`) must be enabled for your application under **Applications → Your App → Grant Types**.
4355

4456
> [!NOTE]

‎examples/Passwordless.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ server_client = ServerClient(
6262
)
6363
```
6464

65+
`ServerClient` creates no default stores — provide a `state_store` and a `transaction_store`. See [ConfigureStore.md](ConfigureStore.md).
66+
6567
For apps using request/response-backed stores or multiple custom domains, pass `store_options={"request": request, "response": response}` to each method that reads or writes transaction/session state.
6668

6769
## 1. Email OTP

‎examples/StepUpAuthentication.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ async def handle_callback(callback_url, request, response):
113113
return (result.get("app_state") or {}).get("returnTo", "/")
114114
```
115115

116+
`ServerClient` creates no default stores — provide a `state_store` and a `transaction_store`. See [ConfigureStore.md](ConfigureStore.md).
117+
116118
> [!NOTE]
117119
> The redirect itself is framework-specific - these handlers return the URL to redirect to, and your app issues the actual HTTP redirect (e.g. a `302`/`303`). `max_age: 0` matters: without it, a user who authenticated moments ago may be returned straight to your callback without a fresh MFA prompt.
118120

0 commit comments

Comments
 (0)