You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/b2b-edition/authentication/hosted-auth.mdx
+21-11Lines changed: 21 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,12 @@
1
+
---
2
+
title: Authentication for hosted storefronts
3
+
keywords: b2b edition, authentication, api token
4
+
---
5
+
1
6
# Authentication for hosted storefronts
2
7
3
8
<Callouttype="important">
4
-
As of September 30, 2025, the B2B Edition API `authToken`will be deprecated and replaced by the standard BigCommerce API `X-Auth-Token`.
9
+
As of September 30, 2025, the B2B Edition API `authToken`is deprecated and replaced by the standard BigCommerce API `X-Auth-Token` used together with a new header `X-Store-Hash`. This change only applies to Server-to-Server requests. Storefront requests remain unchanged.
5
10
6
11
While `authToken` authentication is not expected to be fully sunset in the near future, it is advised to migrate to the new system as soon as possible to prevent disruption of functionality.
7
12
@@ -26,6 +31,10 @@ To create a token for server-to-server requests,
26
31
3. Create a V3 Token with the B2B Edition scope set to `modify`.
27
32
4. Save the relevant account keys for future reference.
28
33
34
+
<Callouttype="info">
35
+
If you are a partner building an app intended for use with B2B Edition, you will need to ensure the B2B Edition scope is enabled before publishing the app.
36
+
</Callout>
37
+
29
38
For more information on creating and managing API accounts, refer to [API Accounts (Help Center)](https://support.bigcommerce.com/s/article/Store-API-Accounts).
30
39
31
40
<Callouttype="warning">
@@ -45,13 +54,17 @@ An `X-Auth-Token` used without an `X-Store-Hash` or with a mismatched hash will
45
54
46
55
The `X-Auth-Token` structure is designed for long-term use. As such, they do not expire by default.
47
56
48
-
User-specific tokens can be generated by the [Get a Server to Server Token](/b2b-edition/apis/rest-management/authentication#get-server-to-server-tokens) endpoint, which generates a server-to-server token by validating a backend user’s login credentials and the store hash instead of relying on an existing token. This is useful if you are building an integration which automatically generates a token for Store Owner or Administrator users.
57
+
User-specific tokens can be generated by the **deprecated**[Get a Server to Server Token](/b2b-edition/apis/rest-management/authentication#get-a-server-to-server-token) endpoint. Rather than relying on an existing token, it generates an `authToken` by validating a backend user’s login credentials and the store hash.
58
+
59
+
Server to server tokens can be configured to expire using this endpoint to set a fixed validity period using the `endAt` field in the request. For more information, see [Server-to-Server Authentication](/b2b-edition/apis/rest-management/authentication).
49
60
50
61
<Callouttype="warning">
51
-
This endpoint does not support users with custom system user roles, even if those roles have API account creation permissions.
62
+
This endpoint generates an `authToken`, which is deprecated. In addition, it does not support users with custom system user roles, even if those roles have API account creation permissions.
52
63
</Callout>
53
64
54
-
Server to server tokens can be configured to expire using this endpoint to set a fixed validity period using the `endAt` field in the request. For more information, see (Server-to-Server Authentication)[/b2b-edition/apis/rest-management/authentication]
65
+
<Callouttype="info">
66
+
If you are still using the B2B Edition specific `authToken`, the store hash is not needed as the token includes that information. Including `X-Store-Hash` with `authToken` will have unexpected results. Please migrate to the unified token structure as soon as possible to avoid loss of functionality.
67
+
</Callout>
55
68
56
69
```js filename="Fetch request example" copy
57
70
asyncfunction() {
@@ -77,14 +90,12 @@ async function() {
77
90
}
78
91
```
79
92
80
-
Tokens created via API can be invalidated as necessary using the [Delete Backend API Tokens](/b2b-edition/apis/rest-management/authentication#delete-backend-api-tokens) endpoint.
81
-
82
-
For more details, see the [B2B Edition Settings](https://support.bigcommerce.com/s/article/B2B-Edition-Settings).
93
+
Tokens created via API can be invalidated as necessary using the **deprecated**[Delete Backend API Tokens](/b2b-edition/apis/rest-management/authentication#delete-backend-api-tokens) endpoint.
83
94
84
95
## Storefront Tokens
85
96
86
97
<Callouttype="info">
87
-
**Note:** This section covers authentication for the B2B Edition GraphQL Storefront API. It is best practice to use GraphQL mutations when generating storefront authTokens on B2B Edition’s Buyer Portal experience. For information about the equivalent REST Storefront Authentication API requests, see [Authentication](/b2b-edition/apis/rest-storefront/sales-rep).
98
+
**Note:** This section covers authentication for the B2B Edition GraphQL Storefront API. It is best practice to use GraphQL mutations when generating storefront authTokens on B2B Edition’s Buyer Portal experience. For information about the equivalent REST Storefront Authentication API requests, see [Authentication](/b2b-edition/apis/rest-storefront/authentication).
88
99
</Callout>
89
100
90
101
B2B Edition’s REST Storefront and GraphQL Storefront APIs allow you to query and modify data from the context of a storefront user. Depending on your store’s configurations, you can perform certain actions as a guest shopper, a B2C customer with a storefront account, a B2B buyer with a Company user account, or a [Super Admin](/b2b-edition/apis/rest-storefront/sales-rep) user.
See our article on [storefront authentication](/b2b-edition/apis/rest-storefront/authentication#get-storefront-authtoken-within-stencil) to learn more about this mutation’s usage and fields.
232
243
233
-
### Rest Management API Endpoints
244
+
### REST Management API Endpoints
234
245
235
246
If your integration or headless solution is built to use server-side endpoints, you can also retrieve storefront authTokens via B2B Edition’s REST Management Authentication API. Each endpoint uses a server to server authToken for validation, but they also require specific fields or parameters based on their use case.
0 commit comments