Neeraj
Neeraj

Reputation: 9155

Ruby on Rails: LDAP user operations

I have used following gems to use LDAP authentication:

gem 'devise'
gem 'devise_ldap_authenticatable'

It is working fine and i am able to login into my web application but i had to create the same user into the local database first to get authenticated in the application.

  1. What i want is a provision using same GEM that would allow me to get login (with email address and password) into application even if my account is not created in the local database. Apparently, my account should be created automatically by the system into local database if it (email address) is not there.

  2. I also want to sync my local user information (first name, last name, password) with the user located at LDAP.

Upvotes: 0

Views: 776

Answers (1)

Sachin Singh
Sachin Singh

Reputation: 7225

read the documentation of the gem(https://github.com/cschiewek/devise_ldap_authenticatable)

add in initializer config/initializers/devise.rb

ldap_create_user (default: false)

If set to true, all valid LDAP users will be allowed to login 
and an appropriate user record will be created. If set to false, you will

have to create the user record before they will be allowed to login.

Upvotes: 2

Related Questions