Академический Документы
Профессиональный Документы
Культура Документы
We need to implement a security mechanism for the birt report so that if session
is expired than we should not be able to run the report and user authentiction
should also be done before opening the report.
Solution –
I have created a prameter jsp page for the Birt report as i have already mentioned
in my previous post (How to build a custom Parameter Jsp Page for Birt Report Using
Birt Viewer tags)
From this jsp a report would be generated so we need to implement security for this
report.
* Pass the encrypted data (user name, report name and hour) and user name in jsp
session.
* In the report, we have user name so here also create encrypted message for user
name, report name and hour.
* Compare these two encrypted data and if these two values are same then only show
report content.
Create encrypted(MD5) data in your application to set this in the jsp session.
In your servelt-
<%
session.setAttribute(“data”, request.getAttribute(“data”));
session.setAttribute(“user”, request.getAttribute(“user”));
%>
In the report –
beforeFactory method of your report use the following script – In this scripts we
are fetching data from the session of HTTP request and creating md5 encryption of
the data. Then these values are bsing set in the Global Variables of the report to
access in the generation and presentation phase of the Birt report.
In the report, Now you can hide any element by adding the following script in the
visibility property of the element.
(reportContext.getPersistentGlobalVariable(“serverKey”) !=
reportContext.getPersistentGlobalVariable(“localKey”))
Advertisements
REPORT THIS AD
Advertisements
REPORT THIS AD
Share this:
TwitterFacebook
This entry was posted on Thursday, May 19th, 2011 at 10:16 am and is filed under
Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Reply
Todd Smith says:
February 22, 2012 at 5:40 am
I am not getting any session info in my beforeFactory method.
Reply
Todd smith says:
February 23, 2012 at 12:02 am
Sees like the session are in diffrent contexts
Reply
Leave a Reply
Enter your comment here...
CATEGORIES
Categories
EMAIL SUBSCRIPTION
Enter your email address to subscribe to this blog and receive notifications of new
posts by email.
Sign me up!
REPORT THIS AD
Blog at WordPress.com.
:)