Sha256: c618f227822d3b5a3b87b5e629631b26ef3c365b24f6a112fa37461d12bb6665
Contents?: true
Size: 1.42 KB
Versions: 3
Compression:
Stored size: 1.42 KB
Contents
# AuthJwtGo This gem allows you to make identifications for your microservices and create the Jwt if you wish so ## Installation Add this line to your application's Gemfile: ```ruby gem 'jwt' gem 'auth_jwt_go', '~> 1.0.0' ``` And then execute: $ bundle install Or install it yourself as: $ gem install auth_jwt_go ## Usage Once installed run the following commands: 1- It will create a file in the initializer so you can configure the parameters rails g auth_jwt_go:install 2- Create a helper in the spec support to handle authentication tests rails g auth_jwt_go:test_helper 3- In your main controller or base you must add the module include AuthJwtGo Example class ApiController < ActionController::API include AuthJwtGo end 4- You can use two methods for accessing your API before_action :authorized_app before_action :authorized_user Example class ApiController < ActionController::API include AuthJwtGo before_action :authorized_app # Authenticate the client app before_action :authorized_user # Identify the user based on the jwt for login end 5- rspec add in rspec_rails config.include RequestHelpers, type: :controller ## include helper current_user ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/remolacho/auth_jwt_go.
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
auth_jwt_go-1.0.3 | README.md |
auth_jwt_go-1.0.2 | README.md |
auth_jwt_go-1.0.1 | README.md |