Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-16869 Improve Scripting documentation
  3. OPENAM-16654

Document auditEntryDetail object binding on scripted node

    XMLWordPrintable

    Details

    • Rank:
      1|hzk7kf:r

      Description

      Bug description

      7.0.0 contained feature to bind auditEntryDetail object to scripted decision node, allowing string/JSON entry that will arbitrarily be added to audit entries via script.

      How to reproduce the issue

      Example using Groovy node:

      var currentUser = sharedState.get("username");
      var attributeToRead = "mail";
      
      auditEntryDetail="Extra Audit: " + currentUser + " email address: " + idRepository.getAttribute(currentUser,attributeToRead).iterator().next().toString();
      
      outcome = "true";
      

      This will add an entry something like the following to the authentication.audit.json:

      {"_id":"f036618e-e318-4134-ac2a-13e860396103-545013","timestamp":"2020-08-13T18:20:25.202Z","eventName":"AM-NODE-LOGIN-COMPLETED","transactionId":"f036618e-e318-4134-ac2a-13e860396103-544998","trackingIds":["f036618e-e318-4134-ac2a-13e860396103-544956"],"principal":["demo"],"entries":[{"info":{"nodeOutcome":"true","treeName":"Example","displayName":"Audit Entry","nodeType":"ScriptedDecisionNode","nodeId":"13d40add-137c-4564-ad3c-7d98f7c180c1","authLevel":"0","nodeExtraLogging":

      {"auditInfo":"Extra Audit: demo email address: demo@example.com"}

      }}],"realm":"/","component":"Authentication"}

      This needs documenting under the scripted node API - https://backstage.forgerock.com/docs/am/7/authentication-guide/scripting-api-node.html

        Attachments

          Activity

            People

            Assignee:
            chris.lee Chris Lee
            Reporter:
            simon.moffatt Simon Moffatt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: