OmniAuth DrChrono OAuth2 Strategy
A DrChrono OAuth2 strategy for OmniAuth.
For more details, read the DrChrono documentation: https://www.drchrono.com/api/
I found out after I pushed version 1 of this gem that another omniauth strategy already exists for DrChrono https://github.com/johnnadeau/omniauth-drchrono. I renamed this project to omniauth-drchrono-oauth2
to avoid confusion.
Installation
Add this line to your application's Gemfile:
gem 'omniauth-drchrono-oauth2'
And then execute:
$ bundle
Or install it yourself as:
$ gem install omniauth-drchrono-oauth2
Usage
Register your application with DrChrono to receive an API key: https://www.drchrono.com/api/
This is an example that you might put into a Rails initializer at config/initializers/omniauth.rb
:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :drchrono, ENV['DRCHRONO_CLIENT_ID'], ENV['DRCHRONO_CLIENT_SECRET'], :scope => 'patients:read settings:read user:read'
end
You can now access the OmniAuth DrChrono OAuth2 URL: /auth/drchrono
.
Granting Member Permissions to Your Application
With the DrChrono API, you have the ability to specify which permissions you want users to grant your application. For more details, read the DrChrono documentation: https://www.drchrono.com/api/
You can configure the scope option:
provider :drchrono, ENV['DRCHRONO_CLIENT_ID'], ENV['DRCHRONO_CLIENT_SECRET'], :scope => 'settings:read user:read'
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request