forceLoginMethod
A Claude Code settings key, read out of the shipped bundle. It was in the build from v2.1.138 and was gone by v2.1.284.
Restrict login to claude.ai, Claude Console, or a cloud gateway
Anthropic's own wording. Read off All settings, captured 2026-10-22.
In the changelogs
17Releases whose published page names forceLoginMethod.
-
v2.1.307
Sessions started by the desktop app can use its claude.ai sign-in
Claude Code can now use a claude.ai sign-in passed over by the launcher that started it, such as the desktop app, and drops it when conditions no longer hold
found in this entry's text
-
v2.1.304
Login screen can refuse sign-in or allow only claude.ai login
The login screen can now show a refusal notice instead of the login form, or allow only claude.ai login, and startup can show a blocked screen
found in this entry's text
-
v2.1.304
/login is hidden in cloud sessions where a claude.ai sign-in can't be used
In a cloud session started with a Console sign-in, or where forceLoginMethod requires another method, /login is hidden and explains why
found in this entry's text
-
v2.1.299
Locally managed login restrictions now take priority over server-managed settings
forceLoginOrgUUID and forceLoginMethod set through MDM or a managed file now apply ahead of server-managed settings
found in this entry's text
-
v2.1.299
The saved copy of managed settings is checked before it is used
Claude Code now ignores its saved copy of organization-managed settings unless it matches the account and organization it is pinned to
found in this entry's text, named in this entry
-
v2.1.296
Setting forceLoginMethod to gateway now leads to the gateway login
With forceLoginMethod set to "gateway" and no forceLoginGatewayUrl, Claude Code now treats gateway login as required
found in this entry's text, named in this entry
-
v2.1.295
Gateway URL setting can now come from your own user settings
The gatewayUrl setting is now honoured from your user settings on a machine with no managed settings, not only from admin-managed ones
found in this entry's text, named in this entry
-
v2.1.284
Clearer error when a managed login policy clashes with your API key or token
When managed settings require a specific sign-in but another credential is set, the error names that credential, where it came from, and how to fix it
found in this entry's text, named in this entry
-
v2.1.268
New managed-settings key gatewayInternalNetworks joins highest-source-wins auth pins
New managed setting gatewayInternalNetworks joins the group taken only from the top-priority settings source
found in this entry's text
-
v2.1.265
Clearer managed-settings gateway sign-in error message
Gateway sign-in error now explains itself in plain language instead of naming the internal forceLoginMethod setting
found in this entry's text
-
v2.1.265
Gateway-forced-login detection simplified/changed condition
The check for whether login is forced through a gateway was simplified
found in this entry's text, named in this entry
-
v2.1.265
Gateway login force-selection simplified when already in gateway mode
Login is now forced to gateway mode whenever the session is already in gateway auth mode, not just via managed settings
found in this entry's text, named in this entry
-
v2.1.247
Managed settings can force login through a gateway
Admins can force gateway login using forceLoginMethod or forceLoginGatewayUrl in managed settings.
named in this entry, found in this entry's text
-
v2.1.242
Managed settings can now merge across sources instead of the top one winning
Admins can set managedSourcesBehavior to merge managed settings sources instead of only the top one.
found in this entry's text
-
v2.1.238
New
keybindingFlavorsetting for readline-style prompt editingSet keybindingFlavor to readline and Ctrl+W deletes back to whitespace like Bash does.
found in this entry's text
-
v2.1.212
Login Method Enforcement Improvements
found in this entry's text
-
v1.0.54
Settings Configuration Improvements
found in this entry's text
First cited
5The earliest release whose published evidence quoted forceLoginMethod was v2.1.212, 16 Jul 2026. That is the oldest release this project wrote about it, so it is a floor on the name's age and not the release that introduced it. It is not a presence reading: which builds carried the name is the table below.
Presence across releases
2Build by build
149One row per release since the first build this name was read out of. Absent means the build was read and the name was not in it, never mined means no bundle for that release was ever archived, and a declared type or a default is only ever what that release's own bundle stated.
Read out of the published npm bundle release by release, and out of Anthropic's own documentation as this site captured it. Nothing on this page is a description anybody here wrote about what the settings key does. All settings keys.