Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Devise-Imapable is a imap based authentication strategy for the Devise authentication framework.
If you are building applications for use within your organisation which require authentication and don't have access to a LDAP server, using imap can be a great alternative.
Please note that Devise-Imapable only works with Devise 1.0.5 at the moment, changes for 1.0.6 will be made soon
Currently this can only be installed as a plugin.
script/plugin install git@github.com:joshk/devise_imapable.git
Now in gem form, install notes coming soon
And don't forget to add Devise!
either in config/environment.rb:
config.gem 'devise'
or in bundler
gem 'devise'
Once devise-imapable is installed, all you need to do is setup the user model which includes a small addition to the model itself and to the schema.
First the schema :
create_table :users do |t|
t.imapable
end
and indexes (optional) :
add_index :users, :email, :unique => true
and don’t forget to migrate :
rake db:migrate.
then finally the model :
class User < ActiveRecord::Base
devise :rememberable, :trackable, :timeoutable, :imapable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :remember_me
...
end
I recommend using :rememberable, :trackable, :timeoutable along with :imapable as it gives a full feature set for logins.
Devise-Imapable works in replacement of Authenticatable, allowing for user name (or email) and password authentication. The standard sign_in routes and views work out of the box as these are just reused from devise. I recommend you run :
script/generate devise_views
so you can customize your login pages.
please note
This devise plugin has not been tested with Authenticatable enabled at the same time. This is meant as a drop in replacement for Authenticatable allowing for a semi single sign on approach.
In initializer config/initializers/devise.rb
:
Devise.setup do |config|
# ...
config.imap_server = 'bigcorporation.com'
config.default_email_suffix = 'friendly-corporation.com'
# ...
end
Imap servers usually allow a user to login using their full email address or just the identifier part, eg: josh.kalderimis and josh.kalderimis@gmail.com will both work. It is recommend that you set the default_email_suffix so the login is kept consistent and the users email is correctly stored in the User model.
don't use Authenticatable
add imap_server and default_email_suffix settings in the devise initializer
generate the devise views and make them pretty
add notes about gem
email validation
add update_with_password to the model, similar to Authenticatable
assert Authenticatable is not being used
assert imap_server is present, and warn if default_email_suffix isn't present
tests, tests, tests
allow for setups which require profile information before creating a user
investigate how well this works with other devise modules like http_authenticatable, token_authenticatable lockable, confirmable, and activatable
Released under the MIT license
Copyright (c) 2010 Josh Kalderimis,
FAQs
Unknown package
We found that devise_imapable 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.