# gonzalo-bulnes/simple_token_authentication

Simple (and safe*) token authentication for Rails apps or API with Devise.

Repository: https://github.com/gonzalo-bulnes/simple_token_authentication
Canonical: https://ross.abutalabs.com/products/simple_token_authentication
Language: Ruby
License: GPL-3.0
License Family: copyleft
Topics: ruby, devise, authentication, rails, mongoid, api
Last push: 2024-12-03T23:55:12+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4644, "days_push": 638, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1504, forks 233 (observed 2026-08-28T04:04:54.703256+00:00)

## What it is
A Ruby gem that adds simple token authentication to Rails applications or APIs using Devise. It packages José Valim's recommended safe token authentication approach, providing token generation, revocation, and comparison with configurable options.

## Use cases
- add token authentication to a Rails API with Devise
- implement single-use sign-in links sent by email
- generate and revoke authentication tokens for users
- securely compare authentication tokens in Rails
- replace the token authentication removed from Devise
- authenticate mobile or API clients against a Rails backend

## When to choose
- you already use Devise in a Rails app and need token-based authentication
- you understand replay attacks and can mitigate them in your protocol
- you need single-use sign-in tokens such as email magic links
- you want a minimal, flexible token mechanism rather than a full JWT solution

## When to avoid
- you need protection against replay attacks out of the box
- you want a complete, audited authentication protocol without designing it yourself
- you need JWT or OAuth2-style token flows
- your threat model requires independently audited security

## Facets
- artifact type: library
- maturity: maintenance
- function: auth
- domain: security, web-development, apis
- platform: ruby
- tags: devise, rails, token-authentication, mongoid, api-authentication, gem

## Member repositories
- gonzalo-bulnes/simple_token_authentication (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:54.703256+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:32:45.660276+00:00, confidence not recorded.
  - readme: https://github.com/gonzalo-bulnes/simple_token_authentication (fetched 2026-08-28T04:04:54.703256+00:00, sha a5057a8a6341)
- Data as of 2026-08-30T08:39:29.467469+00:00.
