@diy-kitchens/webtoken
v1.0.5
Published
Utilities to read, write, verify Ultima format web tokens
Downloads
21
Readme
Ultima Web Token
TokenService
Create with secret to encode/decode:
const service = new TokenService('secret');
provides decode, create, validate, hasAccess
methods for dealing with Ultima tokens
extractTokens
Reads tokens from Ultima style authorisation header, returns interface:
export interface ITokens {
applicationId: string;
applicationToken: string;
universalToken: string;
userToken: string;
}
Sample usage:
const tokens: ITokens = getTokens(authheaderString, 'Universal');