omniauth-ldap icon indicating copy to clipboard operation
omniauth-ldap copied to clipboard

invalid credentials when try to login

Open enthusiasmus opened this issue 14 years ago • 0 comments

Hi! I am student from salzburg. I am trying to creat a login possibility via ldap with omnitauth-ldap, when I enter username and password it is redirecting to /auth/failure with message=invalid_credentials and i don't know why. Has somebody a hint for me? Thank you very much! Best regards - Lukas

#### omniauth.rb-file

Rails.application.config.middleware.use OmniAuth::Builder do provider :browser_id provider :facebook, '34234234234', '23423421234123412342134' provider :twitter, 'dfgsdfgsdfg', '2334sadfasdfasdf' provider :ldap, :title => 'FH-Authentifizierung', :host => 'denise.core.fh-salzburg.ac.at', :port => 636, :method => :plain, :base => 'o=fh-salzburg.ac.at,o=FHS', :uid => 'uid', :password => "password", :try_sasl => false, :bind_dn => "anonymous" end

#### users_controller.rb:

class UsersController < 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 => "Herzlich Willkommen!" end

def destroy session[:user_id] = nil redirect_to request.referer, :notice => "Du wurdest erfolgreich abgemeldet!" end end

#### server-output:

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

enthusiasmus avatar Jan 03 '12 21:01 enthusiasmus