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: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,12 @@
2
2
3
3
This project uses [Semantic Versioning 2.0.0](http://semver.org/), the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
5
+
## Unreleased
6
+
7
+
### Added
8
+
9
+
-`auth login` can authenticate in the browser via an interactive OAuth flow (OAuth 2.0 with PKCE and a loopback redirect). The feature is dark-launched and off by default: opt in per command with `--web`, or persistently by setting `oauth_login: true` in the config file (or `DNSIMPLE_OAUTH_LOGIN=1`). Without it, `auth login` keeps prompting for a pasted API token. (dnsimple/cli#57)
Copy file name to clipboardExpand all lines: README.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,16 +75,19 @@ dnsimple [command] [flags]
75
75
The CLI supports two authentication modes that can be combined freely.
76
76
77
77
> [!NOTE]
78
-
> The CLI currently supports API token authentication only, including both classic and scoped API tokens. OAuth support may be considered in the future, but it is not currently on the roadmap.
78
+
> By default `auth login` authenticates with an API token (classic or scoped), which you paste when prompted. An interactive browser login (OAuth) is being rolled out and is off by default for now. Opt in per command with `--web`, or persistently by setting `oauth_login: true` in the config file (or `DNSIMPLE_OAUTH_LOGIN=1`).
79
79
80
80
#### Stateful: stored contexts
81
81
82
82
Authenticate once and the CLI remembers a named *context* (token, account, environment) on disk. Multiple contexts can coexist and you select one as active:
83
83
84
84
```shell
85
-
# Log in to production and store a context
85
+
# Log in to production and store a context (prompts for an API token)
86
86
dnsimple auth login
87
87
88
+
# Authenticate in the browser instead of pasting a token
return"", errors.New("interactive browser login is not available in this build\n\nRun `dnsimple auth login --with-token` to authenticate with an API token instead")
69
+
default:
70
+
return"", fmt.Errorf("browser login failed: %w\n\nRetry `dnsimple auth login`, or run `dnsimple auth login --with-token` to authenticate with an API token instead", err)
71
+
}
72
+
}
73
+
74
+
// warnIfWebIgnored notes that an explicit --web was not honored, mirroring the
75
+
// precedence in acquireToken: --with-token wins, and the browser flow needs an
76
+
// interactive terminal. It keys off the actual flag value (not just whether it
77
+
// was set) so `--web=false` stays silent, and it ignores the persistent
78
+
// oauth_login toggle, which is meant to fall back to the prompt without noise.
0 commit comments