Auth Javascript Library for Ricoh API.
You need
Ricoh API Client Credentials (client_id & client_secret)
Ricoh ID (user_id & password)
If you don't have them, please register yourself and your client from THETA Developers Website.
$ npm install ricohapi-auth
const AuthClient = require('ricohapi-auth').AuthClient;
const client = new AuthClient('<your_client_id>', '<your_client_secret>');
client.setResourceOwnerCreds('<your_user_id>', '<your_password>');
client.session(AuthClient.SCOPES.MStorage)
.then(result => console.log(result))
.catch(e => console.log(e));
const client = new AuthClient('<your_client_id>', '<your_client_secret>');
This service only supports the resource owner password credentials flow.
client.setResourceOwnerCreds('<your_user_id>', '<your_password>');
client.session('<scope>');
A Promise is returned.
The access token will be refreshed automatically as needed.
client.getAccessToken();
A Promise is returned.