4.1.0 • Published 1 year ago

pkce-challenge v4.1.0

Weekly downloads
23,782
License
MIT
Repository
github
Last release
1 year ago

pkce-challenge

Generate or verify a Proof Key for Code Exchange (PKCE) challenge pair.

Read more about PKCE.

Installation

npm install pkce-challenge

Usage

Default length for the verifier is 43

import pkceChallenge from "pkce-challenge";

await pkceChallenge();

gives something like:

{
    code_verifier: 'u1ta-MQ0e7TcpHjgz33M2DcBnOQu~aMGxuiZt0QMD1C',
    code_challenge: 'CUZX5qE8Wvye6kS_SasIsa8MMxacJftmWdsIA_iKp3I'
}

Specify a verifier length

const challenge = await pkceChallenge(128);

challenge.code_verifier.length === 128; // true

Challenge verification

import { verifyChallenge } from "pkce-challenge";

(await verifyChallenge(challenge.code_verifier, challenge.code_challenge)) ===
  true; // true

Challenge generation from existing code verifier

import { generateChallenge } from "pkce-challenge";

(await generateChallenge(challenge.code_verifier)) === challenge.code_challenge; // true
anilist-to-mal-sync@jasp/m365-authenticator@hyperspaceinc/next-auth@infinitebrahmanuniverse/nolb-pkspotify-api-request@everything-registry/sub-chunk-2442anime_foldersupertokens-nodefxn8n@codegenie/cli@cometh/connect-hosted-sdk@cometh/hosted-sdk-etherslark-sso@mkellsy/myqstrapi-plugin-ssostrapi-sso-pluginstrapi-plugin-oauth2-server@amplitude/ampli@aws/swb-reference@brbeaird/myq@adamrpostjr/strapi-plugin-sso@daystram/ratify-clientuse-discord@hellocoop/mockin@hjdhjd/myq@fintechprimitives/fpapi@koush/myq@marc0777/strapi-plugin-sso@nnguy101/next-auth@ehp/next-auth@mochabug/adaptkit@kalicloud/oauthify@jkdev96/strapi-plugin-sso@jasp/m365-authentication@iiwin/miniapp@prisme.ai/sdk@sap/graph-toolkit@portalnesia/portalnesia-js@picketapi/picket-js@outsauced/next-auth@p0security/cli@sekmet/next-auth@robert-op/next-authn8nonrender-next-authnmsitd-oauth2next-auth-aunext-auth-flagnetanelgilad-context-sdknext-auth-proxyquip-clireact-zalo-account-kitreact-zalo-auth-kitgogo-dlgknext-authhyper-mcp-typescript-sdkhomebridge-milaherrehalo-infinite-apilogin-with-twitter-oauth2lvl-io-sdkmcl-strapi-plugin-sso@wappnet-systems/myq@whiletruelove/next-auth@wisemen/vue-core-auth@wisemen/oauth2-vue-client@tunaayberk/auth-custom-test@vitusan/supertokens-node@test3207/mscba@zhuangya/next-authali-okki-cliauto-link-oauth-next-authanime-folderape-flowsape-test-3ape-test-4ape-test-5ape-test-6ape-test-7ape-testape-test-2archive-flowscomposiohq-modelcontextprotocol-typescript-sdkconnected-carcasdoor-react-native-sdkcoda-authcoda-auth-staticbirdy-flowsbirdy-flows-1era-login-widget-pkceera-login-widgetera-login-widget-publicffpass@showpune/azure-migration-dotnet-mcp@showpune/azure-migration-java-mcp@sickboy78/myq@soulofmischief/mcp-client-sdk@sudowealth/schwab-api@supernovaio/cli@supernovaio/cli-next
4.1.0

1 year ago

4.0.1

2 years ago

4.0.0

2 years ago

3.1.0

2 years ago

3.0.0

3 years ago

2.2.0

4 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago