3

我正在开发一个 Perl Dancer Web 应用程序,它需要在身份验证方面完成两件事:

  1. 基于 Active Directory 对用户进行身份验证以访问应用程序
  2. 以用户身份进行身份验证以访问几个 .NET Web 服务。

该应用程序由 Apache 在 Linux 机器上作为 CGI 应用程序托管,我对 Apache 的配置没有太多控制权。

以下是当前工作应用程序的工作流程:

  1. 向用户显示登录页面
  2. 当用户提交表单时,使用Authen::Simple::ActiveDirectory验证帐户是否有效
  3. 使用Dancer::Session::Cookie存储用户的凭据(加密的 cookie)
  4. 向用户显示搜索表单
  5. 当用户提交此表单时,使用Authen::NTLMSOAP::Lite访问 .NET 服务(类似于此处的示例)以执行搜索
  6. 向用户显示结果

这里的用户凭据处理与我有关,但我通常对 Web 应用程序和身份验证不熟悉。对于小型内部应用程序,这样可以吗?如果没有,你建议我如何改进这个过程?就像我说的,上面概述的应用程序有效,但我觉得它可以/应该改进。

4

2 回答 2

1

One (part of a) solution could be that you let your apache webserver handle the authentication. You could use Kerberos for this. So only permitted users can access your application. In that case $ENV{REMOTE_USER} contains the username (e.g. foo.bar@MY.DOMAIN.COM).

If you need more information about the current user you can query your LDAP (containd in your Domain). I use a common (LDAP) user to get more information about the current user foo.bar@MY.DOMAIN.COM.

I know that this is only the fist part. I do not have experience useing/passing Kerberos tickets by SOAP. But if you mange to handle this, you have a clean SSO solution.

HTH

于 2013-02-24T12:17:12.803 回答
0

我们在 Apache 配置中执行此操作。它需要类似下面的东西。您需要一个只读无密码用户才能绑定到 Active Directory。

    AuthName "Active Directory"
    AuthType Basic
    AuthBasicProvider ldap
    AuthLDAPUrl ldap://server:389/OU=COMPANY,DC=COMPANY,DC=com?sAMAccountName,mail,name,extensionAttribute2,memberOf?base?(objectClass=user)
    AuthzLDAPAuthoritative on
    AuthLDAPBindDN "CN=ReadOnlyUser,OU=ServiceAccounts,OU=Users,OU=XXX,OU=COMPANY,DC=COMPANY,DC=com"
    AuthLDAPGroupAttributeIsDN on 
    require valid-user
于 2014-08-05T10:22:31.017 回答