让窗户用JavaScript用户名 [英] getting windows username with javascript

查看:85
本文介绍了让窗户用JavaScript用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我这是建立在ASP.net和C#的网站。让我们的web应用调用它。它使用一个表格系统登录到它,并且不能easliy改变。

I have a site which is built in ASP.net and C#. Let's call it webapp. it uses a Form system to log on into it, and cannot be changed easliy.

我更改日志中的某种Windows身份验证的请求。我会解释。
我们的Windows登录使用Active Directory用户登录到自己的Windows帐户。他们的登录名是sXXXXXXX。 X的数字。
在我的web应用程序,我想从他们的Active Directory登录区分用户数量,并检查那些在Web应用程序数据库中。如果存在的话,它们就会自动登录。如果没有,他们将被称为为webapp的系统,这是目前使用的常规登录页。

I got a request to change the log in to some kind of windows authentication. I'll explain. Our windows login uses active directory for users to log into their windows account. their login name is sXXXXXXX. X are numbers. in my webapp, I want to take the users numbers from their active directory login, and check if those exist in the webapp database. if it exists, they will automatically log in. If it doesn't, they will be referred to the regular login page for the webapp system which is currently in use.

我试图改变我的IIS禁止匿名登录并启用Windows身份验证,从而使用户浏览器发送它的当前登录的用户名,以我的web应用。我从形式为Windows,这使我整个Web应用程序过时,因为整个表单系统没有工作,改变web配置为好。

I tried changing my IIS to disable anonymous login and enabling windows authentication, therefore making the user browser to send it's current logged in user name to my webapp. I changed the web config as well from "Forms" to "Windows", which made my whole webapp obsolete as the whole forms system did not work.

我的问题是 - 有一个不同的方式为浏览器只对用户名发送到我的web应用程序?我想,也许JavaScript的,我只是不知道如何实现,如果它甚至有可能。我知道这是不是很安全,但所有这些平台和系统是建立在互联网之外,这是一个专用网络上。

My question is this - is there a different way for the browser only to send the username to my webapp? I thought maybe javascript, I just don't know how to implement that, if it's even possible. I know it's not very secure, but all this platform and system is built outside the internet, it's on a private network.

推荐答案

我发现越来越发送到服务器的用户名的解决方案是:

The solution I found for getting the username sent to the server was:

string winlogon = Request.ServerVariables["LOGON_USER"];

启用Windows身份验证模式在IIS之后

After enabled Windows Authentication Mode in IIS.

这篇关于让窗户用JavaScript用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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