Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6128007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:34:40+00:00 2026-05-23T16:34:40+00:00

I have a misterious problem with my first omniauth experiment. I can log in

  • 0

I have a misterious problem with my first omniauth experiment. I can log in with my username and password, and I can log out properly. I can repeat it many times, but after I give wrong password once I can never log in again even if I try different user. I get "message"=>"invalid_credentials". Everything is fine again if I restart my application (until I mistype my password).

Before the first failure it connects with the given :bind_dn parameter (see below), as expected:

[14/Jun/2011:17:01:33 +0200] conn=7796 op=0 msgId=1 - BIND dn="cn=nss,o=People,o=IAN,o=AD,o=Secret" method=128 version=3

After the first failure it connects with a BIND dn fabricated from my username:

[14/Jun/2011:16:45:33 +0200] conn=7780 op=22 msgId=23 - BIND dn="edarabos" method=128 version=3, Invalid DN

I followed Railscast #241 http://railscasts.com/episodes/241-simple-omniauth with the following configuration (config/initializers/omniauth.rb):

Rails.application.config.middleware.use OmniAuth::Strategies::LDAP\
  , :host => '127.0.0.1'\
  , :method => :plain\
  , :port => 389\
  , :base => 'o=IAN,o=AD,o=Secret'\
  , :uid => 'uid'\
  , :bind_dn => 'cn=nss,o=People,o=IAN,o=AD,o=Secret'\
  , :password => 'TOPSECRET'

Did I make a mistake? Is it a bug? Thanks in advance!

—
I’m using JRuby 1.5.1, Ruby 1.8.7, Rails 3.0.7, omniauth 0.2.6.

UPDATE

If I redo the configuration (….use OmniAuth::Strategies::LDAP …) after each failure then I can use it to log in successfully. I believed for a second that I am done and then came the new problem. After successful login and logout I cannot log in with different user even if I redo the configuration after successful authentication.

The bind_dn given at the options is a service account. Omniauth binds to the LDAP server with that account and searches with the given credentials (let’s say ‘user1’), it finds the result and binds with the uid of the search result.

At the next login attempt (with user2) the LDAP search is executed without rebinding according to the configuration. This is a braindead thing to do. User1 is not a service account, so the search does not find any results. Then it tries to rebind using the username of the credentials as bind_dn and fails. This is another braindead thing to do because it is configured exactly otherwise!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:34:41+00:00Added an answer on May 23, 2026 at 4:34 pm

    I skipped omniauth, I use ‘net/ldap’ directly. Pros and cons accepted 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a n-tire web application and search often times out after 30 secs. How
Have had to write my first proper multithreaded coded recently, and realised just how
I have couple of questions about the javascript for loop. First question: for (i=0;
I have recently (in the last week) embarked on an experiment wherein I attempt
I've started experimenting with Haskell and have a problem. qqq is a function that
I have a simple, mysterious problem with a label and using ajax to show
I have a strange problem that I think has to do with routes. In
I have a mysterious problem! In the main.c I have the following: #include jogo.h
I have the following problem: I have this multi-level array (nested array) which contains
I have a fairly far-out box model for my portfolio website. It's actually really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.