frau-jwt
Simple utility to get a json web token in a D2L free range application (frau).
Install
npm install frau-jwt --save
Usage
var jwt = require('frau-jwt');
jwt('a:b:c')
.then(function (token) {
// do a thing with the token
});
API
jwt([String scope])
-> Promise<String>
Requests a JWT with the given scope 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.
Optional: scope
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.
Defaults to *:*:*
.
Examples
foo:bar:baz
a:b:c x:y:z
Testing
npm test
Contributing
-
Fork the repository. Committing directly against this repository is highly discouraged.
-
Make your modifications in a branch, updating and writing new unit tests as necessary in the
spec
directory. -
Ensure that all tests pass with
npm test
-
rebase
your changes against master. Do not merge. -
Submit a pull request to this repository. Wait for tests to run and someone to chime in.
Code Style
This repository is configured with EditorConfig and ESLint rules.