This is a sample Rails application for demonstrating basic PushAuth multi-factor authentication. See here for some background.
- Log in to website with username, password, and PushAuth-provided multi-factor authentication
- Access control based on login status
- Log out
First, install Ruby and the project dependencies.
# Install project dependencies
bundle install
# Update yarn packages
yarn install --check-files
Then, initialize the database:
$ bundle exec rails db:migrate
Now, create a user:
$ bundle exec rails console
> User.create(:username => "<your_username>", :password => "<your_password>")
> exit
Note that the username should match the username you enter in the corresponding mobile app.
Next, run rails credentials:edit
and enter your UnifyID PushAuth API key in the following format:
unifyid:
server_api_key: <your_key_goes_here>
Finally, fire up the dev server!
$ bundle exec rails server
You're good to go! Swing over to localhost:3000 to see the demo!