Solved

Single sign-on solution for winforms application

Posted on 2008-06-17
3
2,321 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

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Last week, our Skyport webinar on “How to secure your Active Directory” (https://www.experts-exchange.com/videos/5810/Webinar-Is-Your-Active-Directory-as-Secure-as-You-Think.html?cid=Gene_Skyport) provided 218 attendees with a step-by-step guide for…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

777 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