Adding device profiling to an authentication API-based application using the PingOne Risk (Signals) SDK and integration kit 1.3.1
About this task
Use the following instructions to add device profiling to a web application using the PingOne Risk (Signals) SDK. Learn more about the authentication API in Authentication API in the PingFederate documentation or PingOne Risk Native SDKs in the PingOne Native SDK documentation.
PingOne Risk Integration Kit version 1.3.1 must be deployed before any changes can be made on the HTML side. SDK version 5.2.1 or later requires adapter version 1.3.1 or later. |
Steps
-
Implement the Signals SDK by following the steps in PingOne Risk Native SDKs.
-
Configure functions to format the device profile and submit it to the authentication API. Use the following code sample as a guide.
The
pingone-risk-profiling-signals-sdk.js
assumes you are using the web SDK. If using a mobile device and you want to send thedeviceProfile
check the SDK documentation and use accordingly.function onCompletion(flowId, deviceProfile) { submitDeviceProfile(flowId, deviceProfile); } function submitDeviceProfile(flowId, deviceProfile) { var myHeaders = new Headers(); myHeaders.append("X-XSRF-Header", "test"); myHeaders.append("Content-Type", "application/vnd.pingidentity.submitDeviceProfile+json"); var raw = JSON.stringify({ "signalsSdkDeviceProfile": deviceProfile }); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://pf_host:pf_port/pf-ws/authn/flows/" + flowId, requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error)); }
When the authentication API is in the
DEVICE_PROFILE_REQUIRED
state, your application shouldsubmitDeviceProfile
with the value from theprofileDevice(callback)
method. -
When you complete the steps in Configuring an adapter instance, set the Device profiling method to Captured by previous adapter.