Note that there are some explanatory texts on larger screens.

plurals
  1. POOmniauth-Ldap Ruby Invalid Credentials
    text
    copied!<p>I am student from salzburg.<br> I am trying to create a login possibility via ldap with omnitauth-ldap, when I enter username and password it is redirecting to <code>/auth/failure</code> with <code>message=invalid_credentials</code> and I don't know why. Facebook-, Twitter- and BrowserID-Login is working.</p> <ul> <li>Ruby-Version: 1.9.2</li> <li>Omni-Auth-Version: 1.0.1</li> <li>Omniauth-Ldap-Version: 1.0.2</li> </ul> <h2>omniauth.rb</h2> <pre><code>Rails.application.config.middleware.use OmniAuth::Builder do provider :browser_id provider :facebook, '34234234234', '23423421234123412342134' provider :twitter, 'dfgsdfgsdfg', '2334sadfasdfasdf' provider :ldap, :title =&gt; 'FH-Authentifizierung', :host =&gt; 'denise.core.fh-salzburg.ac.at', :port =&gt; 636, :method =&gt; :plain, :base =&gt; 'o=fh-salzburg.ac.at,o=FHS', :uid =&gt; 'uid', :password =&gt; "password", :try_sasl =&gt; false, :bind_dn =&gt; "anonymous" end </code></pre> <h2>users_controller.rb</h2> <pre><code>class UsersController &lt; ApplicationController def create auth = request.env["omniauth.auth"] user = User.find_by_provider_and_uid(auth["provider"], auth["uid"]) || User.create_with_omniauth(auth) session[:user_id] = user.id redirect_to request.referer, :notice =&gt; "Herzlich Willkommen!" end def destroy session[:user_id] = nil redirect_to request.referer, :notice =&gt; "Du wurdest erfolgreich abgemeldet!" end end </code></pre> <h2>server-output</h2> <pre><code>Started POST "/auth/ldap/callback" for 127.0.0.1 at 2012-01-03 21:59:35 +0100 Started GET "/auth/failure?message=ldap_error" for 127.0.0.1 at 2012-01-03 21:59:35 +0100 Started GET "/auth/failure?message=invalid_credentials" for 127.0.0.1 at 2012-01-03 21:59:35 +0100 Started GET "/auth/failure?message=invalid_credentials" for 127.0.0.1 at 2012-01-03 21:59:35 +0100 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload