简体   繁体   English

C#MVC身份-验证“信息亭用户”

[英]C# MVC Identity - Authenticating a “Kiosk User”

I've got a C# MVC application using Identity. 我有一个使用Identity的C#MVC应用程序。 I'm trying to find a solution to authenticate a Kiosk User: 我正在尝试找到一种验证信息亭用户的解决方案:

  • normal users login using their credentials; 普通用户使用其凭据登录; be it local, FB, Google etc, from their home computer, phone or whatever 无论是本地,FB,Google等,都可以通过家用计算机,电话或其他方式访问
  • a particular computer however needs to be always logged in - even after the web server/application rebooted, the kiosk computer restarted etc. (well, at least after the server/kiosk computer is back and the kiosk computer returns to the application website, the computer needs to be logged in as that kiosk user again) 但是,一台特定的计算机始终需要登录-即使在重新启动Web服务器/应用程序,自助服务终端计算机之后等。(嗯,至少在服务器/自助服务终端计算机返回并且自助服务终端计算机返回到应用程序网站之后,需要再次以该信息亭用户身份登录计算机)

My simplest idea was to create a user role Kiosk that would be disallowed from logging out; 我最简单的想法是创建一个用户角色信息亭,该用户亭不能注销; however that doesn't solve the login problem unless I "remember" the kiosk user by a crazy-long-expiry-date cookie. 但是,除非我通过疯狂的长有效期Cookie“记住”信息亭用户,否则无法解决登录问题。

It also doesn't necessarily stop anyone from simply deleting the cookie (although I could live with that, the kiosk computer is in a monitored environment). 它还不一定阻止任何人简单地删除cookie(尽管我可以忍受,但自助服务终端计算机处于受监视的环境中)。

Identification by IP is not possible. 无法通过IP进行识别。

I'm looking for ideas on how I might be able to accomplish this. 我正在寻找有关如何实现此目标的想法。 What pieces of software, or a certificate, or something could I install on that computer that'd allow me to check it is that one in my application? 我可以在该计算机上安装哪些软件或证书,或可以安装哪些软件,以检查其是否属于我的应用程序?

Thanks for any suggestion that you might have. 感谢您提出的任何建议。

This is commonly done with a persistent cookie as you describe, in the case of a web app. 对于Web应用程序,通常使用您描述的持久性cookie来完成。 You could set the login cookie expiration to some long term date such as 1 year, 5 years or whatever makes sense. 您可以将登录cookie的过期时间设置为某个长期日期,例如1年,5年或任何有意义的日期。 You can do this based on a role the user is a member of, user name, or some other identifier. 您可以根据用户所属的角色,用户名或其他标识符来执行此操作。 I have done this before and I usually add a new option of some kind to hide the logout button/menu option. 我之前已经做过这件事,通常会添加某种新选项来隐藏注销按钮/菜单选项。

Other options would be: 其他选项是:

  • Client Certificate based authentication with IIS 使用IIS的基于客户端证书的身份验证
  • Window Authentication if the machine is an AD member. 窗口身份验证(如果计算机是AD成员)。
  • Special URL that is kiosk specific that signs the user in from a link/bookmark/button/whatever (this might just be a variation of the long term cookie option bypassing the password login) 信息亭特有的特殊URL,可通过链接/书签/按钮/以任何方式(使用户登录)(这可能是长期cookie选项的一种变体,绕过了密码登录)

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

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