OAuth2ProviderAuthWithPKCE

interface OAuth2ProviderAuthWithPKCE<
	_ProviderUserAuth extends ProviderUserAuth
> {
	getAuthorizationUrl: () => Promise<
		readonly [url: URL, codeVerifier: string, state: string | null]
	>;
	validateCallback: (
		code: string,
		codeVerifier: string
	) => Promise<_ProviderUserAuth>;
}
Generics#
nameextendsdescription
_ProviderUserAuthProviderUserAuthvalidateCallback() return type

getAuthorizationUrl()#

Creates a new authorization url, optional with a state.

const getAuthorizationUrl: () => Promise<
	readonly [url: URL, codeVerifier: string, state: string | null]
>;
Returns#
nametypedescription
urlURLauthorization url
codeVerifierstringcode verifier
statestring | nullstate, if defined

validateCallback()#

Validates the authorization code and code verifier, and returns a new ProviderUserAuth instance.

const validateCallback: (
	code: string,
	codeVerifier: string
) => Promise<_ProviderUserAuth>;
Parameters#
nametypedescription
codestringauthorization code
codeVerifierstringcode verifier
Returns#