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.
Integrates OAuth2 tokens from the Doorkeeper gem into Devise authentication strategies
Devise and Doorkeeper are complimentary gems. Doorkeeper's job is to dispense OAuth2 tokens and Devise's job is to ensure your resources are protected from unauthenticated requests.
The devise-doorkeeper gem allows your existing Devise application to accept OAuth2 tokens created by the Doorkeeper authorization flow.
This means you do not need to update your controllers to use the doorkeeper_authorize!
filter and can use the standard Devise authenticate_user!
methods instead.
Add this line to your application's Gemfile:
gem 'devise-doorkeeper'
Update your config/initializers/doorkeeper.rb
to call
Devise::Doorkeeper.configure_doorkeeper(self)
.
# config/initializers/doorkeeper.rb
Doorkeeper.configure do
Devise::Doorkeeper.configure_doorkeeper(self)
# extra configuration goes below
end
Update your config/initializers/devise.rb
to call
Devise::Doorkeeper.configure_devise
.
# config/initializers/devise.rb
Devise.setup do |config|
Devise::Doorkeeper.configure_devise(config)
# extra configuration goes below
end
:doorkeeper
to your list of devise modules# example app/models/user.rb
class User
devise :doorkeeper
end
# example app/controllers/comments_controller.rb
class CommentsController < ApplicationController
before_action :authenticate_user!
def index
# this action is protected
# the devise-doorkeeper gem will permit access via valid OAuth2 tokens
end
end
Most API's should not create sessions for each API request.
This can be configured via the Devise skip_session_storage
setting.
# config/initializers/devise.rb
config.skip_session_storage = [:http_auth] # this is the default devise config
config.skip_session_storage << :doorkeeper # disable session storage for oauth requests
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that devise-doorkeeper 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.