Skip to content

YukiThornton/auth-rb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ricoh Auth Client for Ruby

Ricoh Auth Client.

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.

Installation

Add this line to your application's Gemfile:

gem 'ricohapi-auth'

And then execute:

$ bundle

Or execute the following line to install the gem without bundler.

$ gem install ricohapi-auth

Usage

A working rails sample app using Ricoh Media Storage API is using this gem internally.

SDK API

Add require 'ricohapi/auth' to use the APIs below.

Constructor

client = RicohAPI::Auth::Client.new '<your-client-id>', '<your-client-secret>'

Set resource owner credentials

client.resource_owner_credentials = '<your-user-id>', '<your-password>'

Open a new session

api_session = client.api_token_for! '<scope>'

Obtain the valid access token

The access token will be refreshed automatically as needed.

api_session = client.api_token_for!
access_token = api_session.access_token

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 98.6%
  • Shell 1.4%