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

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

# Interface: PkceOAuthConfig

Defined in: [packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts:94](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts#L94)

Configuration for the OAuth Authorization Code + PKCE flow.

## Extends

- [`HttpTransportOptions`](../../clients/interfaces/HttpTransportOptions.md)

## Properties

### accountManagerHost?

> `optional` **accountManagerHost**: `string`

Defined in: [packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts:97](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts#L97)

***

### clientId

> **clientId**: `string`

Defined in: [packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts:95](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts#L95)

***

### forceRefresh?

> `optional` **forceRefresh**: `boolean`

Defined in: [packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts:116](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts#L116)

Renew a stored sign-in with its refresh token even when the access token
is still valid, so it gets a new expiry (used by `b2c auth login`). Falls
back to the browser flow when there is no refresh token or renewal fails.

***

### localPort?

> `optional` **localPort**: `number`

Defined in: [packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts:99](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts#L99)

Local port for the redirect server (default 8080 or SFCC_OAUTH_LOCAL_PORT).

***

### openBrowser()?

> `optional` **openBrowser**: (`url`, `login?`) => `Promise`\<`void`\>

Defined in: [packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts:103](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts#L103)

Custom browser opener. Receives the authorization URL and a handle to cancel the pending login.

#### Parameters

##### url

`string`

##### login?

[`BrowserLogin`](BrowserLogin.md)

#### Returns

`Promise`\<`void`\>

***

### persistSession?

> `optional` **persistSession**: `boolean`

Defined in: [packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts:110](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts#L110)

Persist tokens (access + refresh) to disk between CLI invocations,
keyed by clientId. When a refresh token is available it is used to
silently obtain a new access token instead of opening the browser.
Defaults to `true`.

***

### redirectUri?

> `optional` **redirectUri**: `string`

Defined in: [packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts:101](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts#L101)

Override redirect URI (default `http://localhost:${localPort}` or SFCC_REDIRECT_URI).

***

### scopes?

> `optional` **scopes**: `string`[]

Defined in: [packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts:96](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/oauth-pkce.ts#L96)
