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
Solved

Single sign-on solution for winforms application

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
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 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 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 …

790 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