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@nipunibpaaris/modelcontextprotocol-typescript-sdk@onegrep/sdk@pavindulakshan/modelcontextprotocol-typescript-sdk@hjdhjd/myq@holipoly/cli@nnguy101/next-auth@iiwin/miniapp@picketapi/picket-js@portalnesia/portalnesia-js@outsauced/next-auth@p0security/cli@sudowealth/schwab-api@supernovaio/cli@supernovaio/cli-next@tawashy/na-multi-tenantera-login-widget-pkceera-login-widgetera-login-widget-publicffpass@prisme.ai/sdk@acceleron/mcp-typescript-sdk@blocklet/mcp@civic/mcp-sdk@cj2a7t/mcp-sdk@big-whale-labs/modelcontextprotocol-sdk@aws/swb-reference@borodutch/modelcontextprotocol-sdk@brbeaird/myqcomposiohq-modelcontextprotocol-typescript-sdkconnected-carcasdoor-react-native-sdkcoda-authcoda-auth-staticbirdy-flowsbirdy-flows-1@adamrpostjr/strapi-plugin-sso@alpic-ai/grizzly-client@amplitude/ampli@mkellsy/myqstrapi-plugin-ssostrapi-sso-pluginstrapi-plugin-oauth2-serveruse-discordn8nonrender-next-authnmsitd-oauth2next-auth-aunext-auth-flagnetanelgilad-context-sdknext-auth-proxyquip-clireact-zalo-account-kitreact-zalo-auth-kitgogo-dlgknext-auth@daystram/ratify-client@dawnai/mcp-sdk@dankelleher/modelcontextprotocol-sdk@kentcdodds/tmp-modelcontextprotocol_-client@kentcdodds/tmp-modelcontextprotocol_inspector-client@koush/myq@n8n-plus/n8n-plus@cometh/connect-hosted-sdk
4.1.0

2 years ago

4.0.1

3 years ago

4.0.0

3 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