Daniel Brito-Mendes wrote:
> 
> 
> 2007/8/3, Alexandru Stanoi <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:
> 
>     Daniel Brito-Mendes wrote:
>      >
>      >
>      > 2007/8/3, Alexandru Stanoi <[EMAIL PROTECTED] <mailto:[EMAIL 
> PROTECTED]>
>     <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>>:
>      >
>      >     Daniel Brito-Mendes wrote:
>      >      >
>      >      >
>      >      > 2007/8/3, Daniel Brito-Mendes
>     <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>      >     <mailto: [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>>
>      >      > <mailto: [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>
>      >     <mailto:[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>>>>:
>      >      >
>      >      >
>      >      >
>      >      >     2007/8/3, Alexandru Stanoi <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>
>     <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>      >     <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
> <mailto:[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>>>>:
>      >      >
>      >      >         Daniel Brito-Mendes wrote:
>      >      >         >  Hi,
>      >      >         >  I want to make an authentification to an Active
>     Directory.
>      >      >         >  As Base i had used the script from the tutorials
>      >      >         >  i have changed this lines
>      >      >         >  $credentials = new
>     ezcAuthenticationPasswordCredentials( '
>      >      >         d.brito-mendes
>      >      >         >  ', 'xxxx' );
>      >      >         >  $ldap = new ezcAuthenticationLdapInfo( '
>     10.10.3.239 <http://10.10.3.239>
>      >     <http://10.10.3.239>
>      >      >         <http://10.10.3.239>
>      >      >         >  < http://10.10.3.239>', 'uid=%id%', 'ou=*,
>      >      >         dc=cruxx,dc=stockfish,dc=de',
>      >      >         >  389 );
>      >      >         >  but I get only: Incorrect username as Message.
>      >      >         >  Whats is going wrong?
>      >      >         >  Anyone can help me?
>      >      >
>      >      >         Hi Daniel,
>      >      >
>      >      >         I noticed there is a space in the username '
>     d.brito-mendes '.
>      >      >         Did you
>      >      >         try to remove the space?
>      >      >
>      >      >         If you get the same error message then I will look
>     into
>      >     the problem.
>      >      >
>      >      >         Cheers,
>      >      >         Alex.
>      >      >
>      >      >         --
>      >      >         Alexandru Stanoi
>      >      >         eZ Components System Developer
>      >      >         eZ Systems | http://ez.no <http://ez.no>
>      >      >
>      >      >
>      >      >     Now I have remove the space, but the problem is the same!
>      >      >
>      >      >
>      >      >     --
>      >      >     cozinha webapplications
>      >      >     Daniel Brito-Mendes
>      >      >     Mobile: +49 (0) 179 488 293 4
>      >      >     [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>>
>      >     <mailto: [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>>>
>      >      >
>      >      >
>      >      > and now had removed the "ou=*" but the problem everything
>     will
>      >     remain
>      >      > unaffected.
>      >
>      >     The problem could be one of:
>      >
>      >     - the username doesn't exist in the LDAP database
>      >
>      >     or
>      >     - the base ('dc=cruxx,dc=stockfish,dc=de') is not correct
>      >
>      >     or
>      >     - the format part ('uid=%id%') is not correct
>      >
>      >
>      >     I don't know exactly what goes wrong on your LDAP server. I
>     need some
>      >     more information before I can see what is happening.
>      >
>      >     Can you try to see if there are any warnings/notices? ( put:
>      >     error_reporting( E_ALL | E_STRICT ); at the top of the
>     script). If
>      >     there
>      >     are no warnings then probably the base is correct, but the
>     username or
>      >     the format part are wrong.
>      >
>      >     Cheers,
>      >     Alex.
>      >
>      >     --
>      >     Alexandru Stanoi
>      >     eZ Components System Developer
>      >     eZ Systems | http://ez.no
>      >
>      >
>      > Now i see that in than in an AD the loginname(d.brito-mendes) is
>     called
>      > sAMAccountName.
>      > Where can I change this parameter?
> 
>     sAMAccountName must be the format, so this should work:
> 
>     $ldap = new ezcAuthenticationLdapInfo( '10.10.3.239
>     <http://10.10.3.239>',
>     'sAMAccountName=%id%', 'dc=cruxx,dc=stockfish,dc=de', 389 );
> 
>     If it's not working, can you send me how an account looks on your LDAP
>     server (the structure and the data for one account)?
> 
>     --
>     Alexandru Stanoi
>     eZ Components System Developer
>     eZ Systems | http://ez.no
> 
> 
> it doesn't work here is the data:
> 
> CN=Daniel Brito-Mendes,OU=ITtest,OU=HSL,OU=Benutzer,OU=Spedition,OU=Neu 
> Ulm,DC=cruxx,DC=stockfish,DC=de
>    
> pwdLastSet: 128251548022393750;
> name: Daniel Brito-Mendes;
> sAMAccountName: d.brito-mendes;
> sAMAccountType: 805306368;

I don't know exactly how an account should be specified on your LDAP 
server. It could be a combination of the different values you mentioned, 
maybe one of:

$ldap = new ezcAuthenticationLdapInfo( '10.10.3.239',
'sAMAccountName=%id%', 'ou=*,dc=cruxx,dc=stockfish,dc=de', 389 );

$ldap = new ezcAuthenticationLdapInfo( '10.10.3.239',
'sAMAccountName=%id%', 'ou=ITtest,dc=cruxx,dc=stockfish,dc=de', 389 );

$ldap = new ezcAuthenticationLdapInfo( '10.10.3.239',
'cn=%id%', 'ou=*,dc=cruxx,dc=stockfish,dc=de', 389 );

$ldap = new ezcAuthenticationLdapInfo( '10.10.3.239',
'cn=%id%', 'ou=ITtest,dc=cruxx,dc=stockfish,dc=de', 389 );


I guess you should know better than me how to specify an account on your 
LDAP server. Maybe http://www.rlmueller.net/Name_Attributes.htm might 
help you to see how to write the base and format strings. It depends on 
the LDAP server how these strings are constructed.

If it still cannot authenticate a user with the correct base and format 
strings, then I will look into the code. A test account on your LDAP 
server might help a lot in this case.

Hope you will succeed in authenticating.

Cheers,
Alex.

-- 
Alexandru Stanoi
eZ Components System Developer
eZ Systems | http://ez.no
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to