Skip to content

Commit a002ce2

Browse files
authored
Document the browser locale on managed auth connections (#758)
* Document the browser locale on managed auth connections * Align the managed auth locale docs with browser location * Point the managed auth locale docs at browser location * Use example.com in the managed auth locale examples * Keep the managed auth locale section to an overview --------- Co-authored-by: akxue <18199652+akxue@users.noreply.github.com>
1 parent b0e23a1 commit a002ce2

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

‎auth/configuration.mdx‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,50 @@ _ = login
639639

640640
Browser placement and proxy location are independent. `browser.region` chooses where the browser runs; the connection's [proxy](/proxies/overview) controls the exit IP that websites see. Regional browsers don't provide a data residency guarantee. See [Regional Browsers](/browsers/regions) for storage and processing details.
641641

642+
## Browser locale
643+
644+
By default, the browsers Managed Auth uses for a connection report an English locale to websites, such as `en-US` in `us-east`. If your users sign in to sites in another language, set `browser.location.locale` on the connection, for example `sv-SE` for Swedish. Sites that choose their language from the browser then show their login page, field labels, and MFA prompts in your user's language.
645+
646+
<CodeGroup>
647+
```typescript TypeScript
648+
const auth = await kernel.auth.connections.create({
649+
domain: 'example.com',
650+
profile_name: 'user-123',
651+
browser: { location: { locale: 'sv-SE' } },
652+
});
653+
```
654+
655+
```python Python
656+
auth = await kernel.auth.connections.create(
657+
domain="example.com",
658+
profile_name="user-123",
659+
browser={"location": {"locale": "sv-SE"}},
660+
)
661+
```
662+
663+
```go Go
664+
auth, err := client.Auth.Connections.New(ctx, kernel.AuthConnectionNewParams{
665+
ManagedAuthCreateRequest: kernel.ManagedAuthCreateRequestParam{
666+
Domain: "example.com",
667+
ProfileName: "user-123",
668+
Browser: kernel.ManagedAuthBrowserConfigParam{
669+
Location: kernel.ManagedAuthBrowserLocationParam{
670+
Locale: kernel.String("sv-SE"),
671+
},
672+
},
673+
},
674+
})
675+
if err != nil {
676+
panic(err)
677+
}
678+
_ = auth
679+
```
680+
</CodeGroup>
681+
682+
The locale applies to every browser the connection uses: the first login, health checks, and automatic reauthentication. Change it with `auth.connections.update`, or set it to `null` to go back to the default.
683+
684+
This is the same `locale` as [browser location](/browsers/location), applied to the connection's browsers. See that page for supported values and how the locale affects the browser.
685+
642686
## SSO/OAuth support
643687

644688
Managed Auth supports common "Sign in with Google/GitHub/Microsoft" flows. The user completes the OAuth flow with the provider, and Kernel saves the authenticated session to the profile. Automatic reauthentication depends on the provider's login requirements. See [Can this connection auto-reauth?](/auth/connection-lifecycle#can-this-connection-auto-reauth) for how Kernel determines eligibility.
@@ -964,6 +1008,7 @@ After creating a connection, you can update its configuration with `auth.connect
9641008
| `record_session` | Record a [replay](/browsers/replays) of every auth browser session for this connection (logins, health checks, and reauths) |
9651009
| `hitl` | Pause interactive logins on an unsolvable CAPTCHA so a person can complete it. See [human verification for CAPTCHAs](#human-verification-for-captchas) |
9661010
| `browser.region` | Region for login, health-check, and reauth browsers. Takes effect on the next browser created for the connection |
1011+
| `browser.location.locale` | Language for login, health-check, and reauth browsers, such as `sv-SE`. Set to `null` to go back to the region default. Takes effect on the next browser created for the connection |
9671012
| `proxy` | Pin login, health-check, and reauth sessions to a proxy. Takes effect on the next health check or reauth |
9681013

9691014
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.

‎browsers/location.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,5 @@ Browser responses include the timezone and locale the browser is using, and whet
107107
- Date and number formatters a page already created keep their original settings. Create a new one, such as `new Intl.DateTimeFormat()`, to use the new values.
108108
- Requests already in progress keep their original language. Later requests use the new one.
109109
- A timezone or locale you set yourself through Playwright or Puppeteer, such as Playwright's `timezoneId`, takes precedence on the pages it applies to.
110-
- The location lasts for the browser session. Profiles don't save it.
110+
- The location lasts for the browser session. Profiles don't save it. [Managed Auth](/auth/configuration#browser-locale) browsers take their locale from the connection instead.
111111
- A pooled browser you release with `reuse: true` keeps its location for the next acquirer, just as it keeps cookies and open tabs. Release it with `reuse: false` to get a fresh browser instead.

0 commit comments

Comments
 (0)