简体   繁体   中英

SSO using Windows Login in C#

I have a Linux-served Web app and a C# Windows client. The web app currently allows AD credentials, which it authenticates.

Not all the users are Windows-based. I'm trying to implement a Single Sign-on solution for Windows users. I want to allow access to my application if the user has already been validated against AD at Windows log-in.

I know how to validate credentials against AD:

DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain,
                userName, password);

But I won't have the userName or password. I know that Kerberos is being used by AD to store the Windows credentials but I don't know how to access the ticket.

My question is similar to 'How to determine if logged on windows account has been authenticated on domain' or 'Authenticating users using Active Directory in Client-Server Application' except for C#.

I am using LightTpd.

Have a look at Providing Active Directory authentication via Kerberos protocol in Apache . If you're using the WebClient or WebRequest classes in the Windows app make sure that you set the UseDefaultCredentials property to true.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM