WAYF Cloud node.js Client
This is a node.js client module for the WAYF Cloud API. It wraps the WAYF Cloud REST API in order to simplify the integration of node.js applications to the WAYF Cloud.
Usage
Connect to the WAYF Cloud
const Wayf = ; // connect using an API Keyconst wc = API_KEYurl;
Register a local device id
const uuidv4 = ; let wayfLocal = ;var device = await wc;
Save data to the WAYF Cloud
// SAML/Shibboleth IdPlet idp = "University of X""sample-saml-entity-id""sample-saml-federation-id";// Open Athens IdPlet idp = "University of Y""sample-oa-entity-id""sample-oa-organization-id""sample-oa-scope";// idp IdP Objectlet samlEntity = "ORCID"; // save the IdP data to the WAYF Cloudvar response = await wc;
Get the IdP history for a device
let history = await wc;// [// {// "frequency": 20,// "last-used": "date",// "entity": {// "id": 1,// "type":"saml",// "entityID": "https://example-entity.saml.org"// }// },// {// "frequency": 5,// "last-used": <date>,// "entity": {// "id": 2,// "type":"oa",// "entityID": "https://example-entity.oa.org",// "scope": "123doc.com",// "organizationID": "5762748"// }// },// {// "type":"oauth",// "provider": "ORCID",// }// ]
Delete a user's IdP
//get historylet history = await wc; // delete an element from the historylet response = await wc