This is a multi-part message in MIME format.

------=_NextPart_000_0014_01C6C12B.FCE63E60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

If I want to authenticate a user against AD from a WinForms app, how do =
I go about it? I want a user to have to re-authenticate after a timeout =
period. I will assume the user is the currently logged on user, but I =
want to prompt for a password and authenticate them against AD. What's =
the best (and secure) way to do this. Thanks.

Jerry
------=_NextPart_000_0014_01C6C12B.FCE63E60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.5346.5" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>If I want to authenticate a user =
against AD from a=20
WinForms app, how do I go about it?&nbsp; I want a user to have to=20
re-authenticate after a timeout period.&nbsp; I will assume the user is =
the=20
currently logged on user, but I want to prompt for a password and =
authenticate=20
them against AD.&nbsp; What's the best (and secure) way to do =
this.&nbsp;=20
Thanks.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jerry</FONT></DIV></BODY></HTML>

------=_NextPart_000_0014_01C6C12B.FCE63E60--

RE: AD Authentication From Windows Forms by v-lliu

v-lliu
Thu Aug 17 00:52:54 CDT 2006

Hi Jerry,

I am sorry that I may not understand your question exactly.

> If I want to authenticate a user against AD from a WinForms app, how do I
go about it?

Could you tell me what you mean by "against AD from a WinForms app"?

> I want a user to have to re-authenticate after a timeout period.

This feature is commonly used in web app, in which case we usually make use
of Session object on Web Server side. If you want to implement this
function in WinForms app, I think you may use Timer component to do it. Set
the Interval property of the Timer and handle its Tick event to require the
user to input a password.

I look forward to your reply.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Re: AD Authentication From Windows Forms by rlrcstr

rlrcstr
Thu Aug 17 10:05:27 CDT 2006

My question is not about how to deal with the timeout. I want to know how,
if given a user name and password, to determine if that is a valid AD user.
This is a WinForms app, not a web app. Thanks.

Jerry



"Linda Liu [MSFT]" <v-lliu@online.microsoft.com> wrote in message
news:vuX7rFcwGHA.5864@TK2MSFTNGXA01.phx.gbl...
> Hi Jerry,
>
> I am sorry that I may not understand your question exactly.
>
>> If I want to authenticate a user against AD from a WinForms app, how do I
> go about it?
>
> Could you tell me what you mean by "against AD from a WinForms app"?
>
>> I want a user to have to re-authenticate after a timeout period.
>
> This feature is commonly used in web app, in which case we usually make
> use
> of Session object on Web Server side. If you want to implement this
> function in WinForms app, I think you may use Timer component to do it.
> Set
> the Interval property of the Timer and handle its Tick event to require
> the
> user to input a password.
>
> I look forward to your reply.
>
>
> Sincerely,
> Linda Liu
> Microsoft Online Community Support
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>



Re: AD Authentication From Windows Forms by Techno_Dex

Techno_Dex
Thu Aug 17 16:35:32 CDT 2006

The two ways I have seen this done so far is you can go down to the WinAPI
in unmannaged code and validate that way or you can try using the
System.Web.Security.Membership class and call the ValidateUser method,
passing in the <username>@<domain> and <password>. As you are using a
WinForms app, I'm not sure if the Web class will work for you but I believe
it will....



<rlrcstr@newsgroups.nospam> wrote in message
news:O54zR6gwGHA.4280@TK2MSFTNGP04.phx.gbl...
> My question is not about how to deal with the timeout. I want to know
> how, if given a user name and password, to determine if that is a valid AD
> user. This is a WinForms app, not a web app. Thanks.
>
> Jerry
>
>
>
> "Linda Liu [MSFT]" <v-lliu@online.microsoft.com> wrote in message
> news:vuX7rFcwGHA.5864@TK2MSFTNGXA01.phx.gbl...
>> Hi Jerry,
>>
>> I am sorry that I may not understand your question exactly.
>>
>>> If I want to authenticate a user against AD from a WinForms app, how do
>>> I
>> go about it?
>>
>> Could you tell me what you mean by "against AD from a WinForms app"?
>>
>>> I want a user to have to re-authenticate after a timeout period.
>>
>> This feature is commonly used in web app, in which case we usually make
>> use
>> of Session object on Web Server side. If you want to implement this
>> function in WinForms app, I think you may use Timer component to do it.
>> Set
>> the Interval property of the Timer and handle its Tick event to require
>> the
>> user to input a password.
>>
>> I look forward to your reply.
>>
>>
>> Sincerely,
>> Linda Liu
>> Microsoft Online Community Support
>>
>> ==================================================
>> Get notification to my posts through email? Please refer to
>> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
>> ications.
>>
>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
>> issues
>> where an initial response from the community or a Microsoft Support
>> Engineer within 1 business day is acceptable. Please note that each
>> follow
>> up response may take approximately 2 business days as the support
>> professional working with you may need further investigation to reach the
>> most efficient resolution. The offering is not appropriate for situations
>> that require urgent, real-time or phone-based interactions or complex
>> project analysis and dump analysis issues. Issues of this nature are best
>> handled working with a dedicated Microsoft Support Engineer by contacting
>> Microsoft Customer Support Services (CSS) at
>> http://msdn.microsoft.com/subscriptions/support/default.aspx.
>> ==================================================
>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>
>



Re: AD Authentication From Windows Forms by BlackWasp

BlackWasp
Thu Aug 17 16:39:18 CDT 2006

There is an article here about it.

http://www.willasrari.com/blog/query-active-directory-users-using-c/000133.aspx

--

BlackWasp
http://www.blackwasp.co.uk/


<rlrcstr@newsgroups.nospam> wrote in message
news:O54zR6gwGHA.4280@TK2MSFTNGP04.phx.gbl...
> My question is not about how to deal with the timeout. I want to know
> how, if given a user name and password, to determine if that is a valid AD
> user. This is a WinForms app, not a web app. Thanks.
>
> Jerry
>
>
>
> "Linda Liu [MSFT]" <v-lliu@online.microsoft.com> wrote in message
> news:vuX7rFcwGHA.5864@TK2MSFTNGXA01.phx.gbl...
>> Hi Jerry,
>>
>> I am sorry that I may not understand your question exactly.
>>
>>> If I want to authenticate a user against AD from a WinForms app, how do
>>> I
>> go about it?
>>
>> Could you tell me what you mean by "against AD from a WinForms app"?
>>
>>> I want a user to have to re-authenticate after a timeout period.
>>
>> This feature is commonly used in web app, in which case we usually make
>> use
>> of Session object on Web Server side. If you want to implement this
>> function in WinForms app, I think you may use Timer component to do it.
>> Set
>> the Interval property of the Timer and handle its Tick event to require
>> the
>> user to input a password.
>>
>> I look forward to your reply.
>>
>>
>> Sincerely,
>> Linda Liu
>> Microsoft Online Community Support
>>
>> ==================================================
>> Get notification to my posts through email? Please refer to
>> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
>> ications.
>>
>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
>> issues
>> where an initial response from the community or a Microsoft Support
>> Engineer within 1 business day is acceptable. Please note that each
>> follow
>> up response may take approximately 2 business days as the support
>> professional working with you may need further investigation to reach the
>> most efficient resolution. The offering is not appropriate for situations
>> that require urgent, real-time or phone-based interactions or complex
>> project analysis and dump analysis issues. Issues of this nature are best
>> handled working with a dedicated Microsoft Support Engineer by contacting
>> Microsoft Customer Support Services (CSS) at
>> http://msdn.microsoft.com/subscriptions/support/default.aspx.
>> ==================================================
>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>
>



Re: AD Authentication From Windows Forms by v-lliu

v-lliu
Fri Aug 18 08:01:40 CDT 2006

Hi Jerry,

You should use the classes in the System.DirectoryServices to
authentication against Active Directory.

The following link is a sample of authentication against AD in ASP.Net, but
I think you could apply the rule of authentication to WinForms application.

http://support.microsoft.com/?id=326340

Hope this helps.
If you have anything unclear, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support


Re: AD Authentication From Windows Forms by v-lliu

v-lliu
Wed Aug 23 06:45:29 CDT 2006

Hi Jerry,

How about your solving the problem?

If the problem is not solved or you need our further help, please feel free
to tell me.

Thank you for using our MSDN Managed Newsgroup Support Service!


Sincerely,
Linda Liu
Microsoft Online Community Support