openclaw - 💡(How to fix) Fix [Bug]: xAI OAuth login fails with "Failed to generate authentication code — Unknown scope" [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#83960Fetched 2026-05-20 03:46:00
View on GitHub
Comments
1
Participants
2
Timeline
10
Reactions
1
Timeline (top)
labeled ×8commented ×1cross-referenced ×1

xAI Grok OAuth login fails immediately with an "Unknown scope" error when attempting to authenticate via openclaw models auth login --provider xai --method oauth.

Error Message

xAI Grok OAuth login fails immediately with an "Unknown scope" error when attempting to authenticate via openclaw models auth login --provider xai --method oauth. 4. Error appears immediately: produces the following error immediately, before any browser redirect occurs:

Root Cause

xAI Grok OAuth login fails immediately with an "Unknown scope" error when attempting to authenticate via openclaw models auth login --provider xai --method oauth.

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

xAI Grok OAuth login fails immediately with an "Unknown scope" error when attempting to authenticate via openclaw models auth login --provider xai --method oauth.

Steps to reproduce

  1. Install OpenClaw via Docker (latest image: ghcr.io/openclaw/openclaw:latest)
  2. Run: docker exec -it openclaw openclaw models auth login --provider xai --method oauth
  3. OAuth flow initiates
  4. Error appears immediately: "Failed to generate authentication code Unknown scope: [scope value truncated in terminal]"

Expected behavior

Per the May 2026 release notes, xAI Grok OAuth login was explicitly added for SuperGrok subscribers:

"Providers/xAI: add xAI Grok OAuth login for SuperGrok subscribers, letting xai/* models and xAI media/tool providers authenticate without XAI_API_KEY."

Expected: OAuth flow completes successfully, xAI credentials are stored in auth-profiles.json, and xai/* models become available without requiring XAI_API_KEY.

Actual: Flow fails immediately with "Failed to generate authentication code — Unknown scope" before any browser redirect or credential storage occurs.

Actual behavior

Running docker exec -it openclaw openclaw models auth login --provider xai --method oauth produces the following error immediately, before any browser redirect occurs:

Failed to generate authentication code Unknown scope: [scope value truncated in terminal output]

OAuth flow does not complete. No credentials are stored in auth-profiles.json. xai/* models remain unavailable without XAI_API_KEY.

Environment:

  • OpenClaw version: 2026.5.18 (latest Docker image)
  • Deployment: Docker on Ubuntu VPS
  • OS: Ubuntu 24.04

OpenClaw version

OpenClaw version: 2026.5.18

Operating system

Ubuntu 24.04

Install method

No response

Model

xai/* (any xAI model — OAuth flow fails before model selection)

Provider / routing chain

openclaw models auth login --provider xai --method oauth → xAI OAuth endpoint

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Per the May 2026 release notes, xAI Grok OAuth login was explicitly added for SuperGrok subscribers:

"Providers/xAI: add xAI Grok OAuth login for SuperGrok subscribers, letting xai/* models and xAI media/tool providers authenticate without XAI_API_KEY."

Expected: OAuth flow completes successfully, xAI credentials are stored in auth-profiles.json, and xai/* models become available without requiring XAI_API_KEY.

Actual: Flow fails immediately with "Failed to generate authentication code — Unknown scope" before any browser redirect or credential storage occurs.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING