Symantec IGA

  • 1.  IDM BLTH Function Issue

    Posted Mar 01, 2018 10:37 AM

    I am getting a date field from AD during explore/correlate process and placing the date in a internal attribute.  However, the date is in the LDAP 18 character format that Microsoft uses.  I found a piece of Javascript that does the conversion and attempted to use it in a BLTH for the task.  When I use the task I am getting a function undefined message.  Here is the BLTH:

    function handleValidation(blthContext, errorMsg) {

    imapi=Packages.com.netegrity.llsdk6.imapi
    imsapi=Packages.com.netegrity.llsdk6.imsapi

    user = blthContext.getUser();

    var disable_date = user.getAttribute("imActivationDate");

    function ldapToJS(n) {

    // Longer, equivalent to short version
    // return new Date(n/1e4 + new Date(Date.UTC(1601,0,1)).getTime());

    // Shorter, more efficient. Uses time value for 1601-01-01 UTC
    return new Date(n/1e4 - 1.16444736e13);
    }


    var ADS_Date = ldapToJS(disable_date).toISOString();

    user.setAttribute("imExpirationDate",ADS_Date);


    return true;
    }

     

    Any thoughts would be appreciated.



  • 2.  Re: IDM BLTH Function Issue

    Broadcom Employee
    Posted Mar 02, 2018 02:33 PM

    Place the function ldapToJS outside of the handleValidation function scope



  • 3.  Re: IDM BLTH Function Issue

    Posted Mar 06, 2018 10:44 AM

    I have tried to move the function outside of the BLTH scope and have had no luck.  How do I get the function out of the scope?



  • 4.  Re: IDM BLTH Function Issue
    Best Answer

    Broadcom Employee
    Posted Mar 06, 2018 11:02 AM

    function handleValidation(blthContext, errorMsg) {    

       ...    

       var ADS_Date = ldapToJS(disable_date).toISOString();    

       ...

    }

    function ldapToJS(n) {

       ...

    }

     

    There are other Javascript (Rhinoscript) mechanisms you could use, such as functions as name spaces to achieve what you want, within the handleValidation method.