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

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

# Function: exchangePkceAuthorizationCode()

> **exchangePkceAuthorizationCode**(`options`): `Promise`\<[`PkceTokenSet`](../interfaces/PkceTokenSet.md)\>

Defined in: [packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts:292](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts#L292)

Exchange an authorization code and PKCE verifier for tokens at Account
Manager's token endpoint. Never logs the code, verifier or tokens.

## Parameters

### options

[`PkceCodeExchangeOptions`](../interfaces/PkceCodeExchangeOptions.md)

## Returns

`Promise`\<[`PkceTokenSet`](../interfaces/PkceTokenSet.md)\>

## Throws

PkceGrantUnsupportedError when the client can't use the code grant
