Giter Site home page Giter Site logo

gonzalo-bulnes / rails-5-token-authentication-demo Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 56 KB

Demonstrate the Simple Token Authentication usage in a Rails 5 app.

Ruby 89.00% JavaScript 1.29% CoffeeScript 0.67% CSS 1.12% HTML 7.92%
demo rails authentication api

rails-5-token-authentication-demo's Introduction

Demo: Rails 5 Token Authentication

Build Status Dependency Status Code Climate Inline docs

Demonstrate the Simple Token Authentication usage in a Rails 5 app.

This application aims at demonstrating how token authentication can be implemented and tested and documented in a Rails 5 application.

  1. Implementation: makes use of Simple Token Authentication
  2. Testing and documentation: are performed using RSpec

Usage

Deployment

Local

rackup -p 3000 # see http://localhost:3000

Heroku

Click the button below to automatically set up the demo in an app running on your Heroku account.

Deploy

Alternatively, you can manually create a Heroku app and use Git to push and deploy.

Testing and documentation

The application specification can be read online or generated locally:

# Run the test suite and output the app specification
rake

User Data and Must See

The demo user is called Alice, she doesn't need to authenticate to accede /, however she can do it through token authentication. See the home page with authentication and without authentication.

On the contrary, she must authenticate in ordder to accede to /restricted_index. Of course, she can do it through token authentication. See the restricted home page with authentication and without authentication.

Hooks

Interested in using hooks? Check your server logs for messages of successful token authentication!

Development

Goals

This application is meant to be used as an example (think "Hello, World!") to implement token authentication features. The main goal is then to keep the implmenetation of each feature as simple as possible to make it as easy to follow as possible. Please keep that in mind when enhancing this demo!

Contributions

Only one of the [many possible token authentication scenarios][scenarios] is demonstrated so far. Contributions are welcome!

Credits

Thank you to @johnmosesman for contributing testing documentation to Simple Token Authentication, that was the inspiration of this demo!

License

Demo: Rails 5 Token Authentication
Copyright (C) 2016 Gonzalo Bulnes Guilpain

This application code is placed in the public domain.

rails-5-token-authentication-demo's People

Contributors

gonzalo-bulnes avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

rails-5-token-authentication-demo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.