Ricoh Auth Client.
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.
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
A working rails sample app using Ricoh Media Storage API is using this gem internally.
Add require 'ricohapi/auth' to use the APIs below.
client = RicohAPI::Auth::Client.new '<your-client-id>', '<your-client-secret>'client.resource_owner_credentials = '<your-user-id>', '<your-password>'api_session = client.api_token_for! '<scope>'The access token will be refreshed automatically as needed.
api_session = client.api_token_for!
access_token = api_session.access_token