Project

brl_auth

0.0
No release in over a year
Módulo de autenticação para API da BRL para projetos em Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.0
~> 0.10
~> 0.14
~> 13.0, >= 10.0.0
~> 3.10
~> 0.21
~> 1.25

Runtime

~> 0.1
~> 1.9, >= 1.0
>= 2.5, < 2.7
 Project Readme

brl_auth_ruby

Módulo de autenticação para API da BRL para projetos em Ruby

Gem Version brl_auth

Dev Requirements

  • Ruby: Any version
  • Bundler

Global Installation

gem install brl_auth

Installation for Rails

# Add to the Gemfile
gem "brl_auth", "~> 0.1.2"

Setting the BRL credentials - Rails Project

Create the config/initializers/brl.rb file and define:

# Set the env variables
BRL.configure do |config|
  config.auth_url_value = "https://xxx.hmra.com.br" # optional; default: https://hom.api.acesso.hmra.com.br
  config.handshake = "XXXXXX-XXXXX-XXXX"
  config.secret_key = "xxxxxxxxx"
end

Retrieving token

require "brl_auth"

BRL::Auth::TokenService.new.retrieve

Result Example

#<BRL::Auth::Token:0x00005606d4e9ae40
  @access_token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
  @created_at=2021-08-30 21:19:21.428047024 UTC,
  @expires_in=86400,
  @refresh_token="xxxxxxxxxxxxxxxxxxxxxx",
  @scope="refresh_token",
  @token_type="Bearer">

Problems?

Please do not directly email any committers with questions or problems. A community is best served when discussions are held in public.

Searching the issues for your problem is also a good idea.

Contributing

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet;
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it;
  • Fork the project;
  • Start a feature/bugfix branch;
  • Commit and push until you are happy with your contribution;
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.;
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

License

Please see LICENSE for licensing details.

Authors

Danilo Carolino, @danilogco / @Quasar-Flash