Jade application integrating to Windows ActiveDirectory for

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Jade application integrating to Windows ActiveDirectory for

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:47 pm

by tyc >> Tue, 22 Mar 2005 3:47:57 GMT

Hi,
We want to run our Jade application integrating to Windows ActiveDirectory for single-signon, could you please advise me where/how I can get the userID single-signon using Jade program?

Many Thanks,
Scott

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Jade application integrating to Windows ActiveDirectory for

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:47 pm

by T Moore >> Tue, 22 Mar 2005 8:31:49 GMT

We use the GetUserNameExA windows API to retreive the user name and domain of the windows user for the Jade process (http://msdn.microsoft.com/library/defau ... sysinfo/ba se/getusernameex.asp) The external function definition is.

getUserNameEx(

iFormat : Integer;
szUser : String[256] output;
pcchUser : Integer io

) : Boolean is GetUserNameExA in secur32;

The format of the user code returned is dependent on the iFormat parameter. You can see the options at http://msdn.microsoft.com/library/defau ... ysinfo/bas e/extended_name_format_str.asp

We also use the active directory API's to look up the list of available users but ended up wrapping this functionality in a DLL to make the calls easier from Jade.

Torrie

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Jade application integrating to Windows ActiveDirectory for

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:48 pm

by jcampbell >> Tue, 22 Mar 2005 19:58:16 GMT

Torrens idea is ok in a very controlled environment where you can guarantee someone hasn't setup an equivalent domain/username etc so they can spoof any user. If you're not in a 'trusted' environment then relying on GetUserNameEx executing on the client is not a good idea as you do not have control over what the client has set up and the client can therefore easily spoof any user.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Jade application integrating to Windows ActiveDirectory for

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:48 pm

by tyc >> Wed, 23 Mar 2005 3:27:49 GMT

Hi
I copied Secur32.dll file to bin directory and all the external function getUserNameEx as advised.

then I tried the following workspace in Jade5.2.08 to check whether it can work. But as Torrie
said, the Jade development environment is ended up. For Jade6.0.21, when I try to open Development environment, there is an error (Cannot enter the point).

vars
n:String;
pcchUser:Integer;begin

write call getUserNameEx(1,n,pcchUser);
write n;
write pcchUser;
end;

Pls advise.
Many Thanks,
Scott

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Jade application integrating to Windows ActiveDirectory for

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:48 pm

by tyc >> Wed, 23 Mar 2005 3:43:05 GMT

Hi,
For more information, the Secur32.dll is downloaded from www.dll-files.com and my OS is windows2000 and no Domain, just workgroup for network connection.

Thanks,
Scott

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Jade application integrating to Windows ActiveDirectory for

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:48 pm

by tyc >> Wed, 23 Mar 2005 3:43:32 GMT

Hi,
For more information, the Secur32.dll is downloaded from www.dll-files.com and my OS is windows2000 and no Domain, just workgroup for network connection.

Thanks,
Scott

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Jade application integrating to Windows ActiveDirectory for

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:48 pm

by T Moore >> Wed, 23 Mar 2005 8:38:43 GMT

Scott

I'm not sure what the problem you are having is. What do you mean by "the Jade development environment is ended up" Is the system crashing with an exception?

You should have no need to download the secur32.dll file. It should exist in your windows system directory. This API is only included in windows 2000 professional and windows XP so if you are not using either of these then it will not work. You can use the GetUserName function (http://msdn.microsoft.com/library/defau ... sysinfo/ba se/getusername.asp) to retrieve just the windows user name which is available on all versions of windows. I'm guessing that the problem is that you have downloaded the dll. Try deleting it and check that the dll exists in the system32 directory.

As has been pointed out in an earlier post, you do need to be careful about using this across NT domains as another user in another domain may have the same name. We retrieve the fully qualified name, not just the user and domain and then only limit this to our internal users. Even more care would be needed if you are using getUserName.

Our systems are running on Jade 5.2.8 and Jade 6.0.20 and Windows 2000 using this without any problems.

Torrie

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Jade application integrating to Windows ActiveDirectory for

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:48 pm

by tyc >> Wed, 23 Mar 2005 12:18:14 GMT

Torrie
Thanks for your kindly suggestion. The workspace can execute now, but the output of the workspace is false and n is empty, is it because I am running Not NT domains? I just log on a workgroup.

My workspace is described as follow.

vars
n:String;
pcchUser:Integer;begin

write call getUserNameEx(1,n,pcchUser);
write n;
end;


Please advise again.

Many Thanks,
Scott

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Jade application integrating to Windows ActiveDirectory for

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:48 pm

by T Moore >> Wed, 30 Mar 2005 7:57:02 GMT

Scott

You need to tell Windows how many characters the string can take. This is usual with most windows API's.

vars
n:String;
pcchUser:Integer;begin


pcchUser := 256;

write call getUserNameEx(1,n,pcchUser);
write n;
end;

Torrie

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Jade application integrating to Windows ActiveDirectory for

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:48 pm

by John Munro >> Wed, 30 Mar 2005 8:53:38 GMT

Shouldn't you use a fixed length string? If you're telling the API that the string can take 256 characters, shouldn't you tell Jade the same thing, like this?

vars
n:String[256];


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 20 guests