Simple utility to get a json web token in a D2L free range application (frau).
npm install frau-jwt --save
import jwt from 'frau-jwt';
const token = await jwt('a:b:c');
Requests a JWT with the given scope and opts from the hosting LMS. If in an ifrau, the request will be delegated to the frame host.
The resulting token will be cached until it expires.
If scope is provided, then it will be sent as the request scope of the token. It should be a properly formatted String, with scopes seperated by spaces.
jwt();
jwt('foo:bar:baz');
jwt('a:b:c x:y:z');
If an opts object is provided, the following options will be checked for:
You may optionally specify whether you want the user's sessions to be extended by the act of fetching the token.
jwt();
jwt({ extendSession: false });
jwt('foo:bar:baz', { extendSession: false });
npm test
This repo is configured to use semantic-release
. Commits prefixed with fix:
and feat:
will trigger patch and minor releases when merged to main
.
To learn how to create major releases and release from maintenance branches, refer to the semantic-release GitHub Action documentation.