Windows登录表单 [英] Windows Login Form

查看:107
本文介绍了Windows登录表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我创建一个Windows窗体登录,我已经完成了设计.我想使用Windows身份验证,例如登录我的电脑.我不知道如何启动代码.

Hi,

I create a windows form log in, I''ve finished the design. I want to use the windows authentication like logging on my pc. I don''t know how to start the code.

Appreciate you response and thanks in advance.

推荐答案

您在这里几乎没有提供详细信息,所以我将给您几乎没有详细信息的答案.

我建议您从所需的身份验证机制入手,并了解其工作原理.例如,如果您正在编写Web应用程序,则应查看联合身份和/或OAuth.如果您需要通过linux或类似方式进行身份验证,则应调查Kerberos.如果要通过Active Directory进行身份验证,则应检查该目录和LDAP.

此外,您可能应该考虑应用程序的安全性要求.如果您要使用C#编写要在用户桌面上运行的应用程序,则应该知道该应用程序将以该用户身份运行,并自动继承其活动目录安全性令牌……换句话说,您的应用程序将已经是已登录"作为该用户...继承了该用户的所有权限.那么真的需要以他们自己的身份登录吗?如果应用程序需要在其他用户帐户下运行或需要以提升的权限运行,则可以在线获取许多指南. Windows在这两种情况下都有定义明确的过程,这些过程将为您处理事情,再次使您的应用程序自动继承分配的权限.

在进行表单设计之前,您可能应该已经了解了问题和要求.如果您尚未定义应用程序的实际工作方式,那么Chrome-first是一种糟糕的开发方法.不要重新发明轮子.充分定义您的问题和要求,以了解您想要的轮子,然后继续研究如何使用它.
You have provided almost no details here so I''ll have to give you an answer with almost no details.

I suggest you start with the authentication mechanism you need and understanding how it works. For example, if you are writing a web app, you should look at federated identity and/or OAuth. If you need to authenticate against linux or something like that, you should investigate Kerberos. If you are authenticating against Active Directory then you should look into that and LDAP.

Further, you should probably consider the security requirements of your app. If you are writing an app in C# to run on a user''s desktop, you should know that the app will run as that user and automatically inherit their active directory security token... in other words, your app will already be "logged in" as that user... inheriting all of the rights that user has. So would it really be a requirement to log them in as themselves? If the app needs run under a different user account or needs to run with elevated permissions, there are lots of guides online for doing that. Windows has well-defined processes for both situations that will handle things for you, again causing your app to automatically inherit the assigned rights.

You probably should have understood the problem and the requirements before you did your form design. Chrome-first is a poor development approach when you haven''t defined how your application will actually work. Don''t re-invent the wheel. Define your problem and requirements sufficiently to understand that a wheel is what you want then go about figuring out how to use it.


http://stackoverflow.com/questions/2905407/how-to-use-windows-authentication-in-windows-application [ ^ ]
使用Windows身份验证的C# [ http://www.asp.net/mvc/tutorials/older-versions/security/authenticating-users-with-windows-authentication-cs [
http://stackoverflow.com/questions/2905407/how-to-use-windows-authentication-in-windows-application[^]
C# using windows authentication[^]
http://www.asp.net/mvc/tutorials/older-versions/security/authenticating-users-with-windows-authentication-cs[^]


这篇关于Windows登录表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆