473,396 Members | 1,764 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.

Urgent- Authentication with Active Directory

MJ
Hi,
I'm trying to authenticate a user by creating a
DirectoryEntry using the contructor with signature

Dim objEntry = New DirectoryEntry(path, username, pwd).

and then i check for

If Not objEntry is Nothing then ... to continue processing

When a correct username/pwd is passed, everything works
fine. The problem is when an Invalid Username/pwd is
supplied.

objEntry is returned as an object so well it's
not 'Nothing'. Trying to access the underlying
NativeObject results in an exception. There are private
properties(Bound) and methods (adsobject) which could be
of help but since they are private, they cannot be
accessed. Could somebody please help me with how I could
check if the DirectoryEntry object returned is truly
bound and valid?

Thanks,
MJ
Nov 20 '05 #1
2 1120
Why don't you just try catch around it? If it's valid, then it won't throw
an exception, if it's invalid then it will and you can deal with it in the
catch block.

Josh Moody
VSU Team

--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
Content-Class: urn:content-classes:message
From: "MJ" <an*******@discussions.microsoft.com>
Sender: "MJ" <an*******@discussions.microsoft.com>
Subject: Urgent- Authentication with Active Directory
Date: Fri, 9 Jan 2004 12:19:01 -0800
Lines: 25
Message-ID: <03****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcPW7dHJA0xlfVtnT92p3+U1IJstjw==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:171614
NNTP-Posting-Host: tk2msftngxa09.phx.gbl 10.40.1.161
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi,
I'm trying to authenticate a user by creating a
DirectoryEntry using the contructor with signature

Dim objEntry = New DirectoryEntry(path, username, pwd).

and then i check for

If Not objEntry is Nothing then ... to continue processing

When a correct username/pwd is passed, everything works
fine. The problem is when an Invalid Username/pwd is
supplied.

objEntry is returned as an object so well it's
not 'Nothing'. Trying to access the underlying
NativeObject results in an exception. There are private
properties(Bound) and methods (adsobject) which could be
of help but since they are private, they cannot be
accessed. Could somebody please help me with how I could
check if the DirectoryEntry object returned is truly
bound and valid?

Thanks,
MJ


Nov 20 '05 #2
MJ
Thanks for the response. Yes, that's what I'm doing right
now but still think that this isn't the most elegant way
to deal with it.
I'm not sure how expensive it is to raise exceptions
everytime it reads as invalid though but will try and get
more info on it. For now, I guess I don't have much of a
choice.

Lakshmi

-----Original Message-----
Why don't you just try catch around it? If it's valid, then it won't throwan exception, if it's invalid then it will and you can deal with it in thecatch block.

Josh Moody
VSU Team


Nov 20 '05 #3

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

Similar topics

3
by: Rob | last post by:
I have a form - when you click the submit button, it appends a variable to the URL (e.g. xyz.cgi?inputID=some_dynamic_variable) It also opens a new page. Now, that some_dynamic_variable is...
9
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
28
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
7
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn"...
33
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
8
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written...
1
by: alok sengar | last post by:
hi, I have already tried this URL's code "http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm" but I am getting error when i am creating a UDP type Socket and recieving packet from this...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
7
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...
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.