标签: ldap

在Mac OS X Mavericks上安装py-ldap(缺少sasl.h)

我似乎无法在我的OS X Mavericks 10.9.1机器上安装python ldap模块.

内核细节:uname -a Darwin 13.0.0 Darwin内核版本13.0.0:Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64

我尝试了这里建议的内容:http: //projects.skurfer.com/posts/2011/python_ldap_lion/

但是当我尝试使用pip时,我得到了一个不同的错误

Modules/LDAPObject.c:18:10:致命错误:找不到'sasl.h'文件

*#include sasl.h

我也试过这里建议的: python-ldap OS X 10.6和Python 2.6

但是同样的错误.

我希望有人可以帮助我.

python ldap osx-mavericks

33
推荐指数
4
解决办法
1万
查看次数

ldapsearch over ssl/tls不起作用

我试图在ssl/tls连接上使用ldapsearch,但它不起作用:

ldapsearch -ZZ -d 5 -b "cn=Users,dc=my,dc=server,dc=com" -s sub -D
"cn=mydevice,cn=Users,dc=my,dc=server,dc=com" -h my.server.com -p 3269
-w "mypass" -x "(cn=test)"

ldap_create
ldap_url_parse_ext(ldap://my.server.com:3269)
ldap_extended_operation_s
ldap_extended_operation
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP my.server.com:3269
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 10.199.46.70:3269
ldap_connect_timeout: fd: 3 tm: -1 async: 0
ldap_open_defconn: successful
ldap_send_server_request
ber_scanf fmt ({it) ber:
ber_scanf fmt ({) ber:
ber_flush: 31 bytes to sd 3
ldap_result ld 0x95ff590 msgid 1
wait4msg ld 0x95ff590 msgid 1 (infinite timeout)
wait4msg continue ld 0x95ff590 msgid …
Run Code Online (Sandbox Code Playgroud)

ldap starttls

32
推荐指数
1
解决办法
9万
查看次数

查询LDAP

我之前没有使用过LDAP,所以我有点迷失了.我需要连接到LDAP源查找特定属性并进行更改.该程序的输入是一个包含用户列表的CSV文件.该程序应该从CSV文件中读取UID,找到LDAP中的记录并替换某个属性.我不知道如何做到这一点.任何人都可以指出我正确的方向吗?

c# ldap

31
推荐指数
3
解决办法
6万
查看次数

使用Java进行LDAP身份验证

我需要为应用程序执行LDAP身份验证.

我尝试了以下程序:

import java.util.Hashtable;  

import javax.naming.Context;  
import javax.naming.NamingException;  
import javax.naming.ldap.InitialLdapContext;  
import javax.naming.ldap.LdapContext;  


public class LdapContextCreation {  
    public static void main(String[] args) {  
        LdapContextCreation ldapContxCrtn = new LdapContextCreation();  
        LdapContext ctx = ldapContxCrtn.getLdapContext();  
    }  
    public LdapContext getLdapContext(){  
        LdapContext ctx = null;  
        try{  
            Hashtable env = new Hashtable();  
            env.put(Context.INITIAL_CONTEXT_FACTORY,  "com.sun.jndi.ldap.LdapCtxFactory");  
            env.put(Context.SECURITY_AUTHENTICATION, "Simple");  
            //it can be <domain\\userid> something that you use for windows login  
            //it can also be  
            env.put(Context.SECURITY_PRINCIPAL, "username@domain.com");  
            env.put(Context.SECURITY_CREDENTIALS, "password");  
            //in following property we specify ldap protocol and connection url.  
            //generally the …
Run Code Online (Sandbox Code Playgroud)

java authentication ldap

31
推荐指数
3
解决办法
10万
查看次数

如何将Java连接到Active Directory

我使用的是Weblogic,Ejb3.0.Java 1.6

我需要通过Java代码访问Active Directory.我读了几种方法(Kerberos,LDAP)

任何人都可以建议我这样做的舒适​​方式?我在哪里可以找到一些完整的代码示例,

谢谢,雷.

java kerberos ldap active-directory java-ee

30
推荐指数
2
解决办法
10万
查看次数

了解Django-LDAP身份验证

我是Django的新手,并被分配了以LDAP作为后端实现用户身份验证系统的任务.我想文档假设最终开发人员在Django中有足够的经验来理解和实现这样的系统.这是我无法理解如何使用基于LDAP的身份验证实现简单的django应用程序的地方.这是我到目前为止所理解的:

仅将更改发布到文件:

settings.py
....
import ldap
from django_auth_ldap.config import LDAPSearch

AUTH_LDAP_SERVER_URI = "ldap://<my url>" 
AUTHENTICATION_BACKENDS = ('django_auth_ldap.backend.LDAPBackend')

AUTH_LDAP_CONNECTION_OPTIONS = { 
    ldap.OPT_REFERRALS: 0
}

MIDDLEWARE_CLASSES = ( 
     ....
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    ...
)

INSTALLED_APPS = ( 
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    ....
)
Run Code Online (Sandbox Code Playgroud)

auth.html

<html>
    <head>
        <title>Login</title>
    </head>
    <body>
        {{state}}
        <form action="" method="post"> {% csrf_token %}
            Email address: <input type="text" name="email" value="{{ email }}" />
            Password: <input type="password" name="password" value="" />
            <input type="submit" value="Log in" />
        </form>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

models.py:

??
Run Code Online (Sandbox Code Playgroud)

views.py: …

python authentication django ldap django-auth-ldap

30
推荐指数
2
解决办法
3万
查看次数

如何使用Spring Security对Active Directory服务器进行身份验证?

我正在编写一个需要用户登录的Spring Web应用程序.我的公司有一个Active Directory服务器,我想为此目的使用它.但是,我在使用Spring Security连接服务器时遇到问题.

我正在使用Spring 2.5.5和Spring Security 2.0.3以及Java 1.6.

如果我将LDAP URL更改为错误的IP地址,它不会抛出异常或任何东西,所以我想知道它是否甚至尝试连接到服务器开始.

尽管Web应用程序启动得很好,但我在登录页面中输入的任何信息都会被拒绝.我以前使用过InMemoryDaoImpl,它工作正常,所以我的应用程序的其余部分似乎都配置正确.

这是我与安全相关的bean:

  <beans:bean id="ldapAuthProvider" class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
    <beans:constructor-arg>
      <beans:bean class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator">
        <beans:constructor-arg ref="initialDirContextFactory" />
        <beans:property name="userDnPatterns">
          <beans:list>
            <beans:value>CN={0},OU=SBSUsers,OU=Users,OU=MyBusiness,DC=Acme,DC=com</beans:value>
          </beans:list>
        </beans:property>
      </beans:bean>
    </beans:constructor-arg>
  </beans:bean>

  <beans:bean id="userDetailsService" class="org.springframework.security.userdetails.ldap.LdapUserDetailsManager">
    <beans:constructor-arg ref="initialDirContextFactory" />
  </beans:bean>

  <beans:bean id="initialDirContextFactory" class="org.springframework.security.ldap.DefaultInitialDirContextFactory">
    <beans:constructor-arg value="ldap://192.168.123.456:389/DC=Acme,DC=com" />
  </beans:bean>
Run Code Online (Sandbox Code Playgroud)

java spring ldap active-directory

29
推荐指数
2
解决办法
6万
查看次数

LDAP如何在Java中搜索/验证此LDAP

我正在玩LDAP和Java搜索.这是我的LDIF导出与一个简单的组织

version: 1

dn: dc=example,dc=com
objectClass: organization
objectClass: dcObject
objectClass: top
dc: example
o: MyOrganization
description: Test Description

dn: ou=people, dc=example,dc=com
objectClass: organizationalUnit
objectClass: top
ou: people
description: All users in demo company

dn: cn=Johnny Doe,ou=people,dc=example,dc=com
objectClass: organizationalPerson
objectClass: person
objectClass: inetOrgPerson
objectClass: top
cn: Johnny Doe
sn: Johnny
homephone: 123-456-7890
mail: johnny@johnny.com
ou: Development
uid: jjohnny
userpassword:: johnny

dn: cn=Samuel Johnson,ou=people,dc=example,dc=com
objectClass: organizationalPerson
objectClass: person
objectClass: inetOrgPerson
objectClass: top
cn: Samuel Johnson
sn: Samuel
homephone: 123-456-7890
mail: sam@ssam.com
ou: …
Run Code Online (Sandbox Code Playgroud)

java jndi ldap

28
推荐指数
3
解决办法
13万
查看次数

如果我不知道基本DN的OU,如何使用PHP ldap_search()来获取用户OU

我有一个Active-Directory结构,其中User对象驻留在OU中,例如IT,技术,HR,帐户等.我想编写一个PHP脚本,用AD对用户进行身份验证,并根据他们的Group提供aproperiate Web服务.

ldap_search()需要基本DN.我试着搜索

ldap_search($ldap, "dc=country,dc=company,dc=co,dc=uk", "(samaccountname=$username)", array("memberof"));
Run Code Online (Sandbox Code Playgroud)

但是PHP给出了"操作错误".如果相反,我指定OU

ldap_search($ldap, "ou=sales,dc=country,dc=company,dc=co,dc=uk", "(samaccountname=jake)", array("memberof"));
Run Code Online (Sandbox Code Playgroud)

然后搜索就可以了.

我可以使用通配符吗?

另外,用户对象应该在OU中吗?因为我是第一个将他们移到里面的菜鸟!

编辑:获得JPBlanc的学分,指导我正确的方向和http://blog.redbranch.net/?p=76

解决方案是在连接和绑定之间添加2行.

ldap_connect(..)
ldap_set_option ($ldap, LDAP_OPT_REFERRALS, 0);
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_bind(..)
Run Code Online (Sandbox Code Playgroud)

谢谢=)

编辑2 - 完整代码:

<?php

namespace ldap;

abstract class AuthStatus
{
    const FAIL = "Authentication failed";
    const OK = "Authentication OK";
    const SERVER_FAIL = "Unable to connect to LDAP server";
    const ANONYMOUS = "Anonymous log on";
}

// The LDAP server
class LDAP
{
    private $server = "127.0.0.1";
    private $domain = "localhost";
    private …
Run Code Online (Sandbox Code Playgroud)

php ldap active-directory

28
推荐指数
1
解决办法
5万
查看次数

使用Active Directory对Intranet站点上的用户进行身份验证

我有一个我建立的'内部网'网站,它有自己的登录系统(用户注册为新用户,并使用其上的用户名/密码登录该网站).但是,现在我想扩展它,让Intranet站点使用现有的ActiveDirectory进行身份验证.这就是我正在寻找的,未来 -

当用户访问此Intranet站点(http://intranetsite/mySite)时,将针对活动目录验证用户的域凭据,如果用户的凭据与AD匹配,则会向用户显示Intranet站点的主页.

我是AD的新手,不知道如何进行此配置.我的Intranet站点是围绕PHP构建的,并在应用程序服务器上使用Apache; AD位于不同的IIS服务器上.

我需要哪些信息,以及我将这些信息放在哪里(进入我的网站?htaccess?其他地方?)以便我可以使用AD身份验证?只是'配置'足够,还是我需要为此身份验证编写显式PHP代码?

任何指针都非常感谢.

php authentication ldap active-directory

28
推荐指数
2
解决办法
8万
查看次数