Solved

Single sign-on solution for winforms application

Posted on 2008-06-17
3
2,280 Views
Last Modified: 2013-12-04
I am trying to build a single sign-on winforms application that will work the following way
- the user logs to windows
- the user tries to launch the application
- the application extracts the user token and authenticates the user using this token by accessing the domain controller/active directory
- if the user logged in localy then he is not authenticated and the application will not launch, if he logged onto the domain then he is authenticated and the application will launch

I have found many examples that use username-password authentication on active directory but didn't find any examples that demostrate how to authenticate a user using kerberos/ntlm security token, I am trying to avoid forcing the user to retype his username and password and I know that this is possible since applications like outlook for example do exactly that (when you open an outlook you are authenticated without entering your credentials)
0
Comment
Question by:Peretsof
3 Comments
 
LVL 13

Accepted Solution

by:
joechina earned 500 total points
ID: 21815189
As long as the user's machine has joined the domian you can do:

WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent();
WindowsPrincipal currentPrincipal = new WindowsPrincipal(currentIdentity);
if (currentPrincipal.IsInRole(@"YourDomain\YourGroup"))
{
 ...
}



Hope it is you are looking for.
0

Join & Write a Comment

Article by: btan
The intent is not to repeat what many has know about Ransomware but more to join its dots of what is it, who are the victims, why it exists, when and how we respond on infection. Lastly, sum up in a glance to share such information with more to help…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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…

744 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

13 Experts available now in Live!

Get 1:1 Help Now