Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gonzalo-bulnes/rails-api-authentication-demo

Demonstrate the Simple Token Authentication usage in a Rails::API app.
https://github.com/gonzalo-bulnes/rails-api-authentication-demo

api authentication demo rails

Last synced: 25 days ago
JSON representation

Demonstrate the Simple Token Authentication usage in a Rails::API app.

Awesome Lists containing this project

README

        

Demo: Rails::API Authentication
===============================

Demonstrate the [Simple Token Authentication][sta] usage in a Rails::API app.

[sta]: https://github.com/gonzalo-bulnes/simple_token_authentication

Usage
-----

### Local

```bash
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](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)

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

User Data and Must See
----------------------

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

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

[optionnal_with]: https://rails-api-authentication.herokuapp.com/[email protected]&user_token=1G8_s7P-V-4MGojaKD7a
[optionnal_without]: https://rails-api-authentication.herokuapp.com/
[required_with]: https://rails-api-authentication.herokuapp.com/[email protected]&user_token=1G8_s7P-V-4MGojaKD7a
[required_without]: https://rails-api-authentication.herokuapp.com/restricted_index