Skip to content

PAPI-3173 - Introduce private token authentication and deprecate simple token for S2S requests#1245

Merged
krzysztof-maziarka-bc merged 23 commits intomainfrom
PAPI-3173_strf-stateless-private-token-introduction
Mar 18, 2026
Merged

PAPI-3173 - Introduce private token authentication and deprecate simple token for S2S requests#1245
krzysztof-maziarka-bc merged 23 commits intomainfrom
PAPI-3173_strf-stateless-private-token-introduction

Conversation

@krzysztof-maziarka-bc
Copy link
Copy Markdown
Contributor

@krzysztof-maziarka-bc krzysztof-maziarka-bc commented Jan 28, 2026

Jira: PAPI-3173

What changed?

  • Introduce private tokens for server-to-server GraphQL Storefront API use and document create/revoke REST endpoints.
  • Deprecate storefront tokens for server-to-server: new storefront tokens will no longer work statelessly in server-to-server contexts after a future date; recommend private tokens for new s2s integrations.
  • Stop recommending storefront tokens for s2s: direct server-to-server and headless/server-side flows to private tokens (and customer access tokens where needed).
  • Clarify storefront tokens as browser-only (CORS via allowed_cors_origins) and allow customer access tokens to be used with either a storefront or private token.
  • Update/correct GraphQL storefront API token examples to reflect correct JSON structure by nesting the token under a "data" key.
  • Document private token access scopes (Unauthenticated, Customer, B2B), scope enforcement errors (INSUFFICIENT_ACCESS_SCOPE), and the principle of least privilege.

Release notes draft

  • Private tokens are now available for authenticating server-to-server requests to the GraphQL Storefront API. Use them for backend and headless integrations instead of storefront tokens.
  • Storefront tokens remain for browser-based storefronts; new storefront tokens will stop working for server-to-server after a future date, so use private tokens for new server-to-server integrations. Learn more.

Anything else?

Related to: https://github.com/bigcommerce/developer-center/pull/1346

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces private tokens for server-to-server integrations with the GraphQL Storefront API and deprecates the use of storefront tokens in server-to-server contexts. The changes include new API endpoints, comprehensive documentation updates, and clear migration guidance for developers.

Changes:

  • Added a new /storefront/api-token-private endpoint with POST and DELETE operations for creating and revoking private tokens
  • Added deprecation notices across API reference and documentation indicating that storefront tokens will no longer be usable statelessly in server-to-server contexts after a future deprecation date
  • Updated all relevant documentation to recommend private tokens for server-to-server use cases while maintaining storefront tokens for browser-based applications

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
reference/storefront_tokens.v3.yml Added private token endpoint definitions (create/revoke), updated descriptions to clarify token types, and added deprecation notice for storefront tokens in S2S contexts
docs/storefront/headless/customers.mdx Updated to recommend private tokens with customer access tokens for headless/server-side code
docs/storefront/headless/channels.mdx Clarified token usage patterns: private tokens for S2S, customer impersonation for S2S with customer data, storefront tokens for browsers
docs/storefront/graphql/index.mdx Added deprecation warning for storefront tokens in S2S contexts and updated guidance to recommend private tokens
docs/start/authentication/graphql-storefront.mdx Added comprehensive private tokens section with creation examples, security guidance, and updated all S2S recommendations to use private tokens

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread reference/storefront_tokens.v3.yml Outdated
Comment thread docs/start/authentication/graphql-storefront.mdx
Comment thread docs/start/authentication/graphql-storefront.mdx Outdated
Comment thread docs/start/authentication/graphql-storefront.mdx Outdated
Comment thread docs/start/authentication/graphql-storefront.mdx
krzysztof-maziarka-bc and others added 4 commits January 28, 2026 15:03
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…on descriptions and remove private token revocation endpoint
…-token-introduction' into PAPI-3173_strf-stateless-private-token-introduction
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/start/authentication/graphql-storefront.mdx
…orrect JSON structure by nesting the token under a "data" key
…lder comments in the "meta" field for improved clarity
Comment thread docs/storefront/headless/customers.mdx
Comment thread docs/storefront/headless/customers.mdx
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread reference/storefront_tokens.v3.yml Outdated
Comment thread docs/start/authentication/graphql-storefront.mdx Outdated
Comment thread docs/storefront/headless/customers.mdx Outdated
krzysztof-maziarka-bc and others added 3 commits January 30, 2026 13:30
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/storefront/headless/channels.mdx Outdated
Comment thread docs/start/authentication/graphql-storefront.mdx Outdated
Comment thread docs/start/authentication/graphql-storefront.mdx Outdated
Copy link
Copy Markdown
Contributor

@6juara9 6juara9 left a comment

Choose a reason for hiding this comment

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

Overall Looks good, some minor comments

Comment thread docs/start/authentication/graphql-storefront.mdx
Comment thread docs/start/authentication/graphql-storefront.mdx
Comment thread docs/start/authentication/graphql-storefront.mdx Outdated
Comment thread docs/storefront/headless/channels.mdx Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread reference/storefront_tokens.v3.yml
…ostPrivate schema, added required scopes for private tokens, and clarified access scope identifiers.
…ntation, specifying that requests with no scopes will be rejected by the API.
@krzysztof-maziarka-bc krzysztof-maziarka-bc marked this pull request as ready for review March 11, 2026 10:32
Comment thread docs/start/authentication/graphql-storefront.mdx Outdated
@krzysztof-maziarka-bc krzysztof-maziarka-bc merged commit 74ff1cf into main Mar 18, 2026
2 checks passed
@krzysztof-maziarka-bc krzysztof-maziarka-bc deleted the PAPI-3173_strf-stateless-private-token-introduction branch March 18, 2026 11:55
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