
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
TagAuth is a Ruby gem designed to integrate tag-based authentication into Rails applications using Devise. This gem is particularly suitable for web applications deployed on kiosks.
TagAuth supports two methods of tag-based authentication:
Direct Input (Ideal for Keyboard-Emulating Readers):
External Reader Endpoint (For Serial Readers):
www.some-web-app.com/tag_auth_tokens?token=received_token
to authenticate the user.Add this line to your application's Gemfile:
gem 'tag_auth'
And then execute:
bundle install
TagAuth provides generators to set up the necessary components for tag-based authentication. Ensure you have Devise installed and configured in your Rails application before proceeding.
TagAuth Generator: Generates a migration to add auth_tag
, authentication_token
, and authentication_token_valid_to
columns to your model, along with necessary indexes.
rails generate tag_auth:tag_auth [MODEL_NAME]
Replace [MODEL_NAME]
with the name of your model (e.g., User
) you wish to authenticate with a tag..
TagAuthenticable Generator: Generates a custom Devise strategy for tag-based authentication. It is used for the direct inputs readers described above.
rails generate tag_auth:tag_authenticable [MODEL_NAME]
Again, replace [MODEL_NAME]
with the model name.
Controller Generator: Generates a controller and initializer to handle tag-based authentication. It is the center point handling the authentication. To integrate with external readers, it uses the simple_token_authentication
gem. It enhances token validation of the gem to include time-based validity checks.
rails generate tag_auth:controller [MODEL_NAME]
Replace [MODEL_NAME]
with the model name. Make sure you call it on the same model each time.
In the scripts
directory, there is an example Powershell script that demonstrates how to connect the reader with the web application.
In the script, replace the example URI with your own. Alternatively, adjust the reader properties to fit your usage.
This script can be inserted into Windows Task that starts running after the user login. To register the task, open the Task scheduler and create a new task.
Set up the trigger for the task ("At user log on" is recommended) and add new Action that will run the Powershell script. In the Program/Script option, insert PowerShell -File "path-to-your-ps-script"
.
Contributions to TagAuth are welcome! Please follow the standard procedures for contributing to open-source projects.
TagAuth is released under MIT License.
FAQs
Unknown package
We found that tag_auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.