jdx/mise · error
GitHub OAuth is not configured. Set github.oauth_client_id…
Error message
GitHub OAuth is not configured. Set github.oauth_client_id first.
What it means
mise's GitHub OAuth device-flow helper requires a registered OAuth application client id configured via the `github.oauth_client_id` setting. `token_async` refuses to start the flow (cached-token lookup, refresh, or device authorization) when no client id is set.
Solutions
- Set `github.oauth_client_id` in settings: `mise settings set github.oauth_client_id <id>`
- Register an OAuth app at https://github.com/settings/developers to obtain a client id (device flow grant type)
- Check `mise settings get github.oauth_client_id` to confirm it is non-empty in the active profile
- If you meant to use a plain token instead, set `GITHUB_TOKEN`/`MISE_GITHUB_TOKEN` rather than using the OAuth flow
Example fix
// before: only scopes configured [github] oauth_scopes = "repo gist" // after [github] oauth_client_id = "Iv1.abc123def456" oauth_scopes = "repo gist"
Defensive patterns
Strategy: validation
Validate before calling
mise settings get github.oauth_client_id || echo 'github.oauth_client_id is not set'
Prevention
- Configure github.oauth_client_id before using `mise token github`
- Include the OAuth setup in onboarding docs and CI bootstrap scripts
- Use a PAT env var (GITHUB_TOKEN) in environments where OAuth setup is not possible
When it happens
Trigger: Calling `mise token github` (or any code path reaching `token_async`, including `force_refresh`) without `github.oauth_client_id` set in settings.
Common situations: Fresh mise install without OAuth setup; settings only define `github.oauth_scopes` but not the client id; typo in the settings key; using a config profile that lacks the setting.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- {details}
- GitHub device authorization expired
- GitHub device authorization was denied
- GitHub OAuth is configured for
- GitHub OAuth token is not cached. Run `mise token github…
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/e4596356382ef43f.
Report an issue: GitHub.
Appendix: source
Thrown at src/github/oauth.rs:238
warn!("failed to invalidate GitHub OAuth token cache: {err:#}");
}
}
return Ok(None);
};
let access_token = refreshed.access_token.clone();
cache.tokens.insert(cache_key.to_string(), refreshed);
if let Err(err) = write_cache_locked_async(cache_lock, cache).await {
warn!("failed to cache refreshed GitHub OAuth token: {err:#}");
}
Ok(Some(access_token))
}
async fn token_async(req: TokenRequest) -> Result<String> {
let settings = Settings::get();
let client_id = settings.github.oauth_client_id.trim();
let scopes = settings.github.oauth_scopes.trim();
if client_id.is_empty() {
bail!("GitHub OAuth is not configured. Set github.oauth_client_id first.");
}
if !host_matches_settings(&req.host, &settings.github.oauth_api_url) {
bail!(
"GitHub OAuth is configured for {}, not {}",
api_host(&settings.github.oauth_api_url).unwrap_or_else(|| "unknown host".to_string()),
req.host
);
}
let canonical_host =
api_host(&settings.github.oauth_api_url).unwrap_or_else(|| req.host.clone());
let cache_key = cache_key(&canonical_host, client_id, scopes);
let cache = read_cache_async().await?;
if !req.force_refresh
&& let Some(cached) = cache.tokens.get(&cache_key)
&& reusable(cached)
{
return Ok(cached.access_token.clone());View on GitHub (pinned to 533346cc37)