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

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

# Function: applyClientCredentials()

> **applyClientCredentials**(`params`, `clientId`, `clientSecret`, `method?`): `Record`\<`string`, `string`\>

Defined in: [packages/b2c-tooling-sdk/src/auth/client-credentials.ts:123](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/bceb8da43dd8bc63d57932bbd905d36a1b40c949/packages/b2c-tooling-sdk/src/auth/client-credentials.ts#L123)

Applies OAuth client authentication to a token request using the method
chosen by [resolveClientAuthMethod](resolveClientAuthMethod.md). Account Manager accepts all of them.

## Parameters

### params

`URLSearchParams`

The token request body; credentials are appended in the `body` case

### clientId

`string`

The OAuth client identifier

### clientSecret

`string`

The OAuth client password/secret

### method?

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

The configured client authentication method, if any

## Returns

`Record`\<`string`, `string`\>

Headers to add to the token request (empty in the `body` case)
