Parameter check against database value [message #1455383] |
Wed, 29 October 2014 10:04 |
Rene Kimmelmann Messages: 1 Registered: October 2014 |
Junior Member |
|
|
Hi BIRT experts
I would like to compare a database value to a parameter value.
I need to ensure that only authorized users can launch a report. In the database the encrypted password is stored. In a report parameter, the user enters his password. It has to be compared with the password in the database.
From the Data Set Query I get the password. How can I reference this in the password validation script of the report parameter?
In other words, how can I pass a value from the dataset to the report parameters?
Thanks a lot!
Example:
Query getUserCredentials:
SELECT
user AS userid
, pw AS password
FROM
SCHEMA.TABLE
WHERE
user = UPPER ('XYZ') ;
***********************************
Report Parameter '{}password' (it's a Text Box), script validate:
importPackage(Packages.blabla.bla);
var encrypt = new SecurityHelper().digest(params["password"].value); //SecurityHelper is a custom Java class that works fine.
var password = ***a the reference to <password> from getUserCredentials query***;
if (encrypt.equals(password))
{true}
else
{false};
|
|
|
Powered by
FUDForum. Page generated in 0.01631 seconds