johnmeehan / just_warden

Example of using just Warden to protect a Rails API from the Rack layer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rails & Warden

Using warden to protect a Rails API

A simple example of using just Warden without devise or any other complication for protecting a Rails API.

  • a user can get a token by logging in.
  • the user then sends this token on the out going requests to the server as entry in the header as 'Access-Token'
  • Helper methods for protecting the API controllers and returning the current_user
  • Warden Strategies for checking the tokens.
  • another middleware for attaching the 'Access-Token' to some server responses. (handy if you want to change tokens regularly)

About

Example of using just Warden to protect a Rails API from the Rack layer.


Languages

Language:Ruby 99.4%Language:HTML 0.6%