easy_oauth

Crystal OAuth headers made simple

easy_oauth

Travis Github search hit counter license

The EasyOAuth shard builds and verifies OAuth headers for use with third party libraries such as Halite. This library is a port of laserlemon/simple_oauth.

Installation

Add this to your application's shard.yml:

dependencies:
  easy_oauth:
    github: watzon/easy_oauth

Usage

require "halite" # or whatever you want
require "easy_oauth"

options = {
  "consumer_key" => "8karQBlMg6gFOwcf8kcoYw",
  "consumer_secret" => "3d0vcHyUiiqADpWxolW8nlDIpSWMlyK7YNgc5Qna2M",
  "token" => "201425800-Sv4sTcgoffmHGkTCue0JnURT8vrm4DiFAkeFNDkh",
  "token_secret" => "T5qa1tF57tfDzKmpM89DHsNuhgOY4NT6DlNLsTFcuQ"
}

url = https://api.twitter.com/1/statuses/update.json
params = {"status" => "hi, again"}
header = EasyOAuth::Header.new(:post, url, params, options)

response = halite.auth(header).post(url, params: params)

Development

  1. Make your changes
  2. Run crystal spec and make sure you didn't break anything
  3. Follow the contributing instructions below
  4. Profit

Contributing

  1. Fork it ( https://github.com/watzon/easy_oauth/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • watzon Chris Watson - creator, maintainer
Repository

easy_oauth

Owner
Statistic
  • 3
  • 0
  • 0
  • 0
  • 3
  • almost 7 years ago
  • February 25, 2018
License

MIT License

Links
Synced at

Sat, 21 Dec 2024 23:15:31 GMT

Languages