Socket
Book a DemoInstallSign in
Socket

@ping-identity/p14c-js-sdk-jwt

Package Overview
Dependencies
Maintainers
6
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ping-identity/p14c-js-sdk-jwt

Validate access tokens

1.0.0-pre.2
latest
Source
npmnpm
Version published
Weekly downloads
43
95.45%
Maintainers
6
Weekly downloads
 
Created
Source

JWT Verification Module of PingOne SDK for JavaScript

This module allows you to decode and verify JSON Web Token.

It validates if the JWT:

  • is well-formed - contains three base64url encoded segments, separated by two period ('.') characters: Header, Payload and Signature;
  • is correctly signed using the proper key;
  • has correct standard claims: token expiration, issuer and audience.

NOTE:

THIS REPOSITORY IS IN A TESTING MODE AND IS NOT READY FOR PRODUCTION !!!

Content

  • Installation
  • Module API Reference

Installation

To install @ping-identity/p14c-js-sdk-jwt you can run these commands in your project root folder:

# yarn
yarn install @ping-identity/p14c-js-sdk-jwt

or

# npm
npm install --save @ping-identity/p14c-js-sdk-jwt

Create JwtVerifier like:

const JwtVerifier = require("@ping-identity/p14c-js-sdk-jwt");

const jwtVerifier = new JwtVerifier(jwksUri);

jwtVerifier.validateToken("idTokenContent", "expectedAudience", "expectedIssuer", "expectedNonce")

where configuration parameter is:

  • jwksUri: Required. JSON Web Key Set of keys which contains the public keys used to verify any JWT issued by authorization server and signed by RS256 signing algorithm.

Module API Reference

MethodDescription
validateToken (idToken, expectedAudience, expectedIssuer, expectedNonce)Verify ID token validity.
decodeToken (idToken)Decode ID Token string into the individual JWS parts: header, payload and signature
jwkGetKey(jwkIn, kty, use, kid)Retrieve the JWK key that matches the input criteria
getIdTokenPayload (idToken)Get the claim set of a JWT without performing validation of the signature or any of the registered claims

Keywords

pingidentity

FAQs

Package last updated on 02 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.