igagnidz/devise_ott

View on GitHub
README.rdoc

Summary

Maintainability
Test Coverage
# DeviseOtt

{<img src="https://travis-ci.org/igagnidz/devise_ott.png" />}[https://travis-ci.org/igagnidz/devise_ott]
{<img src="https://coveralls.io/repos/igagnidz/devise_ott/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/igagnidz/devise_ott]
{<img src="https://codeclimate.com/github/igagnidz/devise_ott.png" />}[https://codeclimate.com/github/igagnidz/devise_ott]
{<img src="http://badge.fury.io/rb/devise_ott.png" />}[http://badge.fury.io/rb/devise_ott]
{<img src="https://gemnasium.com/igagnidz/devise_ott.png" alt="Dependency Status" />}[https://gemnasium.com/igagnidz/devise_ott]

Adds one time token authentication to devise with sign in count and expiration

## Installation

Add this line to your application's Gemfile:

    gem 'devise_ott'

And then execute:

    $ bundle install

Add :ott_authentication to your model

    devise :ott_authentication

## Usage

Programatically register token for a given user:
    DeviseOtt::Tokens.instance.register('random_token', 'user@email.com', 'requester@email.com', COUNT, EXPIRES_SECONDS)   # COUNT and EXPIRES_SECONDS are integers

Login using One-Time Token:
    include ott_token following parameter in the URL. Example: localhost:3000/?ott_token=random_token