473,545 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Querying Solaris LDAP server

RJN
Hi

I've written a code that queries Windows LDAP server and works fine, but
the same doesn't work when querying Solaris LDAP server.

DirectoryEntry de = new DirectoryEntry( "LDAP://server.com");
DirectorySearch er ds = new DirectorySearch er(de);
de.Username = "xxx";
de.Password = "yyy";
de.Authenticati onType = AuthenticationT ypes.Secure;
ds.Filter = ("(SAMAccountNa me=xxx)");
SearchResult sr = ds.FindOne();

Without setting the login credentials I get error that "Server is not
operational". if I set the logon details, I'm getting an error that
"Logon failure, unknown user name or bad password".

Can anyone give me sample code to query Solaris LDAP server?

Regards

Rjn

*** Sent via Developersdex http://www.developersdex.com ***
Dec 26 '06 #1
3 4021
"RJN" <rj*@yahoo.comw rote in message news:el******** ******@TK2MSFTN GP02.phx.gbl...
Hi

I've written a code that queries Windows LDAP server and works fine, but
the same doesn't work when querying Solaris LDAP server.

DirectoryEntry de = new DirectoryEntry( "LDAP://server.com");
DirectorySearch er ds = new DirectorySearch er(de);
de.Username = "xxx";
de.Password = "yyy";
de.Authenticati onType = AuthenticationT ypes.Secure;
ds.Filter = ("(SAMAccountNa me=xxx)");
SearchResult sr = ds.FindOne();

Without setting the login credentials I get error that "Server is not
operational". if I set the logon details, I'm getting an error that
"Logon failure, unknown user name or bad password".

Can anyone give me sample code to query Solaris LDAP server?

Regards

Rjn

*** Sent via Developersdex http://www.developersdex.com ***

Don't use the DirectoryEntry class to start with, use the LDAP wrapper class namespace
System.Director yServices.Proto cols instead.

A few warning though, Solaris isn't Windows, so you won't find a property named
"sAMAccountName ", what exactly are you trying to achieve?
Note that you won't be able to use Secure credentials if the LDAP server doesn't integrate
with other authentication providers on Solaris, use the LdapConnection and start with a
simple bind, when this works, you can try other more secure authentication types.

Here's a sample snip....

using System;
using System.Director yServices.Proto cols;
using System.Net;
....
// :389 is optional, it's the default listener port! Make sure the Ldap server
listens on this port, else you have to set the port accordingly

using (LdapConnection ldap = new LdapConnection( "server.com:389 ")) {
ldap.AuthType = AuthType.Basic;
ldap.Bind(new NetworkCredenti al("userName", "usersPwd") );
...
}

Willy.

Dec 26 '06 #2
RJN
Dear Willy

Thanks for the reply. I'm trying to get the user details of logged user
from the login id. I'm having a .Net webservice which is set with
Integrated windows authentication and no anonymous access allowed. I
could get the user's login from Context.User.Id entity.Name. I would want
to query the LDAP server based on this.

I read in the LDAP documentation that SAMAccountName is generic and not
windows specific. So I thought I could query any LDAP server based on
this. My problem currently is authenticating the Solaris LDAP server
which I don't face when I query the windows domain controller. Is there
anything wrong in the way I query the LDAP server?

Once I establish the authentication as per your code, how do I continue
querying the LDAP server? Would you mind giving me the code for that?

Regards

Rajesh

*** Sent via Developersdex http://www.developersdex.com ***
Dec 27 '06 #3
"RJN" <rj*@yahoo.comw rote in message news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
Dear Willy

Thanks for the reply. I'm trying to get the user details of logged user
from the login id. I'm having a .Net webservice which is set with
Integrated windows authentication and no anonymous access allowed. I
could get the user's login from Context.User.Id entity.Name. I would want
to query the LDAP server based on this.

I read in the LDAP documentation that SAMAccountName is generic and not
windows specific. So I thought I could query any LDAP server based on
this. My problem currently is authenticating the Solaris LDAP server
which I don't face when I query the windows domain controller. Is there
anything wrong in the way I query the LDAP server?

Once I establish the authentication as per your code, how do I continue
querying the LDAP server? Would you mind giving me the code for that?

Regards

Rajesh

*** Sent via Developersdex http://www.developersdex.com ***

CN=SAM-Account-Name or sAMAccountName is a property used by Windows only, it stores the
Logon name of down-level clients running on LanManager, Windows9X and NT4, It's no property
stored on Solaris LDAP servers. Try to bind to the LDAP server using adsiedit from a Windows
client, and query the Solaris LDAP server, you'll see there is no such attribute for the
user object. But there is more, you are trying to authenticate a windows client on an
Solaris LDAP server, this won't work by all means, Windows clients can only be authenticated
by Windows Domain Controllers (for Windows Domain accounts) or Local Account Managers (for
server local accounts). All you can do is retrieve the clients credentials and use basic
authentication through a bind to the LDAP server.

Willy.

Dec 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6878
by: Andres Rosado-Sepulveda | last post by:
Hello, I'm having trouble compiling PHP 4.3.4 on Solaris 8. This is the error message it is showing: -- start -- Undefined first referenced symbol in file php_parse_date ext/standard/datetime.o ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
0
6169
by: Mike | last post by:
I'm using ASP and CDO to lookup free busy time on an e2k server. The E2K is locally installed on the IIS server and I'm having no problems accessing resources like public folders, mailboxes, etc. When I check Free Busy you have to access the Active Directory with LDAP. The Domain Controller is on another server. I am getting error 80005000...
2
15181
by: James Allan | last post by:
Hello -- I'm trying to get SQL Server 2000 on a Windows 2000 Server to be able to query an Active Directory. We've got two domain servers one Win2000 and one Win2003. However, I'm having problems: I've run the following query to setup the linked server: sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces', 'ADSDSOObject',...
7
6784
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. i do not need to bind with a username or credentials. What i am trying to do is, i am trying to look up all the information for the user with user id 'testuser'. The following is the Vb.net code...
1
4735
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem I have run into I am not sure how to fix, and really not sure what is causing it. Here's what is going on (test server - Windows 2003 Server): I...
5
2175
by: Melissa Evans | last post by:
Hi. I'm new to Python. :) I've modified grappy.py, http://www.stacken.kth.se/~mattiasa/projects/grappy/, a postfix policy daemon for greylisting. to use LDAP as a backend instead of SQL (with python-ldap.) The daemon runs fine when testing but when I put it under load it core dumps quickly. What little analysis I know how to do shows...
4
3678
by: inetquestion | last post by:
php has been configured with the following two configure lines and core's during "make install" on the PEAR section. Is there something simple i'm missing? Any help would be appreciated. Environment: Solaris 9 php 5.2.1 GNU Make 3.81 gcc 4.1.1
4
5243
by: jllg2000 | last post by:
I got this query: CREATE VIEW viewADContacts AS SELECT , SN , ST State FROM OPENQUERY( ADSI2, 'SELECT Name, SN, ST FROM ''LDAP://presidencia.local/CN=Users, DC=domainname,DC=local''') GO
4
1519
by: =?Utf-8?B?U3VoYXMgVmVuZ2lsYXQ=?= | last post by:
Hello, I am facing an issue while querying Active directory using C# code with system.DirectoryServices namespace. Here is the path for my LDAP - "LDAP://CN=XY - C++/Unix and other, OU=Automatic,OU=DLs,DC=domain,DC=com"; I have replaced the / character with\/- but still is giving error while querying. Please help me to resolve this.
0
7465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7805
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1878
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.