473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

LDAP path in web.config???

Hi can someone please tell me why I can't put the following LDAP path into
my web.config fill as an <appSetting> and how do I get it to work!

<appSettings>
<add key="strLDAP" value="'LDAP://doamin.domain.com', 'Administrator',
'Password'" />
</appSettings>

The connection string doesn't work when I call it in the code as shown
below...

DirectoryEntry(ConfigurationSettings.AppSettings(" strLDAP"))

But this works fine if I put it straight into the code!
DirectoryEntry("LDAP://" & strADPath, "Administrator", "Password")

I don't get it... It is the same thing????

Could someone please give me some advice!

Thanks

Nov 19 '05 #1
2 8982
No, its not the same thing. Your appSetting contains the single apostraphe,
whereas the one in code doesn't, so your actually passing the start and end
single apostraphies as part of the connection string.

ie. using the config setting, you are passing in this
'LDAP://doamin.domain.com', 'Administrator', 'Password'

instead of this

LDAP://doamin.domain.com

not to mention you have the user and pwd included in the first version.

My suggestion is to split the appSetting into the LDAP part, a user part and
the password part, and concatenate them in code, that way you dont have to
bother including any surrounding apostraphies or anything like that. (Not to
mention also encrypting the username/password so its not in clear text)

--

- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:8C**********************************@microsof t.com...
Hi can someone please tell me why I can't put the following LDAP path into
my web.config fill as an <appSetting> and how do I get it to work!

<appSettings>
<add key="strLDAP" value="'LDAP://doamin.domain.com', 'Administrator',
'Password'" />
</appSettings>

The connection string doesn't work when I call it in the code as shown
below...

DirectoryEntry(ConfigurationSettings.AppSettings(" strLDAP"))

But this works fine if I put it straight into the code!
DirectoryEntry("LDAP://" & strADPath, "Administrator", "Password")

I don't get it... It is the same thing????

Could someone please give me some advice!

Thanks

Nov 19 '05 #2
No, its not the same thing. Your appSetting contains the single apostraphe,
whereas the one in code doesn't, so your actually passing the start and end
single apostraphies as part of the connection string.

ie. using the config setting, you are passing in this
'LDAP://doamin.domain.com', 'Administrator', 'Password'

instead of this

LDAP://doamin.domain.com

not to mention you have the user and pwd included in the first version.

My suggestion is to split the appSetting into the LDAP part, a user part and
the password part, and concatenate them in code, that way you dont have to
bother including any surrounding apostraphies or anything like that. (Not to
mention also encrypting the username/password so its not in clear text)

--

- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:8C**********************************@microsof t.com...
Hi can someone please tell me why I can't put the following LDAP path into
my web.config fill as an <appSetting> and how do I get it to work!

<appSettings>
<add key="strLDAP" value="'LDAP://doamin.domain.com', 'Administrator',
'Password'" />
</appSettings>

The connection string doesn't work when I call it in the code as shown
below...

DirectoryEntry(ConfigurationSettings.AppSettings(" strLDAP"))

But this works fine if I put it straight into the code!
DirectoryEntry("LDAP://" & strADPath, "Administrator", "Password")

I don't get it... It is the same thing????

Could someone please give me some advice!

Thanks

Nov 19 '05 #3

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

Similar topics

7
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...
3
by: John | last post by:
Does anyone know if there is a way to not use the server name in an LDAP path statement, like LDAP://SomeServer/... . We have multiple domain controllers and want the system to get an active domain...
4
by: CodeRazor | last post by:
I need to retrieve a list of groups from Active Directory. Then i need to retrieve a list of users from a group. I'm unfamiliar with Active Directory objects. Can i connect to Active Directory...
2
by: CodeRazor | last post by:
I am trying to create an LDAP connection. I have managed to connect to "LDAP://myServerName" I now want to connect further down the directory tree, to a particular user group. I have tried...
0
by: Grey | last post by:
I have set up domain controller with Windows 2K Server. I want to design a form authentication with this server. I read from some reference code that it is necessary to spcificed the LDAP path in...
0
by: Tim::.. | last post by:
Hi can someone please tell me why I can't put the following LDAP path into my web.config fill as an <appSetting> and how do I get it to work! <appSettings> <add key="strLDAP"...
4
by: Nico Koenig | last post by:
Hi there, I try to make an authorisation bind to the LDAP with ASP.NET. I use the DirectoryServices Namespace and the MSDN documented way to do it, but every time I get an "COMException: Server...
1
by: Rohit Ambani | last post by:
I have created Login.aspx Page On Click of Login Button.I invoke the code as follows ====================================================== Dim adPath As String = "LDAP://172.21.1.19" 'Path to your...
0
by: i_robot73 | last post by:
Trial by fire is the only way I learn. Unfort. I got myself stumped on this part. If I have a web.config w/ the 'base' paramaters I can read them out just fine: ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.