Solved

vb.net and ldap authentication

Posted on 2014-10-24
4
312 Views
Last Modified: 2014-10-25
I currently have a program that queries ldap.  I need to be able to change it over to multiple domains.  I use the below for authentication.  How can i default the username and password to be the current logged in credentials cache?

Dim de As New DirectoryEntry("LDAP://bkng.net:389/DC=bkng,DC=net")
            de.Username = "johndoe"
            de.Password = "password"

Open in new window


How do i use CredentialCache.DefaultCredentials???
0
Comment
Question by:derek7467
4 Comments
 
LVL 11

Expert Comment

by:Ganesh Kumar A
ID: 40403534
Probably this microsoft article helps you to use AD authentication in vb.net.

http://support.microsoft.com/kb/326340 

or

Read this will help with your question : http://support.microsoft.com/kb/813834

Reference :
Here is the actual credentialcache.defaultcredentails usage from MSDN library :
http://msdn.microsoft.com/en-us/library/system.net.credentialcache.defaultcredentials(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
0
 
LVL 70

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 40403652
If you wish to use current credentials simply don't bother supplying credentials at all (it will default to binding with the current users credentials).

i.e.
Dim de as New DirectoryEntry("LDAP://bkng")

Open in new window

Or, better still, use serverless binding:
Dim de as New DirectoryEntry()

Open in new window

Chris
0
 

Author Closing Comment

by:derek7467
ID: 40404190
didn't realize I was doing this now and could just addin another form for secondary login information if  needed.  Thanks!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Creating and Connection two new domains 5 77
Allow User To Arrange Columns At Datagridview 3 19
Ajax Panel Not Updating When Triggered By Timer 4 40
MDM vs GPO 16 31
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now