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
refactor: add debug logging to device flow, improve auth UX and README
- Add auth:device debug namespace for tracing device flow login
- Improve fallback message: "Your SSO provider requires device-based
login" instead of confusing OAuth jargon
- Rewrite README auth section with scannable table showing three
login methods and when each is used
- Add "Credential resolution order" subsection
- Note that API tokens are scoped to individual user accounts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
glean auth login #browser PKCE flow, or device flow for SSO/Okta
99
+
glean auth login #interactive login (detects the best method automatically)
102
100
glean auth status # verify credentials, host, and token expiry
103
101
glean auth logout# remove all stored credentials
104
102
```
105
103
106
-
OAuth uses PKCE with Dynamic Client Registration when available. For SSO configurations where DCR is unavailable (e.g. Okta), `auth login` falls back to the Device Authorization Grant (RFC 8628) — you'll approve the login on a verification page instead. Tokens are stored securely in the system keyring and refreshed automatically.
104
+
`glean auth login` detects the right authentication method for your environment automatically:
105
+
106
+
| Method | When it's used | What happens |
107
+
| --- | --- | --- |
108
+
|**Browser login**| Default for most Glean instances | Opens your browser, you approve, done |
109
+
|**Device code login**| Organizations using an external IdP (e.g. Okta) | Prints a URL and code — open the URL, enter the code |
110
+
|**API token**| Instances without OAuth support | Prompts you to paste a token from Glean Admin |
107
111
108
-
For instances that don't support OAuth at all,`auth login`falls back to prompting for an API token.
112
+
You don't need to choose —`auth login`tries each method in order and uses the first one that works. Tokens are stored securely in the system keyring and refreshed automatically.
109
113
110
114
### API Token (CI/CD)
111
115
112
-
Set credentials via environment variables — no interactive login needed:
116
+
For non-interactive environments, set credentials via environment variables:
113
117
114
118
```bash snippet=readme/snippet-05.sh
115
119
export GLEAN_API_TOKEN=your-token
116
120
export GLEAN_HOST=your-company-be.glean.com
117
121
glean search "test"
118
122
```
119
123
124
+
API tokens are scoped to an individual user account. Generate one from **Glean Admin → Settings → API Tokens**.
125
+
126
+
### Credential resolution order
127
+
120
128
Credentials are resolved in this order: environment variables → system keyring → `~/.glean/config.json`.
0 commit comments