This is a strategy to connect with iHealth using Ommniauth and OAuth 2.0
Add to your Gemfile
:
gem 'omniauth-ihealth', :git=>'https://github.com/ArturKarbone/omniauth-ihealth.git'
Then bundle install
.
Here's a quick example, adding the middleware to a Rails app in config/initializers/omniauth.rb
:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :ihealth, ENV['KEY'], ENV['SECRET']
end
You can configure several options, which you pass in to the provider
method via a Hash
:
use_sandbox
: Use sandbox urls. false by default
For example, to test in sandbox mode
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, ENV['KEY'], ENV['SECRET'],:use_sandbox => true
end