Categories: None [Edit]
fresh-auth
# Fresh::Auth
This gem makes it really, REALLY easy to use the Freshbooks API. It couldn't be easier.
With only 3 functions you'll ever need to use, and only 2 required configuration values, it can't get any easier.
## Installation
Add this line to your application's Gemfile:
gem 'fresh-auth'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fresh-auth
## Usage
### Configuration:
You must define your Freshbooks subdomain and your OAuth Secret in your application code before using Fresh::Auth. For Ruby on Rails apps, a new file at config/initializers/fresh-auth.rb would be appropriate.
Your configuration file should look like this (you fill in the three empty strings):
Fresh::Auth.configure do |config|
# The part of your login url between 'http://' and '.freshbooks.com'
config.url.subdomain = ""
# Under 'My Account' (on the top right when you're logged into Freshbooks)
# -> 'Freshbooks API' -> 'OAuth Developer Access' -> 'OAuth Secret'
# You'll need to request this from Freshbooks initially.
config.oauth_secret = ""
# Optional. Any string of your choice. Be creative or check out http://www.thebitmill.com/tools/password.html
config.nonce_salt = ""
end
Fear not: If you try to use Fresh::Auth without configuring it first, an exception will be thrown that clearly describes the problem.
### Public API:
There are two modules in this API: Fresh::Auth::Authentication and Fresh::Auth::Api
#### Fresh::Auth::Authentication
This module authenticates you with Freshbooks, storing the authentication in an array called `session`. This integrates seamlessly with Ruby on Rails' controller environment. If you're using some framework other than Ruby on Rails, make sure to define session in your class before including the Authentication module. This isn't recommended because your class will also need to define other objects called `params` and `request` and implement a `redirect_to` method. It gets complicated. Better leav...
Total
Ranking: 128,841 of 183,539
Downloads: 4,417
Daily
Ranking: 24,489 of 183,521
Downloads: 9
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
Rank | Downloads | Name |
---|
Depends on
Rank | Downloads | Name |
---|---|---|
20 | 888,024,621 | nokogiri |
32 | 693,622,033 | builder |
90 | 377,338,760 | rest-client |
Owners
# | Gravatar | Handle |
---|---|---|
1 | IYBetesh |