Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / auth / PkceWithImplicitFallbackStrategy

Class: PkceWithImplicitFallbackStrategy

Defined in: packages/b2c-tooling-sdk/src/auth/oauth-pkce-fallback.ts:59

Wraps a PkceOAuthStrategy and, on a PkceGrantUnsupportedError, falls back to an ImplicitOAuthStrategy for the same client. The fallback is attempted at most once and then sticks for the lifetime of this instance, so subsequent calls go straight to implicit without re-attempting the failing PKCE flow.

Implements

Constructors

Constructor

new PkceWithImplicitFallbackStrategy(config): PkceWithImplicitFallbackStrategy

Defined in: packages/b2c-tooling-sdk/src/auth/oauth-pkce-fallback.ts:66

Parameters

config

PkceOAuthConfig

Returns

PkceWithImplicitFallbackStrategy

Properties

authMethod

readonly authMethod: "user"

Defined in: packages/b2c-tooling-sdk/src/auth/oauth-pkce-fallback.ts:60

Browser auth method represented by this strategy.

Implementation of

UserAuthStrategy.authMethod

Methods

fetch()

fetch(url, init): Promise<Response>

Defined in: packages/b2c-tooling-sdk/src/auth/oauth-pkce-fallback.ts:70

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

Parameters

url

string

init

FetchInit = {}

Returns

Promise<Response>

Implementation of

UserAuthStrategy.fetch


getAuthorizationHeader()

getAuthorizationHeader(): Promise<string>

Defined in: packages/b2c-tooling-sdk/src/auth/oauth-pkce-fallback.ts:85

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

Returns

Promise<string>

Implementation of

UserAuthStrategy.getAuthorizationHeader


getJWT()

getJWT(): Promise<DecodedJWT>

Defined in: packages/b2c-tooling-sdk/src/auth/oauth-pkce-fallback.ts:100

Returns

Promise<DecodedJWT>

Implementation of

UserAuthStrategy.getJWT


getTokenResponse()

getTokenResponse(): Promise<AccessTokenResponse>

Defined in: packages/b2c-tooling-sdk/src/auth/oauth-pkce-fallback.ts:115

Returns

Promise<AccessTokenResponse>

Implementation of

UserAuthStrategy.getTokenResponse


invalidateToken()

invalidateToken(): void

Defined in: packages/b2c-tooling-sdk/src/auth/oauth-pkce-fallback.ts:130

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

Returns

void

Implementation of

UserAuthStrategy.invalidateToken

Released under the Apache-2.0 License.