You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: auth/configuration.mdx
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,37 @@ Credentials are saved after every successful login, enabling automatic re-authen
12
12
13
13
To opt out of credential saving, set `save_credentials: false` when creating the connection. See [Credentials](/auth/credentials) for more on automated authentication.
14
14
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 =awaitkernel.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
+
15
46
## Custom Login URL
16
47
17
48
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
|`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 |
209
242
|`save_credentials`| Whether to save credentials on successful login |
210
243
|`record_session`| Record a [replay](/browsers/replays) of every auth browser session for this connection (logins, health checks, and reauths) |
211
244
|`proxy`| Pin login, health-check, and reauth sessions to a proxy. Takes effect on the next health check or reauth |
212
245
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.
0 commit comments