部署时的 Active Directory 身份验证方案?

发布于 2024-12-13 14:47:03 字数 369 浏览 0 评论 0原文

我确实有一个应该部署在客户端的 Intranet Web 应用程序,我不知道客户端的用户和角色。现在我可以在本地系统的 vs2008 开发环境中与 Active Directory 进行通信。我能够针对我的开发环境中的特定用户进行身份验证。

我在这里对理解实际部署场景如何与 Active Directory 一起工作感到有点困惑。我确实有使用 sqlserver DB 的经验,其中超级用户可以添加用户然后为他们分配角色。(这就是我的应用程序的工作方式)

但是在实时场景中如何部署后,活动目录身份验证是否有效,因为我没有访问客户端位置来部署 Intranet 应用程序。我完全不知道活动目录中的用户或其角色或组?

是否有一个我可以处理的一般场景,以便我可以实现活动目录场景?

I do have a intranet web application which should be deployed at the client ,i am not aware of the users and roles at the client.Right now i am able to communicate with Active Directory in my development environment in vs2008 in my local system.I am able to authenticate against particular users in my development environment.

I am little confused here in understanding how the actual deployment scenario works with the Active directory.I do have experience with sqlserver DB where super user can add users then assign roles to them.(Thats how my application works)

But in real time scenario how does the active directory authentication works after the deployment as i don't visit the client location to deploy the intranet application.I am completely unaware of the users or their roles or groups in the active directory ?

Is there a general scenario i can work on so that i can implement the active directory scenario ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

她比我温柔 2024-12-20 14:47:03

由于这是一个 Intranet 应用程序,您可能应该使用 Windows 身份验证。
在托管应用程序的 IIS 中,应将 Windows 身份验证设置为启用,并且 IIS 将使用活动目录来对用户进行身份验证。

当您需要验证用户身份时调用此代码

IPrincipal credentials = (IPrincipal)HttpContext.Current.User;
bool isAuthenticated = false;
if (credentials != null)
{
    WindowsIdentity identity = (WindowsIdentity)credentials.Identity;
    isAuthenticated = identity.IsAuthenticated;
}
if (isAuthenticated != null)
{ //do what needs to be done }

,他将看到一个 Windows 登录表单,他可以在其中输入其 Active Directory 控制的帐户凭据。

祝你好运

Seeing as this is an intranet application you should probably use Windows Authentication.
In the IIS hosting the application Windows Authentication should be set to enabled and the IIS will use active directory to authenticate users.

Call this code

IPrincipal credentials = (IPrincipal)HttpContext.Current.User;
bool isAuthenticated = false;
if (credentials != null)
{
    WindowsIdentity identity = (WindowsIdentity)credentials.Identity;
    isAuthenticated = identity.IsAuthenticated;
}
if (isAuthenticated != null)
{ //do what needs to be done }

when you need to authenticate a user and he will be presented with a windows log in form in which he can enter his active directory controlled account credentials.

Good luck

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文