Socket
Book a DemoInstallSign in
Socket

devise-remote-user

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devise-remote-user

1.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

devise-remote-user

A devise extension for remote user authentication.

Gem Version Build Status Coverage Status Code Climate

Installation

Add to Gemfile:

gem 'devise-remote-user'

Then

bundle install

Sorry, there are no generators yet, so ...

  • Add :remote_user_authenticatable symbol to devise statement in User model, before other authentication strategies (e.g., :database_authenticatable).
  • Add before_filter :authenticate_user! to ApplicationController, if not already present. This ensures that remote user is logged in locally (via database)

Configuration options:

  • env_key - String (default: 'REMOTE_USER'). Request environment key for the remote user id.
  • attribute_map - Hash (default: {}). Map of User model attributes to request environment keys for updating the local user when auto-creation is enabled.
  • auto_create - Boolean (default: false). Whether to auto-create a local user from the remote user attributes. Note: Also requires adding the Warden callbacks as shown below.
  • auto_update - Boolean (default: false). Whether to auto-update authenticated user attributes from remote user attributes.
  • logout_url - String (default: '/'). For redirecting to a remote user logout URL after signing out of the Rails application. Include DeviseRemoteUser::ControllerBehavior in your application controller to enable (by overriding Devise's after_sign_out_path_for).

Set options in a Rails initializer (e.g., config/intializers/devise.rb):

require 'devise_remote_user'

DeviseRemoteUser.configure do |config|
  config.env_key = 'REMOTE_USER'
  config.auto_create = true
  config.auto_update = true
  config.attribute_map = {email: 'mail'}
  config.logout_url = "http://my.host/path.to.remote.logout"
end

Tests

rake ci runs the test suite.

FAQs

Package last updated on 08 Dec 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.