Menu

#20 Unable to bind to LDAP  Edit

Discussion

  • Pierre-Luc MARY

    Pierre-Luc MARY - 2014-10-27

    Good night Raphael

    it is not possible to distinguish differences between users.
    Therefore, when LDAP authentication is selected, all users are authenticated by LDAP.

    Can you give me an example of an LDAP query that works in your environment? I could give you an answer based on this example.

    See you soon.

     
  • Raphael

    Raphael - 2014-10-28

    Hi,

    Here is an example of working command :
    ldapsearch -LLL -H ldap://ad.mydomain.local -b 'dc=mydomain,dc=local' -D 'mydomain\myaccount' -w 'mypassword' -E pr=1000/noprompt (displayName=myaccount)

    Here is the (cropped) output :
    distinguishedName: CN=myaccount,CN=users,DC=mydomain,DC=local
    dn: CN=myaccount,CN=users,DC=mydomain,DC=local

    So I tried to configure SecretManager like that :
    IP address : ad.mydomain.local
    Port : 389 (or 636 I also tried)
    Version : 3 (I tried 2)
    LDAP Organisation : CN=users,DC=mydomain,DC=local
    LDAP RDN prefix : CN

    But I always have user or password incorrect in web interface while testing with the same account as my command line.
    No logs in apache.

    By the way we have 2 servers for our AD it would be great to be able to declare the 2 servers.

    Usually in web interfaces I have to enter these kind of informations to bind to our AD :

    Server address : ldap://ad.mydomain.local:389
    or ldaps://ad.mydomain.local:636
    LDAP Context : dc=mydomain,dc=local
    LDAP Domain : mydomain.local

    I have total control over the server I can test and troubleshoot if needed.
    Thanks for helping !

    Raphaël

     
  • Pierre-Luc MARY

    Pierre-Luc MARY - 2014-10-28

    With your example, I think :

    LDAP Organisation : dc=mydomain,dc=local
    LDAP RDN prefix : cn

    May be try username : mydomain\myaccount

     
  • Pierre-Luc MARY

    Pierre-Luc MARY - 2014-10-30

    It's ok for you ?
    If you know PHP, I can explain you, where I'm manage LDAP in my code.

     
  • Raphael

    Raphael - 2014-10-30

    Hi,

    I can't manage to get it working.
    There must be something wrong but I can't get it.

    Yes can you point me out where the ldap code is, I'll make some tests even if I'm not a PHP dev.

    thanks

    Raphaël

     
  • Pierre-Luc MARY

    Pierre-Luc MARY - 2014-10-30

    The code is located in "Class_IICA_Authentications_PDO.inc.php" at line 175.
    Part extract :

         case 'ldap':
         case 'L':
            include( DIR_LIBRARIES . '/Config_LDAP.inc.php' );
    
            $LDAP_RDN = $_LDAP_RDN_Prefix . '=' . $Login . ',' . $_LDAP_Organization;
    
            // Connexion au serveur LDAP
            $ldap_c = ldap_connect( $_LDAP_Server, $_LDAP_Port );
            if ( $ldap_c === FALSE ) {
                throw new Exception( ldap_error( $ldap_c ), ldap_errno( $ldap_c ) );
            }
    
            if ( ldap_set_option( $ldap_c, LDAP_OPT_PROTOCOL_VERSION,
             $_LDAP_Protocol_Version ) === FALSE ) {
                throw new Exception( ldap_error( $ldap_c ), ldap_errno( $ldap_c ) );
            }
    
            if ( $ldap_c ) {
                // Authentification au serveur LDAP
                $ldap_b = ldap_bind( $ldap_c, $LDAP_RDN, $Authenticator );
    
                // Vérification de l'authentification
                if ( ! $ldap_b ) {
                    throw new Exception( ldap_error( $ldap_c ), ldap_errno( $ldap_c ) );
                }
            }
    
            break;
        }
    

    When you are in the screen "Preferences management > Connection process Management", have you got an error message when you're use "Testing connection" (LDAP Authentification) ?

     
  • Raphael

    Raphael - 2014-11-11

    Bonjour,

    Effectivement quand je teste j'ai un message "Nom d'utilisateur ou mot de passe incorrect" dans la fenêtre de test, en fait quand la config est mauvaise et qu'il ne trouve pas le compte.

    Dans les divers tutoriaux PHP ils conseillent de mettre le domaine comme ceci :

    login : domaine\utilisateur
    Mais cela ne fonctionne pas mieux.

    A force de tester (et de mettre le bind DN le plus complet :

    CN=XXXXXX Raphael,OU=XXXXXXXXXXX,OU=XXX,OU=XX,OU=XXX,DC=domaine,DC=com

    Je finis par avoir un popup avec une erreur AJAX (voir fichier joint)

    Merci

    Raphaël

     
  • Pierre-Luc MARY

    Pierre-Luc MARY - 2014-11-12

    Mais Raphaël, tu parles Français !!!
    Je suis surpris que cela ne fonctionne pas, car j'ai d'autres utilisateurs qui utilisent le LDAP et cela fonctionne pour eux.
    "Invalid credential", fait plus penser à un problème d'identifiant et/ou d'authentifiant mal renseigné. Ecrit moi sur ma boîte courriel pl.mary(a)orasys.fr. Je travaillerai plus directement avec toi sur ton problème.

     
  • Pierre-Luc MARY

    Pierre-Luc MARY - 2015-02-18
    • status: open --> closed
     
  • Pierre-Luc MARY

    Pierre-Luc MARY - 2018-04-28
    • labels: migliori <i>repliche<\/i> orologi patek philippe --> migliori <i>repliche<\/i> orologi patek philippe
    • Description has changed:

    Diff:

    
    
    • status: unread --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB