Omniauth YOYOW
中文 En
This is the official OmniAuth strategy for authenticating to YOYOW. To use it, a platform account is needed(what's platform), addtionally, you'll need to setup yoyow-middleware.
Installation
Add this line to your application's Gemfile:
gem 'omniauth-yoyow'
And then execute:
$ bundle
Or install it yourself as:
$ gem install omniauth-yoyow
Usage
Change the url to yoyow-middleware server address in following code.
use OmniAuth::Builder do
provider :yoyow, 'http://localhost:3000'
end
Setup YOYOW Middleware
Clone the middleware code:
git clone https://github.com/yoyow-org/yoyow-node-sdk/tree/master/middleware
cd middleware
vim conf/config.js
YOYOW test-net configuration is recommended while developing your applaction, you can switch it to main-net when production ready.
Sample config for test-net:
module.exports = {
apiServer: "ws://47.52.155.181:10011",
secure_ageing: 120,
secure_key: "",
active_key: "",
secondary_key: "",
memo_key: "",
platform_id: "",
use_csaf: true,
to_balance: false,
wallet_url: "http://demo.yoyow.org:8000/#/authorize-service",
allow_ip: ["localhost", "127.0.0.1"]
};
Sample config for main-net:
module.exports = {
apiServer: "wss://wallet.yoyow.org/ws",
...
wallet_url: "http://wallet.yoyow.org/#/authorize-service",
allow_ip: ["localhost", "127.0.0.1"]
};