tag:support.hglabhq.com,2012-10-18:/discussions/questions/220-ldap-auth-failingHgLab: Discussion 2014-05-25T09:35:46Ztag:support.hglabhq.com,2012-10-18:Comment/287309102013-09-23T10:36:41Z2013-09-23T10:36:41ZLDAP Auth Failing<div><p>Jonah,</p>
<p>Apologies for the delay and thanks for the investigation.</p>
<p>Could you please verify what happens if you create your
<code>PrincipalContext</code> like this:</p>
<pre>
<code>var pc = new PrincipalContext(ContextType.Domain, activeDirectoryServerAddress, container,
ContextOptions.Negotiate, // This one
bindUsername, bindPassword);</code>
</pre></div>Anton Gogolevtag:support.hglabhq.com,2012-10-18:Comment/287309102013-09-23T15:51:23Z2013-09-23T15:51:23ZLDAP Auth Failing<div><p>The context is created successfully (same as omitting the<br>
ContextOptions.Negotiate parameter)</p></div>Jonah Simpsontag:support.hglabhq.com,2012-10-18:Comment/287309102013-09-24T12:32:57Z2013-09-24T12:32:57ZLDAP Auth Failing<div><p>Jonah,</p>
<p>Could you please try replacing two files in \bin directory with
these two (they are for 0.3.10, so you'll need to upgrade if you're
running an older version) and see if this helps.</p>
<p>Password for the archive is <code>hglab</code></p></div>Anton Gogolevtag:support.hglabhq.com,2012-10-18:Comment/287309102013-09-24T14:56:55Z2013-09-24T14:56:55ZLDAP Auth Failing<div><p>Authentication successful!</p>
<p>Thanks Anton!</p></div>Jonah Simpsontag:support.hglabhq.com,2012-10-18:Comment/287309102013-09-24T15:03:41Z2013-09-24T15:03:41ZLDAP Auth Failing<div><p>Always glad to help, Jonah. Cheers!</p></div>Anton Gogolevtag:support.hglabhq.com,2012-10-18:Comment/287309102013-10-02T19:36:22Z2013-10-08T13:39:11ZLDAP Auth Failing<div><p>Hi Jonah, I think I need this patch as well. However, there is a
password on the zip file in this thread. Can you please share the
password or post a zip without a password?</p>
<p>Thanks</p></div>Chris Bourquetag:support.hglabhq.com,2012-10-18:Comment/287309102013-10-02T19:37:51Z2013-10-02T19:37:51ZLDAP Auth Failing<div><p>Nevermind, I guess the password on my first attempt and it
worked.</p></div>Chris Bourquetag:support.hglabhq.com,2012-10-18:Comment/287309102013-10-02T19:40:01Z2013-10-02T19:40:01ZLDAP Auth Failing<div><p>Chris,</p>
<p>I assume the patch did work?</p></div>Anton Gogolevtag:support.hglabhq.com,2012-10-18:Comment/287309102013-10-02T22:20:37Z2013-10-02T22:20:39ZLDAP Auth Failing<div><p>Actually, no it did not work. I still face the same problem.</p>
<p>15:48:12.1837 - Debug - -
HgLab.Core.Framework.Security.LdapAuthenticationModule - attempting
to sign in 'userxyz' using 'Company AD'<br>
15:48:12.2157 - Debug - -
HgLab.Core.Framework.Security.LdapAuthenticationModule - connecting
to LDAP server at 'ldap.company.com:3268' with base container
'DC=company,DC=com'<br>
15:48:12.2387 - Warn - -
HgLab.Core.Framework.Security.LdapAuthenticationModule - could not
find user by
identitySystem.DirectoryServices.AccountManagement.PrincipalOperationException:
A local error has occurred.<br>
---> System.DirectoryServices.DirectoryServicesCOMException: A
local error has occurred.</p>
<p>at System.DirectoryServices.DirectoryEntry.Bind(Boolean
throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at
System.DirectoryServices.DirectoryEntry.get_SchemaEntry() at
System.DirectoryServices.AccountManagement.ADStoreCtx.IsContainer(DirectoryEntry
de) at
System.DirectoryServices.AccountManagement.ADStoreCtx..ctor(DirectoryEntry
ctxBase, Boolean ownCtxBase, String username, String password,
ContextOptions options) at
System.DirectoryServices.AccountManagement.PrincipalContext.CreateContextFromDirectoryEntry(DirectoryEntry
entry) at
System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInit()
--- End of inner exception stack trace --- at
System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInit()
at
System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit()
at
System.DirectoryServices.AccountManagement.PrincipalContext.Initialize()
at
System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx()
at
System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext
context, Type principalType, Nullable<code>1 identityType, String
identityValue, DateTime refDate) at
System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext
context, String identityValue) at
HgLab.Core.Framework.Security.LdapAuthenticationModule.Authenticate(String
login, String password, AuthenticationSettings
authenticationSettings) in
d:\projects\hglab\src\HgLab.Core\Framework\Security\LdapAuthenticationModule.cs:line
107 at
System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInit()
at
System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit()
at
System.DirectoryServices.AccountManagement.PrincipalContext.Initialize()
at
System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx()
at
System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext
context, Type principalType, Nullable</code>1 identityType, String
identityValue, DateTime refDate) at
System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext
context, String identityValue) at
HgLab.Core.Framework.Security.LdapAuthenticationModule.Authenticate(String
login, String password, AuthenticationSettings
authenticationSettings) in
d:\projects\hglab\src\HgLab.Core\Framework\Security\LdapAuthenticationModule.cs:line
107 15:48:22.2967 - Error - -
HgLab.Core.Framework.Appcast.AppcastManager - could not check for
updatesSystem.Net.WebException: Unable to connect to the remote
server ---> System.Net.Sockets.SocketException: A connection
attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because
connected host has failed to respond 46.173.209.0:80<br>
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) at
System.Net.ServicePoint.ConnectSocketInternal(Boolean
connectFailure, Socket s4, Socket s6, Socket& socket,
IPAddress& address, ConnectSocketState state, IAsyncResult
asyncResult, Exception& exception) --- End of inner exception
stack trace --- at System.Net.WebClient.DownloadFile(Uri address,
String fileName) at
HgLab.Core.Framework.Appcast.AppcastManager.DiscoverUpdates(String
appcastFeedUrl, Version currentVersion) in
d:\projects\hglab\src\HgLab.Core\Framework\Appcast\AppcastManager.cs:line
42 at System.Net.WebClient.DownloadFile(Uri address, String
fileName) at
HgLab.Core.Framework.Appcast.AppcastManager.DiscoverUpdates(String
appcastFeedUrl, Version currentVersion) in
d:\projects\hglab\src\HgLab.Core\Framework\Appcast\AppcastManager.cs:line
42</p></div>Chris Bourquetag:support.hglabhq.com,2012-10-18:Comment/287309102013-10-03T06:01:20Z2013-10-03T06:01:20ZLDAP Auth Failing<div><p>Chris,</p>
<p>What are the Windows versions on your domain controller and on
the server HgLab is running on?</p>
<p>On 03.10.2013, at 2:20, "Chris Bourque" <a href=
"mailto:tender2+d1d04738944ebd1fcc522a3c1a29a254e5fb93efd@tenderapp.com">
tender2+d1d04738944ebd1fcc522a3c1a29a254e5fb93efd@tenderapp.com</a>
wrote:</p></div>Anton Gogolevtag:support.hglabhq.com,2012-10-18:Comment/287309102013-10-07T14:05:14Z2013-10-07T14:05:16ZLDAP Auth Failing<div><p>Both are Windows Server 2008. I am trying to bind to an Active
Directory Global Catalog. Thanks</p></div>Chris Bourquetag:support.hglabhq.com,2012-10-18:Comment/287309102013-10-08T13:38:42Z2013-10-08T13:38:42ZLDAP Auth Failing<div><p>Chris,</p>
<p>Aha, so Global Catalog seems to be the thing I'm not supporting
properly. I'll try and resolve the issue.</p>
<p>Thanks for the report!</p></div>Anton Gogolev