4.1.0 • Published 2 years ago

pkce-challenge v4.1.0

Weekly downloads
23,782
License
MIT
Repository
github
Last release
2 years 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-nodefxn8nlark-ssohyper-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-flows@civic/mcp-sdk@cj2a7t/mcp-sdk@cloudbase/mcp-inspector-client@grerealadvisor/n8n@acceleron/mcp-typescript-sdk@adamrpostjr/strapi-plugin-sso@ehp/next-auth@codegenie/cli@alpic-ai/grizzly-client@cometh/connect-hosted-sdk@cometh/hosted-sdk-ethers@cool-midway/mcp@mkellsy/myqstrapi-plugin-ssostrapi-sso-pluginstrapi-plugin-oauth2-server@brbeaird/myquse-discord@prisme.ai/sdkn8nonrender-next-authnmsitd-oauth2next-auth-aunext-auth-flagnetanelgilad-context-sdknext-auth-proxyquip-clireact-zalo-account-kitreact-zalo-auth-kitgogo-dlgknext-authcomposiohq-modelcontextprotocol-typescript-sdkconnected-carcasdoor-react-native-sdkcoda-authcoda-auth-staticbirdy-flowsbirdy-flows-1@sudowealth/schwab-api@supernovaio/cli@supernovaio/cli-next@tawashy/na-multi-tenantera-login-widget-pkceera-login-widgetera-login-widget-publicffpass@aws/swb-reference@robert-op/next-auth@megavnet/n8n@querypie/mcp-test@querypie/mcp@querypie/mcp-stage@nipunibpaaris/modelcontextprotocol-typescript-sdk@onegrep/sdk@marc0777/strapi-plugin-sso@jhirono/todomcp@jeff-tian/strapi-plugin-sso@jkdev96/strapi-plugin-sso@pavindulakshan/modelcontextprotocol-typescript-sdk@dankelleher/modelcontextprotocol-sdk@daystram/ratify-client@dawnai/mcp-sdk@hjdhjd/myq
4.1.0

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

3.1.0

3 years ago

3.0.0

4 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

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago