@financial-times/session-decoder-js

1.4.0 • Public • Published

Session Decoder

CircleCI

A library that allows you to decode the UUID from an FT session.

Usage

To use the Session Decoder, you need to provide a public key to the constructor. The public key is used to verify the digital signature of the session token. Here is an example of how to use the Session Decoder to decode a session token:

const SessionDecoder = require('@financial-times/session-decoder-js');
const secureDecoder = new SessionDecoder(SESSION_PUBLIC_KEY);
const uuid = secureDecoder.decode(Session);

Installation

npm install @financial-times/session-decoder-js

Security Warning

It is important to note that the session token only holds the UUID and does not indicate the validity of the session, such as whether it has expired or been revoked. As a result, it is not recommended to use this library for authentication. Requests that read and write user data must authenticate directly against the Session API to ensure that the session is valid.

For more information:-

Readme

Keywords

none

Package Sidebar

Install

npm i @financial-times/session-decoder-js

Weekly Downloads

2

Version

1.4.0

License

none

Unpacked Size

554 kB

Total Files

31

Last publish

Collaborators

  • robertboulton
  • seraph2000
  • hamza.samih
  • notlee
  • emmalewis
  • aendra
  • the-ft
  • rowanmanning
  • chee
  • alexwilson