Skip to content

Add Bearer and refresh token injection for SLAS logout with HttpOnly cookies#3699

Merged
unandyala merged 7 commits intofeature/httponly-session-cookiesfrom
unandyala.handle-logout
Mar 4, 2026
Merged

Add Bearer and refresh token injection for SLAS logout with HttpOnly cookies#3699
unandyala merged 7 commits intofeature/httponly-session-cookiesfrom
unandyala.handle-logout

Conversation

@unandyala
Copy link
Contributor

@unandyala unandyala commented Mar 2, 2026

Summary

  • Injects Bearer token (from cc-at_{siteId} HttpOnly cookie) and refresh token (from cc-nx_{siteId} or cc-nx-g_{siteId} HttpOnly cookie) into SLAS private client proxy requests for endpoints like /oauth2/logout
  • Moves SLAS-specific Bearer token logic from configure-proxy.js (regular /mobify/proxy path) into the SLAS private client proxy in build-remote-server.js, since SLAS calls don't go through the regular proxy when useSLASPrivateClient is enabled
  • Simplifies configure-proxy.js by removing slasEndpointsRequiringAccessToken parameter — all /shopper/auth/ endpoints are now skipped in the regular proxy
httponly-logout.mov

Test plan

  • build-remote-server tests pass (53/53) — includes new test verifying Bearer token and refresh_token injection from HttpOnly cookies for logout
  • configure-proxy tests pass (10/10) — updated to reflect SLAS auth endpoints being fully handled by SLAS private proxy

🤖 Generated with Claude Code

…logout

When HttpOnly session cookies are enabled, the shopper's access token and
refresh token are stored in HttpOnly cookies and are not accessible to
client-side JavaScript. The SLAS /oauth2/logout endpoint requires both
a Bearer token in the Authorization header and a refresh_token query
parameter. This change injects both from HttpOnly cookies in the SLAS
private client proxy.

Also moves SLAS-specific Bearer token logic out of configure-proxy.js
(regular /mobify/proxy path) into the SLAS private client proxy where
it belongs, since SLAS calls don't go through the regular proxy when
useSLASPrivateClient is enabled.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@unandyala unandyala requested a review from a team as a code owner March 2, 2026 19:19
@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Mar 2, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@unandyala unandyala changed the base branch from develop to feature/httponly-session-cookies March 2, 2026 19:19
*/
_configureProxyConfigs(options) {
const siteId = options.siteId || null
const slasEndpointsRequiringAccessToken = options.slasEndpointsRequiringAccessToken
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved slasEndpointsRequiringAccessToken to slas private proxy because slas calls do not go through the scapi proxy (/mobify/proxy)

@unandyala unandyala requested review from shethj and vcua-mobify March 3, 2026 23:19
Copy link
Contributor

@vcua-mobify vcua-mobify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes make sense to me. Thanks for cleaning up configure-proxy

}

// Inject refresh_token into query string from HttpOnly cookie
// refresh_token ishouls required for /oauth2/logout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// refresh_token ishouls required for /oauth2/logout
// refresh_token is required for /oauth2/logout

@unandyala unandyala merged commit 6dd7f28 into feature/httponly-session-cookies Mar 4, 2026
45 of 47 checks passed
@unandyala unandyala deleted the unandyala.handle-logout branch March 4, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants