Question
I have set up the ISAPI filter and it is all running okay. How do I retrieve the Windows username?
Answer
1. Enable authentication in the IIS Web Server. You need to set "integrated Windows authentication" at the default website level.
2. Instruct Tomcat to take the authenticated user from IIS. If you are using the jk2 connector, do this by adding the following line to the jk2.properties file: request.tomcatAuthentication=false
3. Restart IIS and Tomcat.
The userid should then be available in Ebase using the $USER system variable.
How do I retrieve the Windows username?
Moderators: Jon, Steve, Ian, Dave
- Sarah
- Ebase User
- Posts: 63
- Joined: Fri Sep 07, 2007 2:42 pm
- Location: Sandy, UK
- Contact:
-
- Ebase User
- Posts: 53
- Joined: Thu Sep 13, 2007 9:02 am
- Contact:
For Tomcat 5.5 you also need to amend the server.xml file in Ufs\UfsServer\tomcat\conf\ to add the tomcatAuthentication parameter to the Connector port e.g. :-Sarah wrote:1. Enable authentication in the IIS Web Server. You need to set "integrated Windows authentication" at the default website level.
2. Instruct Tomcat to take the authenticated user from IIS. If you are using the jk2 connector, do this by adding the following line to the jk2.properties file: request.tomcatAuthentication=false
3. Restart IIS and Tomcat.
The userid should then be available in Ebase using the $USER system variable.
<Connector port="3009"
enableLookups="false" redirectPort="3443" protocol="AJP/1.3" tomcatAuthentication="false" />
0 x
- Wai
- Moderator
- Posts: 165
- Joined: Wed Sep 12, 2007 9:04 am
- Location: Sandy, UK
- Contact:
If you just wanted to retrieve the Windows user name and you are not concerned with doing any authentication then it is possible to get this by writing a simple custom function.
There is a method in Java that will get the Windows user name:
System.getProperty("user.name");
You could write a custom function that returns this as a String.
There is a method in Java that will get the Windows user name:
System.getProperty("user.name");
You could write a custom function that returns this as a String.
0 x
-
- Ebase User
- Posts: 97
- Joined: Thu Sep 13, 2007 6:07 am
- Location: The Netherlands
I think this method will only return the username of the user who's is logged in on the server which is running Ebase. Is this correct?Wai wrote:If you just wanted to retrieve the Windows user name and you are not concerned with doing any authentication then it is possible to get this by writing a simple custom function.
There is a method in Java that will get the Windows user name:
System.getProperty("user.name");
You could write a custom function that returns this as a String.
0 x
What's the meaning of Justice...
- Wai
- Moderator
- Posts: 165
- Joined: Wed Sep 12, 2007 9:04 am
- Location: Sandy, UK
- Contact:
-
- Moderator
- Posts: 184
- Joined: Tue Sep 11, 2007 8:58 am
As an alternative to writing a custom function, you can use an Ebase function called javamethod, which can call any static method in any Java class in the classpath. This function is not automatically available and needs to be added to list of functions using Ebase Designer.
a. Install Ebase function called javaMethod - read Additional Supplied Functions section of the online documentation. An export of the function is available on request.
b. The fpl is:
// userid is a form field
set userid = javaMethod('java.lang.System.getProperty', 'user.name');
a. Install Ebase function called javaMethod - read Additional Supplied Functions section of the online documentation. An export of the function is available on request.
b. The fpl is:
// userid is a form field
set userid = javaMethod('java.lang.System.getProperty', 'user.name');
0 x
-
- Ebase User
- Posts: 11
- Joined: Thu Sep 13, 2007 8:20 am
- Location: North Herts District Council
Hi Hovik..Hovik wrote:As an alternative to writing a custom function, you can use an Ebase function called javamethod, which can call any static method in any Java class in the classpath. This function is not automatically available and needs to be added to list of functions using Ebase Designer.
a. Install Ebase function called javaMethod - read Additional Supplied Functions section of the online documentation. An export of the function is available on request.
b. The fpl is:
// userid is a form field
set userid = javaMethod('java.lang.System.getProperty', 'user.name');
Any chance you can send me the above custom function? As you know we've been trying to achieve this functionality for quite some time and it looks like that we might finally be able to crack it.
Thanks
0 x
Indy
- Sarah
- Ebase User
- Posts: 63
- Joined: Fri Sep 07, 2007 2:42 pm
- Location: Sandy, UK
- Contact:
The javamethod function can be downloaded here:
http://www.ebaseftp.com/forum/forumfiles/javamethod.zip
and imported into the Ebase Designer.
http://www.ebaseftp.com/forum/forumfiles/javamethod.zip
and imported into the Ebase Designer.
0 x
- Sarah
- Ebase User
- Posts: 63
- Joined: Fri Sep 07, 2007 2:42 pm
- Location: Sandy, UK
- Contact:
IMPORTANT NOTES:
1. The javamethod function was introduced in Ebase version 3.4.0. Previous versions of Ebase do not include this function in the Additional Supplied Functions.
2. The xml file has been supplied to facilitate the addition of the function to Ebase 3.4.0 and above. Either import the xml into the Ebase Designer OR add the function to the Designer manually by following the instructions in the Additional Supplied Functions help documentation.
1. The javamethod function was introduced in Ebase version 3.4.0. Previous versions of Ebase do not include this function in the Additional Supplied Functions.
2. The xml file has been supplied to facilitate the addition of the function to Ebase 3.4.0 and above. Either import the xml into the Ebase Designer OR add the function to the Designer manually by following the instructions in the Additional Supplied Functions help documentation.
0 x
- Joost
- Ebase User
- Posts: 49
- Joined: Fri Sep 14, 2007 6:14 pm
- Location: The Netherlands
Or you could unzip the class from a recent ufs.jar and add it to the jar currently in use. The function specification can be exported likewise from a recent Ebase version.Sarah wrote:The javamethod function can be downloaded
For the JavaMethod the following two classes are needed:
ufs\customfunctions\JavaMethod.class
common\ReflectionUtil.class
Two other useful functions are:
ufs\customfunctions\MoveFile.class
ufs\customfunctions\RequestProperty.class
0 x
- Sarah
- Ebase User
- Posts: 63
- Joined: Fri Sep 07, 2007 2:42 pm
- Location: Sandy, UK
- Contact:
We hadn't mentioned how to copy the class from the version 3.4.0 jar file, because when upgrading to version 3.4.0 it is important to remember to remove the 2 classes that have been added to the .../WEB-INF/classes/com/ebasetech/ufs... directory. Otherwise, future changes to the code might be missed.
If anyone does add the javamethod.class and ReflectionUtil.class to a version of Ebase prior to version 3.4.0, please ensure you remove them when you upgrade.
If anyone does add the javamethod.class and ReflectionUtil.class to a version of Ebase prior to version 3.4.0, please ensure you remove them when you upgrade.
0 x
Who is online
Users browsing this forum: No registered users and 13 guests