Strategy to authenticate with Nest via OAuth2 in OmniAuth
Get your API key at the Nest Developer Portal.
For more details, read the Nest authorization documentation.
Add this to your Gemfile
:
gem 'omniauth-nest'
then
bundle install
- Clone this repo and
cd
into it bundle install
(Required bundler gem)cd examples
- Set environment variables for NEST_ID and NEST_SECRET
- Set redirect URI to http://localhost:9292/auth/nest/callback
bundle exec rackup
- Open http://localhost:9292 in your browser and follow the links
In Rails add the following to config/initializers/omniauth.rb
use OmniAuth::Builder do
provider :nest, ENV['NEST_ID'], ENV['NEST_SECRET']
end
This will enable the route /auth/nest
which will start the OAuth2 flow. See examples/config.ru
for a fully working example.
NOTE: The Nest OAuth2 service only returns authorization tokens for the Nest API, not user identification.
Contributions are always welcome and highly encouraged.
See CONTRIBUTING for more information on how to get started.
Apache 2.0 - See LICENSE for more information.