Skip to content

Commit 3aa9dd2

Browse files
authored
Merge branch 'main' into hypeship/intro-create-control-observe
2 parents 610f57a + c1faa16 commit 3aa9dd2

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

auth/configuration.mdx

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,37 @@ Credentials are saved after every successful login, enabling automatic re-authen
1212

1313
To opt out of credential saving, set `save_credentials: false` when creating the connection. See [Credentials](/auth/credentials) for more on automated authentication.
1414

15+
Automatic re-authentication is gated by two boolean flags that both default to `true`:
16+
17+
- `health_checks` — whether the connection runs periodic health checks at all. When `false`, the system never automatically verifies the session and never triggers reauth on its own.
18+
- `auto_reauth` — whether a failed scheduled health check is allowed to attempt re-authentication. When `false`, expired sessions are marked `NEEDS_AUTH` instead of being repaired automatically.
19+
20+
`auto_reauth` only has an effect on the automatic flow when `health_checks` is also `true`, because reauth is triggered by a failing scheduled health check. Manually triggering a health check via the API still works regardless of `health_checks`.
21+
22+
<CodeGroup>
23+
```typescript TypeScript
24+
const auth = await kernel.auth.connections.create({
25+
domain: 'example.com',
26+
profile_name: 'my-profile',
27+
health_checks: false,
28+
auto_reauth: false,
29+
});
30+
```
31+
32+
```python Python
33+
auth = await kernel.auth.connections.create(
34+
domain="example.com",
35+
profile_name="my-profile",
36+
health_checks=False,
37+
auto_reauth=False,
38+
)
39+
```
40+
</CodeGroup>
41+
42+
Both flags can be flipped on an existing connection with `auth.connections.update`; changes take effect immediately on the running connection.
43+
44+
Setting `auto_reauth: true` is an opt-in only — it doesn't guarantee reauth is feasible. The system still needs what it requires to perform the login (e.g. saved credentials for the required fields). If those preconditions aren't met when a health check fails, the connection transitions to `NEEDS_AUTH` even with `auto_reauth: true`.
45+
1546
## Custom Login URL
1647

1748
If the site's login page isn't at the default location, specify it when creating the connection:
@@ -206,11 +237,13 @@ After creating a connection, you can update its configuration with `auth.connect
206237
| `credential` | Update the linked credential |
207238
| `allowed_domains` | Update allowed redirect domains |
208239
| `health_check_interval` | Seconds between health checks (minimum varies by plan) |
240+
| `health_checks` | Whether periodic health checks run for this connection |
241+
| `auto_reauth` | Whether a failed scheduled health check is allowed to attempt automatic re-authentication |
209242
| `save_credentials` | Whether to save credentials on successful login |
210243
| `record_session` | Record a [replay](/browsers/replays) of every auth browser session for this connection (logins, health checks, and reauths) |
211244
| `proxy` | Pin login, health-check, and reauth sessions to a proxy. Takes effect on the next health check or reauth |
212245

213-
Only the fields you include are updated—everything else stays the same. Changes to `health_check_interval` and `proxy` take effect immediately, so the next health check or reauth uses the new value.
246+
Only the fields you include are updated—everything else stays the same. Changes to `health_check_interval`, `health_checks`, `auto_reauth`, and `proxy` take effect immediately on the running connection.
214247

215248
<CodeGroup>
216249
```typescript TypeScript

0 commit comments

Comments
 (0)