Solved

Single sign-on solution for winforms application

Posted on 2008-06-17
3
2,387 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
[X]
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
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

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

691 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