PingOne DaVinci

Prev Next

Integrate Darwinium with PingOne DaVinci to assess sign-in attempts before authentication completes. Darwinium supplies a risk decision; your DaVinci flow uses it to continue authentication, deny access, or require additional verification.

For coverage across your website, start with a CDN deployment. This guide describes a JavaScript tags and Event API integration inside a DaVinci sign-on flow, using the standard HTTP, Functions, Variables, and Flow Conductor connectors.

The example uses an HTTP Custom HTML Template login form. PingOne Forms and native SDK interfaces need their own profiling implementation. The screenshots show an inspected reference configuration; the instructions add input validation and explicit error routing. Validate the resulting flow with your application before enabling enforcement.

How the integration works

  1. The sign-on page loads Darwinium profiling and starts a profiling instance.
  2. When the user submits the form, JavaScript places the collected blob in a hidden field named dwnProfileBlob.
  3. The Darwinium Login attempt node invokes a subflow with the username, blob, and administrator-configured API destination.
  4. The subflow calls the Darwinium Event API over mutual TLS, then returns dwnResult and dwnIdentifier.
  5. The parent flow branches on dwnResult. A pass continues credential validation and existing authentication requirements.
  6. After the authentication outcome is known, an Update API call can attach that outcome to the original event using dwnIdentifier.

Integration sequence: browser profiling, DaVinci assessment subflow, risk routing, authentication, and outcome feedback

Darwinium Login attempt is a label for a Flow Conductor node. It is not a separate Darwinium connector that you install. In the inspected flow, it calls a subflow named Darwinium using Invoke Subflow. That subflow has three nodes:

Node Connector and capability Purpose
call darwinium HTTP → Make REST API Call Submit the username and profiling blob for assessment.
darwinium result Functions → Custom Function Read the decision and event identifier from the response.
Http HTTP → Send Success JSON Response Return both values to the parent flow.

The reference Darwinium subflow calls the API, extracts its result, and returns JSON

“Success” on the final subflow node means it returned a result. That result can still be reject. The parent must inspect dwnResult before allowing authentication to complete.

Before you start

Prepare:

  • A working DaVinci sign-on flow, a test application, and test users.
  • Permission to edit flows and import a client key pair into the same PingOne environment.
  • A deployed Darwinium profiling script, its JavaScript variable name, and a deployed login Event API step.
  • Your Darwinium API base URL and a signed client certificate with access to the target node and required services.
  • A decision strategy with agreed result labels. This guide uses lowercase pass, reject, and optionally challenge.
  • A copy of the existing flow and a known working deployed version to restore.

Use a working authentication flow as the starting point. This integration adds risk assessment; application registration, credential validation, sessions, and final authentication responses remain part of that flow.

1. Prepare Darwinium

In your Darwinium journey, deploy a profiling endpoint and an Event API step for the login attempt. Confirm that the step runs your intended decision strategy and returns outcome.CHAMPION.decision_strategy.result. If your deployment uses another outcome, adjust the response parser accordingly.

Use the step's API helper to confirm the destination and request shape. The example values below are placeholders:

Setting Example Used by
API base URL https://your-host.node.darwinidentity.com:9443 DaVinci HTTP nodes
Profiling script URL https://profile.customer.com/dwn_profiling.js The browser
JavaScript variable name dwn The form's profiling script
Journey name customer_signon Event and update URLs
Event API step name login_attempt The assessment subflow
Update API step name, if used login_verify Authentication outcome feedback

The journey name is the deployed journey_name, which can differ from the journey filename. Use the API host assigned to your node; the profiling host serves a different purpose. See JavaScript tags and the Event API.

2. Configure mutual TLS in PingOne

Obtain a Darwinium-signed client certificate and its CA chain using Certificates & API access. Generate the private key locally, upload the certificate signing request to Darwinium, and assign the required node/service permissions.

If you have PEM files, package the signed client certificate, matching private key, and supplied chain for import:

openssl pkcs12 -export \
  -inkey darwinium-client.key \
  -in darwinium-client.crt \
  -certfile darwinium-ca-chain.pem \
  -name darwinium-api \
  -out darwinium-api.p12

OpenSSL prompts for the necessary passwords. Keep the key and package in your approved credential store.

In PingOne, open Settings → Certificates and Key Pairs → Key Pairs → + → Import Key Pair. Import the package, select SSL/TLS as the usage type, enter its password, and save. See Ping's key pair import instructions.

On every Darwinium Make REST API Call node, select this key under MTLS Support. Keep Ignore TLS Errors off. A certificate imported without its private key cannot authenticate the outbound call. Plan certificate rotation for both assessment and feedback nodes.

HTTP connector MTLS Support with a configured client key and Ignore TLS Errors disabled; key identifier redacted

3. Set the parent flow's configuration variables

Add a Variables → Flow Instance Variable node before the sign-on form and name it Darwinium Input variables. Create these String variables:

Variable Value
dwnAPIURL Your API base URL, without a trailing slash.
dwnProfilingScriptUrl The deployed profiling script URL.
dwnJSVariableName The JavaScript variable exported by that script, such as dwn.
dwnJourneyName Your deployed journey name.
dwnStepName Your login Event API step name.

Connect initialization to the flow's actual entry path so it completes before Sign On. Also check values inherited from the environment's Variables tab: a value visible in an unexecuted initialization node does not prove the runtime uses it.

These configuration values must be controlled by administrators. Do not accept an API URL, journey destination, or client certificate selection from the submitted login form.

4. Collect profiling on the sign-on form

Open Sign On → General in the HTTP node using Custom HTML Template. The example assumes a form with id="signonForm", username and password inputs with matching IDs, and a sign-on SK button with id="btnSignIn" and data-skbuttonvalue="SIGNON".

Add this field inside the form's HTML:

<input type="hidden" id="dwnProfileBlob" name="dwnProfileBlob" value="">

In Output Fields List, add a field with Property Name dwnProfileBlob, Control Type Text Field, and Data Type String. Leave its default value empty. Keep the existing username, password, and button outputs. Enable Secure for the profiling blob and password; review username handling under your logging policy. See using connectors securely.

The sign-on template exposes dwnProfileBlob as a String output field

Add the following to the node's Script, alongside existing form behavior. It starts profiling when the library loads, collects before the sign-on button is processed, and releases the instance when the form is removed. Replace the selectors if your HTML differs.

// Add to the Sign On HTTP node's Script, alongside existing form behavior.
// These two placeholders must resolve to administrator-controlled variables.
(() => {
  const form = document.getElementById("signonForm");
  const button = document.getElementById("btnSignIn");
  const field = document.getElementById("dwnProfileBlob");
  if (!form || !button || !field) return;
  window.dwnSignOnCleanup?.();

  const scriptUrl = "{{global.variables.dwnProfilingScriptUrl}}";
  const libraryName = "{{global.variables.dwnJSVariableName}}";
  let instance;
  let disposed = false;
  let script;

  const collect = () => {
    field.value = "";
    try {
      const blob = instance?.tryCollect();
      if (typeof blob === "string") field.value = blob;
    } catch { /* An empty blob follows the server's error path. */ }
  };
  const start = () => {
    if (disposed || !form.isConnected) return;
    try {
      instance = window[libraryName].start({
        geo_location_enabled: false,
        mouse: true,
        key_bm: [
          { selector: "#username", context: "LOGIN" },
          { selector: "#password", context: "PASSWORD" }
        ]
      });
    } catch { field.value = ""; }
  };

  // Capture before the SK button serializes the form. Also cover submission
  // through the form's submit event; test Enter with your deployed renderer.
  button.addEventListener("click", collect, true);
  form.addEventListener("submit", collect, true);
  const observer = new MutationObserver(() => {
    if (!form.isConnected) window.dwnSignOnCleanup?.();
  });
  window.dwnSignOnCleanup = () => {
    disposed = true;
    observer.disconnect();
    button.removeEventListener("click", collect, true);
    form.removeEventListener("submit", collect, true);
    try { instance?.stop(); } catch { /* No profiling data is logged. */ }
    if (script) { script.onload = null; script.onerror = null; }
  };
  observer.observe(document.body, { childList: true, subtree: true });
  if (window[libraryName]?.start) start();
  else {
    script = document.createElement("script");
    script.src = scriptUrl;
    script.onload = start;
    script.onerror = () => { field.value = ""; };
    document.head.appendChild(script);
  }
})();

tryCollect() returns the data currently available without waiting for every profiling operation. A fast submission may contain less data. Test click, Enter, validation failures, and repeated sign-on attempts with the renderer used by your application. An unavailable library leaves the field empty; the server-side input check below handles that case.

Allow the profiling script and its required collection endpoints in the applicable Content Security Policy. Follow the deployment's profiling requirements, including script-src, connect-src, and worker permissions where required. Confirm the response is JavaScript, not an error page or redirect to a login page.

The raw password stays with the existing PingOne credential validation. It is not mapped to the Darwinium request body or subflow inputs.

5. Build the Darwinium assessment subflow

Create a flow named Subflow – Darwinium assessment. Leave PingOne Flow disabled for this reusable subflow. It performs backend work and is called using Flow Conductor → Invoke Subflow.

Define the inputs

Open Input Schema and add these String parameters. Make all five required for this implementation:

Parameter Meaning
journeyName Deployed Darwinium journey.
stepName Login Event API step.
dwnAPIUrl API base URL. Note the exact casing.
dwnProfileBlob Blob submitted by the sign-on form.
username Username submitted in this attempt.

Inside the subflow, access them as {{global.parameters.parameterName}}. The reference screenshot's subflow is named Darwinium; select the name you create when wiring your parent flow.

Prepare the request

Before the HTTP call, add Functions → Custom Function named Prepare Darwinium request. Add String inputs username and dwnProfileBlob, mapped from the corresponding global parameters. Use:

// DaVinci Functions > Custom Function.
// Inputs: username (String), dwnProfileBlob (String).
module.exports = async ({ params }) => {
  if (typeof params.username !== "string" || !params.username.trim() ||
      typeof params.dwnProfileBlob !== "string" || !params.dwnProfileBlob.trim()) {
    throw new Error("Darwinium assessment input is missing");
  }
  return {
    requestBody: JSON.stringify({
      identity: { ACCOUNT: { login: { login: params.username } } }
    })
  };
};

Set its Output Schema to:

{"output":{"type":"object","properties":{"requestBody":{"type":"string"}}}}

Connect success to the API call. Route failure to the assessment error return described below. This extra node validates missing input and uses JSON.stringify so quotation marks and backslashes in usernames cannot break the JSON request.

Call the Event API

Add HTTP → Make REST API Call, named call darwinium. Configure:

Field Value
URL {{global.parameters.dwnAPIUrl}}/api/event/{{global.parameters.journeyName}}/{{global.parameters.stepName}}
HTTP Method POST
Headers Content-Type: application/json; Accept: application/json; dwn-profiling: {{global.parameters.dwnProfileBlob}}
Body raw
Raw request body Insert Prepare Darwinium request → output → requestBody using the variable picker, without adding quotes around it.
Success Response Content Type application/json
MTLS Support Your imported Darwinium client key.
Ignore TLS Errors Off.
Block Redirects On for this fixed API destination.
Timeout (ms) An explicit value within your sign-on latency budget; for example, 3000 after validation.

The resulting request body is:

{
  "identity": {
    "ACCOUNT": {
      "login": { "login": "user@customer.com" }
    }
  }
}

The Event API node uses POST with the journey and step parameters and maps dwnProfileBlob to the dwn-profiling header

The blob is sent in a request header. It is neither a risk decision nor an authentication credential. The API call executes in DaVinci with the selected client certificate. See the HTTP connector reference.

Extract the decision

After the HTTP call's successful path, add Functions → Custom Function, named darwinium result. Use the variable picker to create:

Input Type Source
callStatus Number call darwinium → output → rawResponse → statusCode
callBody String, or Object if the connector exposes parsed JSON call darwinium → output → rawResponse → body

The following handles either a JSON string or an already parsed body:

// DaVinci Functions > Custom Function.
// Inputs: callStatus (Number), callBody (HTTP rawResponse.body).
module.exports = async ({ params }) => {
  const error = { dwnResult: "error", dwnIdentifier: "" };
  if (!Number.isInteger(params.callStatus) ||
      params.callStatus < 200 || params.callStatus >= 300) return error;
  try {
    const body = typeof params.callBody === "string"
      ? JSON.parse(params.callBody) : params.callBody;
    const result = body?.outcome?.CHAMPION?.decision_strategy?.result;
    const identifier = body?.identifier;
    if (!["pass", "reject", "challenge"].includes(result) ||
        typeof identifier !== "string" || !identifier.trim()) return error;
    return { dwnResult: result, dwnIdentifier: identifier };
  } catch {
    return error;
  }
};

This reads the same decision path as the reference flow and adds checks for response status, shape, and permitted values. Set the function's Output Schema, and the flow's More Options → Output Schema, to:

{
  "output": {
    "type": "object",
    "properties": {
      "dwnResult": { "type": "string" },
      "dwnIdentifier": { "type": "string" }
    }
  }
}

Return the result to the parent

End the successful assessment path with HTTP → Send Success JSON Response. Under Additional Properties List, add:

Key Value from darwinium result
dwnResult output.dwnResult
dwnIdentifier output.dwnIdentifier

Disable Return Request Parameters so the returned response contains only the intended outputs. The Additional Properties Name field does not wrap these values when this node is used in a subflow: the parent accesses them directly under its invocation node's payload.output.

The final HTTP node maps the parsed dwnResult and dwnIdentifier into its Additional Properties List

Create a second JSON response node named Return assessment error with static values dwnResult = error and dwnIdentifier = "". Route input-validation failure, HTTP failure/timeout, and parser failure to it. A parsed invalid response also returns error. The response node's success status only means the subflow returned; the parent denies the error value.

Save the subflow and validate its routes. Record the tested subflow version.

6. Add “Darwinium Login attempt” to the parent

After the form submission, branch on the sign-on button value. On the SIGNON path, insert Flow Conductor → Invoke Subflow and give it the display name Darwinium Login attempt.

Select the assessment subflow. For Flow Version, use the version you tested. -1 selects the latest version; the inspected reference uses that setting. Pinning a version makes subsequent subflow changes easier to control.

Configure these input mappings using the variable picker:

Subflow input Parent source
journeyName Flow Instance Variables → dwnJourneyName
stepName Flow Instance Variables → dwnStepName
dwnAPIUrl Flow Instance Variables → dwnAPIURL
dwnProfileBlob Sign On → output → dwnProfileBlob
username Sign On → output → username

Darwinium Login attempt invokes the Darwinium subflow with configuration variables and form outputs

DaVinci creates node-specific references such as {{local.NODE_ID.payload.output.dwnResult}}. Choose the preceding node in the picker so the ID belongs to your flow. Do not copy node IDs from screenshots.

Route the decision

After the invocation's success path, add Functions → A == B (Multiple Conditions). Set Value A to Darwinium Login attempt → output → dwnResult, use String, enable Case Sensitive, and add exact values pass and reject.

The reference Functions node compares dwnResult with the exact pass and reject strings

Result Required route for this guide
pass Continue user lookup, password validation, and existing authentication requirements.
reject End with the application's authentication failure response.
challenge, if implemented Validate credentials, require the configured additional factor, and complete authentication only after success.
No Match, including error, missing values, or an unimplemented challenge End with authentication failure.
Invocation failure End with authentication failure.

Connect No Match and the invocation's failure path explicitly. This guide chooses denial when an assessment is unavailable. If your service requires a different outage policy, define and test it explicitly; keep an outage distinct from a genuine Darwinium pass.

The reference flow includes pass and reject only. To support challenge, add the exact comparison and a real MFA route; a decision label alone does not perform MFA. Preserve any MFA already required on the normal sign-on path.

For a PingOne redirect flow, finish with the appropriate PingOne Authentication success/error response nodes. For a widget or API flow, use that integration's completion responses and make the application honor failure. Keep the reusable assessment subflow separate from the final application authentication response. See DaVinci flow triggers.

Registration, password recovery, passwordless sign-in, social sign-in, and existing-session paths need their own coverage decisions. Placing this node on SIGNON protects that branch only.

7. Report the authentication outcome

The assessment occurs before credential validation. Report the final outcome to Darwinium so a risk pass with an incorrect password is not recorded as a successful login.

Deploy an Update API step, for example login_verify, in your Darwinium journey. Its trigger must use api_name: UPDATE. Configure rules on that step to read an input such as custom.general_purpose.login_status and set the corresponding event type:

Input status Rule action
success Set event_type to account_login_success.
failed Set event_type to account_login_failed.

Add HTTP feedback nodes using the same mTLS key and JSON headers:

POST {API_BASE_URL}/api/update/{JOURNEY_NAME}/{UPDATE_STEP_NAME}/{dwnIdentifier}

For a fully completed successful login, send:

{"custom":{"general_purpose":{"login_status":"success"}}}

For a failed login, send the same structure with "failed". Obtain the identifier from Darwinium Login attempt → output → dwnIdentifier. Skip feedback when assessment failed before producing an identifier.

Send event_type changes through the Update step's rule; do not put this non-input attribute directly in the request body. Updates enrich an existing event and do not perform a new risk assessment. See the Update API.

Place success feedback after all required authentication checks, including MFA and account-state checks. Choose a retry mechanism for feedback failures that does not turn a denied login into success or unnecessarily delay authentication. Do not add arbitrary delays to make updates appear reliable; verify availability of the returned event identifier and retry transient failures within a bounded policy.

8. Verify and deploy

Save and Validate Flow, then deploy the intended parent and subflow versions in your test environment. Confirm the application's flow policy points to the intended parent. Use Try Flow to inspect the form, then test through the real application entry point as well.

First verify that the profiling script returns JavaScript and that a nonempty dwnProfileBlob reaches the subflow. Inspect only the presence and length of the blob; avoid copying it into logs. Correlate the returned dwnIdentifier with the event in Darwinium.

Use test-only strategy rules to exercise each result, then restore your intended decision strategy:

Test Expected result
Valid credentials + pass Existing requirements complete and the application signs in.
Invalid credentials + pass Authentication fails; no success feedback.
Valid credentials + reject Authentication fails without a successful session or token.
challenge MFA is mandatory if implemented; otherwise the attempt is denied.
Failed or cancelled MFA No successful authentication result.
Empty blob, blocked script, or very fast submission The defined input/error route runs; no automatic pass.
API timeout, invalid certificate, or non-2xx response Assessment error reaches the parent failure path.
Missing, malformed, or unexpected decision No Match or error path denies the attempt.
Username containing quotes or backslashes Valid JSON reaches Darwinium with the intended username.
Click, Enter, retry, and back navigation Each attempt uses profiling from the current form lifecycle.
Success/failure feedback The same event identifier receives the correct final outcome.
Existing session and other application entry points Their authentication behavior matches the coverage you intended.

Review Analytics with sensitive fields scrubbed. Check both the chosen DaVinci branch and the final application result: a successful subflow response or HTTP status alone does not prove successful authentication or enforcement. Promote the tested versions and retain your previous application flow-policy mapping for rollback.

Troubleshooting

Symptom Check
Script blocked by Chrome or profiling object undefined Actual runtime script URL, response status and MIME type, redirects, CSP, and the configured JavaScript variable name.
Editor and runtime use different configuration Whether the initialization node executes, inherited variable values, selected flow version, and the application's flow-policy mapping.
Blob exists in the browser but is absent in the subflow Hidden field name, Output Fields List, collection timing, and the parent mapping.
HTTP call fails before a response API hostname/port, key pair in the correct PingOne environment, certificate permissions/expiry, and MTLS Support selection.
dwnResult is unavailable in the parent picker Function output schema, subflow output schema, response field mappings, and selected subflow version.
Every result becomes error or No Match HTTP status input type, JSON parsing, configured outcome path, exact casing, and decision values.
Success feedback appears for failed logins Feedback connected before credential, MFA, or account-state checks have finished.
Update does not change the event type Update step deployment, identifier, input status mapping, and the rule that sets event_type.

For support, provide the parent/subflow versions, redacted node mappings, transaction time, and event identifier. Exclude passwords, private keys, tokens, and raw profiling blobs.