Project

razoul

0.0
No commit activity in last 3 years
No release in over 3 years
Gem for generate token to Auth
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Razoul

alt tag

Gem for generate token to Auth

Installation

To use this gem add this line in your Gemfile

gem 'razoul'

Configuration

In Rails applications create a razoul.rb in config/initializers

require 'razoul'
Razoul.configure do |config|
   config.login = 'razoul'
   config.password = '123456'
   config.persistence = 'redis'
   config.redis_password  = '1234'
   config.token_key = 'RAZOUL_AUTH_KEY'
   config.prefix_token = 'RAZOUL'
end

Usage

Razoul need one controller to generate and get current token, to do tthis you need create a controller and extend this of Razoul::GeneratorController

class YourController < Razoul::GeneratorController

This controller have two routes

resource :yourcontroller do
get :new, :show
end

To get new token and get current, pass prefix_token(RAZOUL) + login and password in header of request

In controller you need some authentication you need add a before_action :authenticate

class ResourceController < Razoul::Controller
before_action :authenticate, :only [:<controller api action>]

And to use this resource, pass token in token_key(RAZOUL_AUTH_KEY) in header