Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Authentication Issue with SessionManager.Instance.Connect #1

Open
lkjlkjasdfj opened this issue Mar 18, 2014 · 2 comments
Open

Comments

@lkjlkjasdfj
Copy link

Hansoft have been setup in my company to use windows credentials. Therefore, since ObjectWrapper seems to support regular authentication only, no matter how hard I try I cannot get my program to connect to Hansoft.

I'm using this functions "combo" in my program

SessionManager.Initialize(sdkUser, sdkUserPwd, server, portNumber, databaseName);
SessionManager.Instance.Connect();

Where sdkUser, sdkUserPwd, server, portNumber, databaseName are obviously the variables containing the correct information. Since we have Windows logon sdkUser is formatted as so : "domain.com\username"

Do you have a quick fix for this and/or do you plan to release a new version of ObjectWrapper to allow Windows authentication ?

PS : Sorry for my weird username I had to Sign-up quickly - So, no I'm not a bot, and yes I'm a human.

@lkjlkjasdfj lkjlkjasdfj changed the title Hi ! Windows Authentication Issue with SessionManager.Instance.Connect Mar 18, 2014
@dannychickenlai
Copy link

hi Guillaume :
We too have LDAP integration along with Hansoft .
If you login as an administrator in your Hansoft client , you can create a "SDK user". In fact, there is a "Create SDK user" button under the "Users" tab. Once you have created a sdk user . You can supply its name and password into the Initailize function . You will NOT use the domain\username pattern in this case.

@dannychickenlai
Copy link

The Initialize() function should be changed to include an additional parameter which specify the sdk dll folder path .

    /// <summary>
    /// Closes any current connections and opens a new connection to the specified Hansoft database.
    /// </summary>
    /// <param name="sdkUser">The SDK user name to connect as.</param>
    /// <param name="sdkUserPwd">The password of the SDK user.</param>
    /// <param name="server">The DNS name or IP address of the Hansoft server to connect to.</param>
    /// <param name="port">The port number for the Hansoft server.</param>
    /// <param name="database">The name of the database to access.</param>
    /// <param name="sdkLocation">path to the directory containing HPMSdk.x64.dll and/or HPMSdk.x86.dll</param>
    public static void Initialize(string sdkUser, string sdkUserPwd, string server, int port, string database, string sdkLocation)
    {
        if (instance != null)
            instance.CloseSession();
        instance = new SessionManager(sdkUser, sdkUserPwd, server, port, database, sdkLocation);
    }

Then in the SessionManager's Connect() function, do this:

hpmSession = HPMSdkSession.SessionOpen(server, port, database, sdkUser, sdkUserPwd, callbackHandler, callbackSemaphore, true, EHPMSdkDebugMode.Off, (IntPtr)null, 0, "", sdkLocation, null);

Also add a private string sdkLocation member to SessionManager , and initialize it in the constructor .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants