---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [auth](../index.md) / AuthStrategy

# Interface: AuthStrategy

Defined in: [packages/b2c-tooling-sdk/src/auth/types.ts:17](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/auth/types.ts#L17)

## Methods

### fetch()

> **fetch**(`url`, `init?`): `Promise`\<`Response`\>

Defined in: [packages/b2c-tooling-sdk/src/auth/types.ts:22](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/auth/types.ts#L22)

Performs a fetch request with authentication.
Implementations MUST handle header injection and 401 retries (token refresh) internally.

#### Parameters

##### url

`string`

##### init?

[`FetchInit`](../type-aliases/FetchInit.md)

#### Returns

`Promise`\<`Response`\>

***

### getAuthorizationHeader()?

> `optional` **getAuthorizationHeader**(): `Promise`\<`string`\>

Defined in: [packages/b2c-tooling-sdk/src/auth/types.ts:27](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/auth/types.ts#L27)

Optional: Helper for legacy clients (like a strict WebDAV lib) that need the raw header.

#### Returns

`Promise`\<`string`\>

***

### invalidateToken()?

> `optional` **invalidateToken**(): `void`

Defined in: [packages/b2c-tooling-sdk/src/auth/types.ts:33](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/auth/types.ts#L33)

Optional: Invalidates the cached token, forcing re-authentication on next request.
Used by middleware to retry requests after receiving a 401 response.

#### Returns

`void`
