oidc_pkce
Version:
OIDC PKCE: A package for generating PKCE parameters, nonce, and state for OpenID Connect authentication. Simplify secure authentication flows in web applications.
29 lines (24 loc) • 734 B
TypeScript
declare module 'oidc_pkce' {
export function generateCodeChallenge(
codeVerifier: string,
method: 'plain' | 'S256'
): Promise<string>;
export function getRandomString(length: number): string;
export function generatePKCEandNONCEandState({
useNONCE = true,
useSTATE = true,
usePKCE = true,
codeChallengeMethod = 'S256',
codeVerifierLength = 64,
stateLength = 32,
nonceLength = 32
}: {
useNONCE?: boolean,
useSTATE?: boolean,
usePKCE?: boolean,
codeChallengeMethod?: 'plain' | 'S256',
codeVerifierLength?: number,
stateLength?: number,
nonceLength?: number
}): Promise<object>;
}