Devise Token Auth is a Ruby gem that provides token-based authentication for Rails JSON APIs. It solves the problem of securing single-page applications and mobile apps that cannot rely on traditional cookie-based sessions. Rather than using cookies, the gem implements a token refresh mechanism that issues short-lived tokens on each request, expiring them quickly to maintain security. It maintains separate sessions for each client or device, allowing users to have multiple concurrent authenticated sessions.
The tool integrates seamlessly with popular frontend frameworks through dedicated client libraries: ng-token-auth for AngularJS, Angular-Token for Angular, redux-token-auth for React with Redux, jToker for jQuery, vanilla-token-auth for unopinionated implementations, and flutter_token_auth for Flutter. It supports OAuth2 authentication via OmniAuth and email-based authentication through Devise, including user registration, login, logout, password reset, and account confirmation. The gem can handle multiple user models within a single application.
Developers building JSON APIs for SPAs or mobile applications should consider this tool if they need straightforward token authentication without the complexity of managing cookies across different clients. It is particularly suited for projects already using Rails and Devise, as it builds directly on those foundations. The gem's tight integration with OmniAuth makes it a natural choice for applications requiring social login or other OAuth providers.
The project actively solicits contributions and maintains a list of bounty-eligible issues to encourage community involvement. The README directs general help requests to Stack Overflow rather than GitHub issues, indicating an effort to keep the issue tracker focused on bugs and feature requests. Documentation is maintained in a dedicated GitBook, and the project provides a demo application showing the gem in action with Angular.