0.0
No commit activity in last 3 years
No release in over 3 years
Simple token authentication strategy for Warden. Not necessarily secure or powerful, this is for simple token-based authentication like what you might need for an API project.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.2
 Project Readme

Warden Token Strategy

Introduction

This is a simple token authentication strategy for Warden. It's not very secure and I wouldn't use it long-term in production, but if you want a simple API-like means of authenticating a user with each request, this is a decent way to do it.

It makes a couple of assumptions on parameter naming and such, but I plan to eventually include configuration capabilities, such that you can create an initiailizer or something and override the parameter names with custom ones.

Setup

Pretty easy if you use bundler:

gem "warden-token"

Or if you use RubyGems:

gem install warden-token

Then require "warden/strategies/token" in your project code (or your Gemfile) and add it to the Warden strategies collection as such:

Warden::Strategies.add(:token, Warden::Strategies::Token)

Now you may authenticate using the strategy name :token, but you can change that part to whatever you'd like.