OmniAuth::TimeTree
This gem contains the TimeTree strategy for OmniAuth.
Before You Begin
You should have already installed OmniAuth into your app; if not, read the OmniAuth README to get started.
Now sign into the TimeTree Developer Platform and create an application. Take note of your API keys.
Using This Strategy
First start by adding this gem to your Gemfile:
gem 'omniauth-timetree'
If you need to use the latest HEAD version, you can do so with:
gem 'omniauth-timetree', :github => 'koshilife/omniauth-timetree'
Next, tell OmniAuth about this provider. For a Rails app, your config/initializers/omniauth.rb
file should look like this:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :timetree, "API_KEY", "API_SECRET"
end
Replace "API_KEY"
and "API_SECRET"
with the appropriate values you obtained earlier.
Auth Hash Example
The auth hash request.env['omniauth.auth']
would look like this:
{
"provider": "timetree",
"uid": "12345",
"credentials": {
"token": "ACCESS_TOKEN",
"expires": false
},
"extra": {
"raw_info": {
"data": {
"id": "12345",
"type": "user",
"attributes": {
"name": "Your Name",
"description": "blah blah blah",
"image_url": "https://attachments.timetreeapp.com/path/to/image.png"
}
}
}
}
}
Contributing
Bug reports and pull requests are welcome on GitHub. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the omniauth-timetree project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.