Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Custom wfext to enforce cookie-based security - how to load?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Custom wfext to enforce cookie-based security - how to load?
 Login/Join
 
Silver Member
posted
First of all thanks for reading this, and sorry if it turns into a long post.

I have written a very basic custom wfext in Java which extends ibi.webfoc.WFEXTDefault. Eventually the class will decrypt an encrypted cookie and set variables in the variable table for my reports based on the value of the cookie. Right now I'm just checking for the cookie's existence, and setting a WebFOCUS variable in either case.

The class is compiled and sitting in what I think is the classpath (ibi\WebFOCUS77\webapps\webfocus\WEB-INF\classes). I updated Site.wfs through the administration console to call the class's main function. Although the documentation I'm reading (WebFocus 7 Security and Administration) doesn't seem to mention it, I saw in another post here that I needed to edit ibi\WebFOCUS77\webapps\webfocus\WEB-INF\web.xml to tell it to load my class.

The documentation says that if my deployment is open-directory based this should be enough, but I don't know how to check if it is, or if it's .war based. I'm assuming .war based (and therefore I have to rebuild the .war as so far nothing has changed and my reports do not have access to the parameter I set in the wfext).

I am hoping that someone will be kind enough to help me answer the following questions:
1) Which .war file needs rebuilding for my class to be recognised by WebFOCUS (so far I haven't experimented as others are using the reporting server. I assume it's this one ibi\WebFOCUS77\webapps\webfocus.war)?
2) My class includes a number of system.out.println statements for debugging but I have no idea how I turn on tracing or where I would see the output. I do not have much experience with Tomcat or with Java servlets.

Please see relevant code extracts below:

wfext class
 
public class cookieInterpreter extends ibi.webfoc.WFEXTDefault
{
	public cookieInterpreter() { 
		super();
		System.out.println("[WFEXT] cookieInterpreter"); 
	}

	public long setAuthCookie(String[] NewVars, HttpServletRequest req) {

		...

		if(hasAuthCookie) {
			NewVars[0] = "ROLE=Administrator";
			return 0;
		} else {
			NewVars[0] = "ROLE=None";
			return 1;
		}
		
		...
	}
}


Site.wfs
<call> setAuthCookie()


web.xml
  <servlet>
    <description>WebFOCUS Servlet</description>
    <display-name>WFServlet</display-name>
    <servlet-name>WFServlet</servlet-name>
    <servlet-class>ibi.webfoc.WFServlet</servlet-class>
	<init-param>
		<param-name>WFEXT</param-name>
		<param-value>cookieInterpreter</param-value>
		<description>WebFocus servlet callable exit</description>
	</init-param>
    <load-on-startup>2</load-on-startup>  
  </servlet>

This message has been edited. Last edited by: Kerry,


WebFocus 7.7
Windows Server 2008 R2
HTML Reporting
 
Posts: 32 | Registered: September 19, 2011Report This Post
Guru
posted Hide Post
You should be able to deploy/undeploy using the Admin/Manager link on Tomcat.

Look at this post.
Deploy WAR file on Tomcat

Thanks,
Sayed


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
 
Posts: 285 | Location: Texas | Registered: June 27, 2006Report This Post
Silver Member
posted Hide Post
Sayed thanks for your response. However I'm still unsure on two things:
1) Is it the webfocus.war archive that I need?
2) Once the .war is re-deployed I understand it will be unpacked into a directory structure - is there any danger of this overwriting currently configuration files? I didn't deploy the current system and don't know what could break from the re-deploy.


WebFocus 7.7
Windows Server 2008 R2
HTML Reporting
 
Posts: 32 | Registered: September 19, 2011Report This Post
Guru
posted Hide Post
1)Yes, webfocus.war.
2)I'd backup the whole ibi directory or atleast ibi\webfocusXXX as a precaution.

Thanks,
Sayed


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
 
Posts: 285 | Location: Texas | Registered: June 27, 2006Report This Post
Silver Member
posted Hide Post
After re-deploying the .war and figuring out how to enable tracing I see the following in my trace:

ibi.webfoc.wfutil.WFAction_CALL.Invoke(WFScriptAction.java:1523):Could not load user class: my.namespace.wfservlet.cookieInterpreter

Since re-deploying the updated .war I can see my class in ibi\WebFOCUS77\webapps\webfocus\WEB-INF\classes. Can anyone confirm that this is the correct location?

Is it possible that I'm having a namespacing problem? The namespace of my class's package matches the fully-qualified path I used in the Administration Console's Configuration -> Plugin -> WFEXT value.

I have no idea where to go next and unfortunately the documentation is not helping. Any assistance would be greatly appreciated.


WebFocus 7.7
Windows Server 2008 R2
HTML Reporting
 
Posts: 32 | Registered: September 19, 2011Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by TomC:

ibi.webfoc.wfutil.WFAction_CALL.Invoke(WFScriptAction.java:1523):Could not load user class: my.namespace.wfservlet.cookieInterpreter

Since re-deploying the updated .war I can see my class in ibi\WebFOCUS77\webapps\webfocus\WEB-INF\classes. Can anyone confirm that this is the correct location?

If you are deploying this as a class, then it should be in ibi\WebFOCUS77\webapps\webfocus\WEB-INF\classes\my\namespace\wfservlet. classes must be deployed in a directory structure that matches the package name.

p.s. You should change your return types to a long ... 0L instead of 0, and 1L instead of 1.

This message has been edited. Last edited by: dhagen,


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Silver Member
posted Hide Post
Thanks dhagen that did the trick, now my class is being loaded as expected


WebFocus 7.7
Windows Server 2008 R2
HTML Reporting
 
Posts: 32 | Registered: September 19, 2011Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Custom wfext to enforce cookie-based security - how to load?

Copyright © 1996-2020 Information Builders