使用Windows身份验证为Intranet应用程序的登录凭据 [英] Use Windows authentication as login credentials for intranet applications

查看:151
本文介绍了使用Windows身份验证为Intranet应用程序的登录凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作在PHP的Intranet Web应用程序。我试着去使用Windows NT登录凭据登录到该应用程序。这里有麻烦IM是我如何获得远程用户的Windows用户名?
我想获得的用户名,然后检查对各种LDAP组,这样我可以引导他们到我的应用程序适当的页面。

I'm working on an intranet web application in PHP. Im trying to use Windows NT login credentials to logon to the application. The trouble im having here is how do i get the remote users windows username? I want to obtain the username and then check against various LDAP groups so that I can direct them to appropriate pages in my application.

我到目前为止已经试过

<?php
echo $_SERVER['REMOTE_USER'];
echo $_SERVER['PHP_AUTH_USER'];
?>

它们都返回空值。

Both of them return empty values.

更新:使用$ _ SERVER ['REMOTE_ADDR']林能获得的计算机的IP地址。有反正我能得到用户名/用户名(任何唯一的),并用它来比较LDAP组?我想这样做,当他们进入该网站的主页和存储会话,然后使用整个网站的会话变量。

UPDATE: Using $_SERVER['REMOTE_ADDR'] Im able to get the IP address of the computer. Is there anyway I could get userid/username (anything unique) and use it to compare against LDAP groups? I would want to do this, when they enter the main page of the website and store a session and then use the session variable throughout the website.

推荐答案

不知道如果你还需要这方面的帮助,但最近我已经创建code在我们的网站登录内网用户自动使用Windows身份验证这是使用IIS中运行。当使用Windows身份验证和ISS为了获取登录的用户首先确保您已启用Windows身份验证和匿名禁用。

Not sure if you still need help with this but recently i've had to create code to log intranet users on to our site automatically using windows authentication which is run using IIS. When using windows authentication and ISS in order obtain the logged in user firstly ensure you have windows authentication enabled and anonymous disabled.

$_SERVER['AUTH_USER']; // obtain the LanID of the logged in user.

如果您需要更多的信息让我知道。

If you require more info let me know.

这篇关于使用Windows身份验证为Intranet应用程序的登录凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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