Skip to content

fix: preserve operator scopes for shared auth connections#27498

Closed
kevinWangSheng wants to merge 1 commit intoopenclaw:mainfrom
kevinWangSheng:fix/operator-scopes-shared-auth
Closed

fix: preserve operator scopes for shared auth connections#27498
kevinWangSheng wants to merge 1 commit intoopenclaw:mainfrom
kevinWangSheng:fix/operator-scopes-shared-auth

Conversation

@kevinWangSheng
Copy link

Summary

When connecting via shared gateway token (no device identity), the operator scopes were being cleared, causing API operations to fail with 'missing scope' errors.

Fix

This fix preserves scopes when is true, allowing headless/API operator clients to retain their requested scopes.

Related Issue

Fixes #27494

When connecting via shared gateway token (no device identity),
the operator scopes were being cleared, causing API operations
to fail with 'missing scope' errors.

This fix preserves scopes when sharedAuthOk is true, allowing
headless/API operator clients to retain their requested scopes.

Fixes openclaw#27494
@openclaw-barnacle openclaw-barnacle bot added gateway Gateway runtime size: XS labels Feb 26, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 26, 2026

Greptile Summary

Fixed operator scope preservation for shared gateway token authentication. When operators connect via shared token/password without device identity (headless/API clients), their scopes are now correctly preserved instead of being cleared.

  • Added !sharedAuthOk condition to clearUnboundScopes() to preserve scopes when shared auth succeeds
  • Aligns with existing roleCanSkipDeviceIdentity() policy that allows operators with shared auth to skip device identity requirements
  • No security concerns: sharedAuthOk requires successful token/password authentication

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is a simple, focused one-line change that correctly addresses the scope preservation issue. The logic is consistent with existing authentication policies and doesn't introduce security vulnerabilities. The change has clear purpose and aligns with the system's design that operators with successful shared auth can skip device identity requirements.
  • No files require special attention

Last reviewed commit: c71c894

@arosstale

This comment was marked as spam.

steipete added a commit that referenced this pull request Feb 26, 2026
Landed follow-up for #27535 and aligned shared-auth gateway expectations after #27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
@steipete
Copy link
Contributor

Landed on main.

Landed via commit 9c14299 on main. Follow-up test alignment included in 96aad96. Thanks @kevinWangSheng.

@steipete steipete closed this Feb 26, 2026
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 4850148)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 4850148)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 4850148)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 4850148)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 4850148)
execute008 pushed a commit to execute008/openclaw that referenced this pull request Feb 27, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 28, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 4850148)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 4850148)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 4850148)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 4850148)
vincentkoc pushed a commit to Sid-Qin/openclaw that referenced this pull request Feb 28, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
vincentkoc pushed a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 96aad96)

# Conflicts:
#	src/agents/subagent-announce.ts
#	src/gateway/server.auth.test.ts
steipete added a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
(cherry picked from commit 96aad96)

# Conflicts:
#	src/agents/subagent-announce.ts
#	src/gateway/server.auth.test.ts
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
thebenjaminlee pushed a commit to escape-velocity-ventures/openclaw that referenced this pull request Mar 7, 2026
Landed follow-up for openclaw#27535 and aligned shared-auth gateway expectations after openclaw#27498.

Co-authored-by: kevinWangSheng <118158941+kevinWangSheng@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operator scopes cleared for API clients authenticating via shared token (no device identity)

3 participants