Risk Assessment (SDK Layer)#

Risk-assessment integrations (BankID and similar) need device-context fields the framework attaches to outgoing HAAPI requests. the Curity Identity Server forwards those fields to the assessment service during flow steps that need them, so the service can require step-up authentication or deny the request based on the device context.

For the concept and security trade-offs, see Risk Assessment .

When to Use Risk Assessment#

Configure risk-assessment integration only when your deployment integrates with a risk-scoring authentication service — BankID is the most common case; the same mechanism applies to other vendors that consume device context.

Most apps do not need this configuration. The field collection adds device-context lookups at startup and per-request payload overhead. Skip it unless your authentication flow runs through an assessment service.

What Gets Collected#

The framework collects four fields once at startup and attaches them to every HAAPI request:

FieldiOS sourceAndroid source
Operating system nameUIDevice.current.systemName (returns "iOS" on iPhone and iPad)always "Android"
Operating system versionUIDevice.current.systemVersion (for example, "17.4.1")Build.VERSION.RELEASE
Device model nameUIDevice.current.deviceModelName (see notes below)Build.MODEL
Application identifierBundle.main.bundleIdentifier!applicationContext.packageName

The Curity SDK forwards these to the Curity Identity Server on every flow request; the server proxies the relevant fields to the configured risk-assessment provider.

Configuration#

Build RiskAssessmentConfiguration on the main thread — typically in AppDelegate.application(_:didFinishLaunchingWithOptions:) — because UIDevice is main-actor-isolated:

let riskAssessmentConfiguration = RiskAssessmentConfiguration(
    operatingSystemName: UIDevice.current.systemName,
    operatingSystemVersion: UIDevice.current.systemVersion,
    deviceModelName: UIDevice.current.deviceModelName,
    applicatonIdentifier: Bundle.main.bundleIdentifier!
)

let haapiConfiguration = HaapiConfiguration(
    // ...other configuration
    riskAssessmentConfiguration: riskAssessmentConfiguration
)

operatingSystemNameUIDevice.current.systemName returns the system name string (typically "iOS").

operatingSystemVersionUIDevice.current.systemVersion returns the major.minor.patch string (for example, "17.4.1").

deviceModelNameUIDevice.current.deviceModelName is not a standard UIDevice property; it is a Curity-recommended extension that resolves the machine identifier (for example, "iPhone15,3") to a human-readable model name (for example, "iPhone 14 Pro Max"). If you don’t have that extension, fall back to UIDevice.current.model, which returns the device class ("iPhone", "iPad") — coarser, but informative for the risk-assessment service.

applicatonIdentifier — the app’s bundle identifier (Bundle.main.bundleIdentifier!). The parameter name is misspelled in the SDK (missing the second i in “application”); type it verbatim to compile. The misspelling is preserved for binary compatibility and may be corrected in a future major release.

Server-Side Prerequisites#

For the SDK’s device-context fields to reach a risk-assessment service, the server must be set up:

  • the Curity Identity Server version 9.7.0 or later — earlier versions do not support the risk-assessment forwarding protocol.
  • A configured risk-assessment integration at the Curity profile level — BankID’s risk-assessment functionality, or another vendor’s equivalent. The integration carries the upstream risk-service URL, threshold settings, and auth-step bindings.
  • An authentication flow that includes a risk-assessment step. Risk assessment fires only at specific points in the flow (typically before high-value steps); flows without those steps do not invoke it even when the client-side fields are configured.

Refer to the official BankID Relying Party Guidelines for version 6 for the upstream service requirements and acceptance criteria.

On Android, set android:allowBackup="true" (the default) in AndroidManifest.xml so the persisted device context survives backup-and-restore. Without it, fresh installs after factory reset or device migration lose context history that some risk-assessment integrations rely on for continuity.

Was this helpful?