(thanks Leo for the clarification!)
We're hitting a clash between the java util Date impl and the built in javascript type
References to the java date type should work - if they are fully qualify. IE:
var myDate = new java.util.Date()
Another way to go is to consider using the built in javascript type:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Datewhich is what I've done and it works very well:
var myDate = Date.now();
Cheers,
Louis
------------------------------
Louis Beaudry
Access Management
Intact Financial Corporation
------------------------------
Original Message:
Sent: Tue February 16, 2021 09:24 AM
From: Louis Beaudry
Subject: error importing java.util.Date class
Hi everyone,
We are at ISAV 10.0.0.1
In an API protection mapping rule (pre & post token) I am trying to import java.util.Date:
importClass(Packages.java.util.Date);
I get the following error:
tivoli.am.fim.oauth20.protocol.delegates.OAuth20BaseDelegate I returnError com.ibm.security.access.javascript.JSCodeRuntimeException
Caused by: org.mozilla.javascript.EvaluatorException: Cannot import "Date" since a property by that name is already defined. (xxx-apiPreTokenGeneration#10)
I just need to instanciate a Date object. Any ideas?
------------------------------
Louis Beaudry
Access Management
Intact Financial Corporation
------------------------------