Solved

vb.net and ldap authentication

Posted on 2014-10-24
4
395 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 12

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 71

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

A hard and fast method for reducing Active Directory Administrators members.
Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

726 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