简体   繁体   English

在C#中使用Windows登录的SSO

[英]SSO using Windows Login in C#

I have a Linux-served Web app and a C# Windows client. 我有一个Linux服务的Web应用程序和一个C#Windows客户端。 The web app currently allows AD credentials, which it authenticates. 该Web应用程序当前允许AD凭据进行身份验证。

Not all the users are Windows-based. 并非所有用户都基于Windows。 I'm trying to implement a Single Sign-on solution for Windows users. 我正在尝试为Windows用户实现单点登录解决方案。 I want to allow access to my application if the user has already been validated against AD at Windows log-in. 如果用户已经通过Windows登录针对AD进行了验证,则我希望允许访问我的应用程序。

I know how to validate credentials against AD: 我知道如何针对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. 我知道AD正在使用Kerberos来存储Windows凭据,但是我不知道如何访问票证。

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#. 除了C#,我的问题类似于“如何确定登录的Windows帐户是否已在域上进行身份验证”“在客户端-服务器应用程序中使用Active Directory验证用户 身份”类似。

I am using LightTpd. 我正在使用LightTpd。

Have a look at Providing Active Directory authentication via Kerberos protocol in Apache . 看看Apache中通过Kerberos协议提供Active Directory身份验证 If you're using the WebClient or WebRequest classes in the Windows app make sure that you set the UseDefaultCredentials property to true. 如果在Windows应用程序中使用WebClient或WebRequest类,请确保将UseDefaultCredentials属性设置为true。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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