Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

ricohapi/auth-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ricoh Auth Client for JavaScript

Auth Javascript Library for Ricoh API.

Requirements

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.

Install

$ npm install ricohapi-auth

Authentication

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));

SDK API

Constructor

const client = new AuthClient('<your_client_id>', '<your_client_secret>');

Set resource owner credentials

This service only supports the resource owner password credentials flow.

client.setResourceOwnerCreds('<your_user_id>', '<your_password>');

Open session

client.session('<scope>');

A Promise is returned.

Obtain the valid access token

The access token will be refreshed automatically as needed.

client.getAccessToken();

A Promise is returned.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •