Paper-Auth

Paper-Auth is a paper based two factor authenctication.

Installation

Add this line to your application's Gemfile:

gem 'paper-auth'

And then execute:

$ bundle

Or install it yourself as:

$ gem install paper-auth

Usage

Initialize

Create a new instance of PaperAuth.

paper = PaperAuth.new()

Currently you do not need to provide any parameters.

Create a PDF

Create a pdf using PaperAuth.

pdf = paper.create(0, "Hello World!")

The first parameter should be something specific to the user (Ex. User ID), and the second parameter should be a secret key that only you know. When called, a pdf will be generated and saved in the current path that you are located in.

Get an ID

You can easily request for an ID using PaperAuth.

id = paper.get()

Currently you do not need to provide any parameters. This will just generate a random ID (Ex. 1A, 10E, etc.) that you can request from the user.

Verifying a Code

You can easily verify a two factor authentication code.

verify = paper.verify(0, "Hello World!", "1A", "1A2B3")

The first two parameters must be the exact same paramenters you used to generate the pdf. The third parameter is the ID that you generated from paper.get(), and the fourth parameter is what the user typed. This method will return true or false.

Contributing

  1. Fork it ( https://github.com/nahtnam/paper-auth/fork )
  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 a new Pull Request