如何让用户从只有一台机器登录(收购CPU串行)到ASP.NET-MVC Web应用程序 [英] How to enable user log in from the only one machine(by acquiring CPU Serial) to the ASP.NET-MVC web application

查看:209
本文介绍了如何让用户从只有一台机器登录(收购CPU串行)到ASP.NET-MVC Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

方案:

我的网络部署的ASP.NET MVC 5应用程序与个人用户帐户:身份2.x的每个用户都有一个电子邮件和密码登录,通过浏览器的Web应用程序,这意味着用户可以通过与网络浏览器的任何设备登录。

I have web deployed ASP.NET-MVC 5 application with individual user accounts: Identity 2.x. Every user has an e-mail and password to log in the web application via browser, this means that user can log via any device with internet browser.

我想,让他使用完全相同的PC级的机器,他每次在登录的时间条件的用户记录。

I would like to enable user logging on condition that he uses exactly the same PC class machine every time he logs in.

我可以礼貌地询问用户是否需要运行的任何桌面.NET文件(.exe)应用程序。我也可以要求用户使用Chrome浏览器,如果插件要实现这一点。从字面上看,我可以假设任何事情。该解决方案可能是非常不舒服,这很好。

I can politely ask user to run any desktop .NET(.exe) application if necessary. I can also ask user to use Chrome browser if the plugin is necessary to achieve this. Literally I can assume anything. The solution might be very uncomfortable, it's fine.

我半的解决方案:

  1. 通过桌面获取CPU序列号(姑且称之为Authorizer.exe)应用程序,它会发送这个唯一的ID到ASP.NET-MVC Web应用程序,同时登录到它的用户使用某台PC授权。 Authorizer.exe将检测登录到Web应用程序通过嗅探数据包经过的网络。 加 检测用户的位置,这限制了他的移动他的电脑。

  1. Obtain CPU serial number via desktop(let's call it Authorizer.exe) application which will send this unique ID to the ASP.NET-MVC Web Application while logging into it to authorize that user uses certain PC. Authorizer.exe would detect logging into Web Application by sniffing packets going through network. PLUS Detect user's location, which restrains him from moving his computer.

创建桌面应用程序,它可以一次只从Web应用程序提供独一无二的序列被激活。登录到ASP.NET MVC,将有可能仅当台式机应用程序是公开。(我不知道如何做到这一点)。

Create desktop app which can be activated once only with unique serial provided from the web application. Login to the ASP.NET-MVC would be possible only if this desktop app is openned.(I have no idea how to do it).

为什么我问这个问题:

如果别人窃取用户的电子邮件和密码,我不想让小偷能够登录的,但最重要的是我是我不想让用户登录从不同的设备。

If somebody steals user's e-mail and passwords I don't want to let the thief being able to login but the most important to me is that I don't want let user to log in from different devices.

推荐答案

这是我能想到的唯一的解决办法是发行客户端证书,并在应用中使用证书认证。

The only solution that I can think of is to issue client certificates, and use certificate authentication in your application.

要管理需要实现一个PKI,这就需要证书:

To manage certificates you need to implement a PKI, which requires:

  • 获取证书颁发机构,颁发证书需要(也可以是公共CA,也可以使用自签名证书)
  • 在颁发证书的Web服务器,使用CA
  • 配置您的应用程序通过HTTPS工作,并要求证书认证
  • 在颁发证书的用户,并在他们的浏览器安装它们

的薄弱环节是最后一个。你必须支付attentiton你如何安装,以及如何颁发证书。

The weak link is the last. You must pay attentiton to how you install, and how you issue the certificate.

要安装在浏览器中的证书。您可以:

To install the certificate in the browser. You can:

  • 创建一个证书文件,也可以用来在浏览器中导入证书
  • 使用一个PKI基础结构(证书服务器),它允许一个证书来访问一个页与一个浏览器请求,并要求使用相同的浏览器安装在证书中它,一旦它的发出(即它的请求被接受) 。

注:在这两种情况下,你必须接受请求,并颁发证书或拒绝。证书不是自动发出

第一个选项有一个问题:如果你发送证书到您的用户,他就可以将其安装在任何一台机器,任意次数。为了解决这个问题,你需要获得您的用户的机器上,复制文件,安装它,并将其删除。第二个选项解决了这个问题。

The first option has a problem: if you send the certificate to your user he'll be able to install it in any machine, any number of times. To solve this problem you'd need to get access to your user's machine, copy the file, install it, and delete it. The second option solves this problem.

第二个选择是更安全的。但具有良好的知识的用户仍然可以恢复由服务器在这个过程中发出的文件,并在不同的地方安装证书。

The second option is safer. But a user with good knowledge can still recover the file issued by the server in this process, and install the certificate in a different place.

考虑还有很重要的一点是,当你颁发证书通常存在一个选项,允许使其私钥可导出。如果设置了此选项,用户可以从安装它的浏览器输出的PK,并安装到其他地方。显然,要避免这种情况。因此,禁用此选项。

Another very important point to take into account is that, when you issue a certificate there is generally an option that allows to make its private key exportable. If you set this option, the user can export the PK from the browser where it is installed, and install it somewhere else. Obviously you want to avoid this. So, disable this option.

通过该选项,用户仍可以导出证书,但是如果没有它的私钥,因此它不能被其他地方安装。

With this option, the user can still export the certificate, but without its private key, so it can't be installed somewhere else.

我不给上如何设置的PKI的其他详细信息,因为它在很大程度上取决于基础设施(OS和版本)。如果您想了解更多有关证书和PKI的维基百科为X.509作品对于PKI 和维基百科条目。然后,你可以看看其他信息在特定的基础设施(OS)设置一个PKI。

I don't give additional details on how to setup the PKI, because it depends largely on the infrastructure (OS and version). If you want to know more about certificates and PKI the wikipedia entry for "X.509" and wikipedia entry for PKI. Then you can look for additional information on setting a PKI in your particular infrastructure (OS).

您可以放心这个系统是真正安全的。比如,在我的国家,你可以找出自己通过这种方式,使很多官方的东西,比如申报和缴纳税款

You can rest assure this system is really safe: for example, in my country you can identify yourself by this means to make a lot of "official" things, like declaring and paying taxes.

和,如果你想知道,如果你要拒绝访问已经拥有证书的用户会发生什么。答案是,只要你想,你可以吊销证书,以便服务器将不允许用户和他的证书来验证,因为它的撤销。

And, if you're wondering what happens if you want to reject access to a user that already has a certificate. The answer is that you can revoke a certificate whenever you want, so that the server won't allow your user to authenticate with his certificate, because it's revoked.

这可以让你担心的另一件事是,其他用户需要在同一台机器并记录你的应用程序。这是很难thanit看起来像这样的原因:

And another thing that can worry you is that other user takes the same machine and logs to your application. It's harder thanit looks like for this reasons:

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