No commit activity in last 3 years
No release in over 3 years
Apontador Oauth2 is a helper for help requests to Api of Apontador
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.3
>= 0

Runtime

~> 0.8.8
~> 1.8.0
 Project Readme

Build Status Gem Version

ApontadorOauth2

Ruby client for the OAuth 2.0 to site Apontador, still in process of development.

Installation

Add this line to your application's Gemfile:

gem 'apontador_oauth2'

And then execute:

$ bundle

Or install it yourself as:

$ gem install apontador_oauth2

Usage Examples

Get Token with app trusted:

credentials = {
  :client_id => "12345", :client_secret => "54321", 
  :url       => "https://api.apontador.com.br/v2/"
}
client = ApontadorOauth2::Client.new(credentials)

client.token
#=> one-number-token-valid

Get token with user authenticated:

credentials = {
  :client_id    => "12345", :client_secret => "54321",
  :url          => "https://api.apontador.com.br/v2/",
  :username     => "johndoe@example.com",
  :password     => "123456",
  :grant_type   => "password"
}
client = ApontadorOauth2::Client.new(credentials)
client.token
#=> one-number-token-valid-authenticate-be-user

Register new user with token app of trust:

credentials = {
  :client_id => "12345", :client_secret => "54321", 
  :url       => "https://api.apontador.com.br/v2/"
}
client = ApontadorOauth2::Client.new(credentials)
new_user = ApontadorOauth2::User.new({:token => client.token})

user = {:name => "john doe", :email => "johndoe@example.com", :password => "johndoe12345"}
new_user.register_user_in_apontador(user)
#=> nil

##Supported Ruby Versions

This library aims to support and is tested against the following Ruby implementations: Ruby 1.9.2 Ruby 1.9.3 Ruby 2.0.0

Contributing

  1. Fork it
  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 new Pull Request