{"action":"created","issue":{"url":"https://api.github.com/repos/cannatag/ldap3/issues/120","labels_url":"https://api.github.com/repos/cannatag/ldap3/issues/120/labels{/name}","comments_url":"https://api.github.com/repos/cannatag/ldap3/issues/120/comments","events_url":"https://api.github.com/repos/cannatag/ldap3/issues/120/events","html_url":"https://github.com/cannatag/ldap3/issues/120","id":114107973,"number":120,"title":"referrals to trusting domains","user":{"login":"cornelinux","id":1908620,"avatar_url":"https://avatars.githubusercontent.com/u/1908620?v=3","gravatar_id":"","url":"https://api.github.com/users/cornelinux","html_url":"https://github.com/cornelinux","followers_url":"https://api.github.com/users/cornelinux/followers","following_url":"https://api.github.com/users/cornelinux/following{/other_user}","gists_url":"https://api.github.com/users/cornelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/cornelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cornelinux/subscriptions","organizations_url":"https://api.github.com/users/cornelinux/orgs","repos_url":"https://api.github.com/users/cornelinux/repos","events_url":"https://api.github.com/users/cornelinux/events{/privacy}","received_events_url":"https://api.github.com/users/cornelinux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-10-29T17:50:12Z","updated_at":"2015-12-04T15:11:02Z","closed_at":null,"body":"I have two active directory domains trusted.com and trusting.com\r\nThere is a one way trust: trusting.com is trusting the users from trusted.com\r\nThus the administrator@trusted.com can view and manage the users in trusting.com.\r\n\r\nI am running such a script, to perform a search for users in the trusting domain:\r\n\r\n    LDAPURI = \"ldap://domain2.trusted.com\"\r\n    LDAPBASE = \"cn=users,dc=trusting,dc=com\"\r\n    BINDDN = \"cn=administrator,cn=users,dc=trusted,dc=com\"\r\n    BINDPW = \"password\"\r\n    \r\n    import ldap3\r\n    FILTER = \"(sAMAccountName=*)\"\r\n    ATTRIBUTES = [\"sAMAccountName\"]\r\n   \r\n    server = ldap3.Server(LDAPURI, port=389, use_ssl=False, connect_timeout=5)\r\n    l = ldap3.Connection(server,\r\n                     user=BINDDN,\r\n                     password=BINDPW,\r\n                     auto_bind=True,\r\n                     auto_referrals=True,\r\n                     authentication=ldap3.SIMPLE,\r\n                     raise_exceptions=True)\r\n    l.open()\r\n    if not l.bind():\r\n        raise Exception(\"Wrong credentials\")\r\n\r\n    l.search(search_base=LDAPBASE,\r\n         search_scope=ldap3.SUBTREE,\r\n         search_filter=FILTER,\r\n         attributes=ATTRIBUTES)\r\n\r\n    r = l.response\r\n    for entry in r:\r\n        print entry.get(\"dn\")\r\n    print(\"%s entries found.\" % len(r))\r\n    l.unbind()\r\n\r\nI get 0 entries. Doing a tcpdump on the ldap port, just shows me, that a referral is returned::\r\n\r\n    0?...`:....+cn=administrator,cn=users,dc=trusted,dc=com..password0........a.....\r\n    ......0S...cN..cn=users,dc=trusting,dc=com\r\n    ..\r\n    .............sAMAccountName0...sAMAccountName0........e.....\r\n    .\r\n    ...Q0000202B: RefErr: DSID-0310082F, data 0, 1 access points\r\n    .ref 1: 'trusting.com'\r\n    ......1./ldap://trusting.com/cn=users,dc=trusting,dc=com0....B.\r\n\r\nWhat is the recommended way to deal with referrals in such a case?\r\n\r\nThanks a lot "},"comment":{"url":"https://api.github.com/repos/cannatag/ldap3/issues/comments/161989865","html_url":"https://github.com/cannatag/ldap3/issues/120#issuecomment-161989865","issue_url":"https://api.github.com/repos/cannatag/ldap3/issues/120","id":161989865,"user":{"login":"cornelinux","id":1908620,"avatar_url":"https://avatars.githubusercontent.com/u/1908620?v=3","gravatar_id":"","url":"https://api.github.com/users/cornelinux","html_url":"https://github.com/cornelinux","followers_url":"https://api.github.com/users/cornelinux/followers","following_url":"https://api.github.com/users/cornelinux/following{/other_user}","gists_url":"https://api.github.com/users/cornelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/cornelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cornelinux/subscriptions","organizations_url":"https://api.github.com/users/cornelinux/orgs","repos_url":"https://api.github.com/users/cornelinux/repos","events_url":"https://api.github.com/users/cornelinux/events{/privacy}","received_events_url":"https://api.github.com/users/cornelinux/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T15:11:02Z","updated_at":"2015-12-04T15:11:02Z","body":"Hi Giovanni,\r\n\r\nthx a lot! I will do so. \r\nPlease give me some(TM) time.\r\n\r\nKind regards\r\nCornelius"}}