Elsinore

User Forum

www.screenconnect.com
Welcome Guest Search | Active Topics | Log In | Register

Tag as favorite
Issue with using OpenLDAP
acondra
#1 Posted : Friday, December 16, 2011 2:19:14 PM
Rank: Member
Joined: 12/16/2011
Posts: 10
Location: French lick
We are currently evaluating SceenConnect and have the system up and running using ldap auth. When the system is configured to connect to one of our Windows domain controllers we are able to authenticate and the system works as designed. However in our DMZ we have an instance of Open ldap that proxies to our internal DC and with this is used we receive the following error.

send_ldap_result: err=2 matched="" text="historical protocol version requested, use LDAPv3 instead"

If I enable LDAPV2 in the slapd.conf file then I start to receive decoding errors when the application attempts to filter ldap results.
Jake Morgan
#2 Posted : Saturday, December 17, 2011 3:30:40 AM
Rank: Administration
Joined: 4/9/2010
Posts: 859
We use the ldap libraries included with .net. I'm not sure what ldap version they use. in fact, I don't know much about them at all! There could be an option for us to specify a protocol version.
acondra
#3 Posted : Tuesday, December 20, 2011 9:12:58 PM
Rank: Member
Joined: 12/16/2011
Posts: 10
Location: French lick
I built a sample project in C# using Visual Studio 2010 and it seams the default when no protocol version is specified it is not version 3. However I was able to use the following line to specify version 3

connection.SessionOptions.ProtocolVersion = 3;

Jake Morgan
#4 Posted : Tuesday, December 20, 2011 10:10:17 PM
Rank: Administration
Joined: 4/9/2010
Posts: 859
OK, there are a lot of options there, and I don't want to get in the business of allowing configuration of each one. You can program .NET? Just derive frmo the LdapMembershipProvider. Future builds will have these virtuals:

Code:

        protected virtual LdapConnection CreateMainConnection(NameValueCollection config)
        {
            ...
        }

        protected virtual LdapConnection CreateValidateConnection(LdapConnection mainConnection, string user, string password)
        {
            ...
        }


You should put your derived class in App_Code so that it will automatically recompile whenever you upgrade.
acondra
#5 Posted : Tuesday, December 20, 2011 11:35:35 PM
Rank: Member
Joined: 12/16/2011
Posts: 10
Location: French lick
Yes I have some experience with C# and VB, C# being my preference. That being said I wouldn't consider myself proficient. Aside from a purchasing and inventory control application I helped write at a previous employer I have mainly written tools to help manage and inventory the pc's and servers in our environment. As for deriving from a class and extending it I have only done that on a basic level such as extending the item class to provide addition vales in a combobox. Extending this class my be beyond me as the moment unless I can find a code example that would help give me a start. I appreciate you taking the time to address my inquary and will see what I can do with the information provided.
Jake Morgan
#6 Posted : Wednesday, December 21, 2011 6:13:48 PM
Rank: Administration
Joined: 4/9/2010
Posts: 859
Here is a class that should add that functionality:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.DirectoryServices.Protocols;
using System.Collections.Specialized;

public class LdapMembershipProviderEx : Elsinore.ScreenConnect.LdapMembershipProvider
{
    protected override LdapConnection CreateMainConnection(NameValueCollection config)
    {
        var connection = base.CreateMainConnection(config);
        connection.SessionOptions.ProtocolVersion = 3; // optionally could pull from config
        return connection;
    }

    protected override LdapConnection CreateValidateConnection(LdapConnection mainConnection, string user, string password)
    {
        var connection = base.CreateValidateConnection(mainConnection, user, password);
        connection.SessionOptions.ProtocolVersion = mainConnection.SessionOptions.ProtocolVersion;
        return connection;
    }
}


put it in an App_Code directory in your SC install.

then change the web.config:

add the directoryservices protocols assembly for compilation:

Code:
    <add assembly="System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   </assemblies>


Then change your provider type from type="Elsinore.ScreenConnect.LdapMembershipProvider" to type="LdapMembershipProviderEx"
acondra
#7 Posted : Thursday, December 22, 2011 3:09:24 AM
Rank: Member
Joined: 12/16/2011
Posts: 10
Location: French lick
I had to change the PublicKeyToken for System.DirectoryServices.Protocols to mach my install. After doing that I am able to load that assembly. After that I recieve the following error. Is the method CreatMainConnection not in the current stable build of the software?

e:\Program Files (x86)\ScreenConnect\App_Code\LdapMembershipProviderEx.cs(10,39): error CS0115: 'LdapMembershipProviderEx.CreateMainConnection(System.Collections.Specialized.NameValueCollection)': no suitable method found to override
e:\Program Files (x86)\ScreenConnect\App_Code\LdapMembershipProviderEx.cs(17,39): error CS0115: 'LdapMembershipProviderEx.CreateValidateConnection(System.DirectoryServices.Protocols.LdapConnection, string, string)': no suitable method found to override


Jake Morgan
#8 Posted : Thursday, December 22, 2011 3:11:06 AM
Rank: Administration
Joined: 4/9/2010
Posts: 859
Oh, you'll need a new not-yet-released build of 2.4. Coming soon
acondra
#9 Posted : Thursday, December 22, 2011 3:17:43 AM
Rank: Member
Joined: 12/16/2011
Posts: 10
Location: French lick
That works. I'll keep an eye on the download page for an updated Pre-Release build. I appreciate all of your help on this.
Also if your interested I tested the current Pre-Release a few days ago and the Java client was not working on Windows 7 x64. I can't remember the exact error but since I'm currently not in a production environment I would be happy to reload the Pre-Release and attempt to reproduce the error if that would help you in any way.
acondra
#10 Posted : Tuesday, December 27, 2011 10:04:03 PM
Rank: Member
Joined: 12/16/2011
Posts: 10
Location: French lick
Does the pre-release version dated 12/27 have the new virtuals that will enable this functionality?
Jake Morgan
#11 Posted : Tuesday, December 27, 2011 10:41:40 PM
Rank: Administration
Joined: 4/9/2010
Posts: 859
Yes.
acondra
#12 Posted : Thursday, December 29, 2011 3:06:33 PM
Rank: Member
Joined: 12/16/2011
Posts: 10
Location: French lick
That fixed the bind issue and I now see all of my group memberships in the OpenLDAP debug window. However I still get a decoding error on the ldap filter. This looks to be during a search for group memberships.
acondra
#13 Posted : Thursday, December 29, 2011 3:34:23 PM
Rank: Member
Joined: 12/16/2011
Posts: 10
Location: French lick
Also the Java Web Start bootstrap client works. However option 3 Java Web Start still sits at waiting to connect in this version.
Users browsing this topic
Guest
Tag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.