AppAttestationClient

class AppAttestationClient(context: Context, deviceId: String, googleCloudProjectId: Long, integrityManager: StandardIntegrityManager = createStandard(context), remoteAccessConsumerKeyProvider: RemoteAccessConsumerKeyProvider, restClient: RestClient)

App attestation features supporting the Salesforce App Attestation External Client App (ECA) Plugin, the Salesforce Challenge API, Google Play Integrity API and integration of app attestation with Salesforce Authentication.

This method is not intended for public use outside of Salesforce Mobile SDK.

TODO: Make this class internal once Java support is removed. ECJ20260421

Parameters

deviceId

The device id, usually provided by the Salesforce SDK Manager

googleCloudProjectId

The Google Cloud Project ID used with Google Play Integrity API

integrityManager

The Google Play App Integrity API Integrity Manager. This parameter is intended for testing purposes only. Defaults to a new instance

remoteAccessConsumerKeyProvider

Provides the Salesforce External Client App (ECA) remote access consumer key, usually sourced from the boot config

restClient

The REST client, usually provided by the Salesforce SDK Manager's unauthenticated REST client

Constructors

Link copied to clipboard
constructor(context: Context, deviceId: String, googleCloudProjectId: Long, integrityManager: StandardIntegrityManager = createStandard(context), remoteAccessConsumerKeyProvider: RemoteAccessConsumerKeyProvider, restClient: RestClient)

Functions

Link copied to clipboard
suspend fun createAppAttestation(appAttestationChallenge: String, integrityTokenProvider: StandardIntegrityManager.StandardIntegrityTokenProvider? = this.integrityTokenProvider, canRetryOnInvalidTokenProvider: Boolean = true): String?

Creates a Salesforce App Attestation External Client App (ECA) Plugin "attestation". First a Salesforce Mobile App Attestation "Challenge" is requested for the device id. Then, a Google Play Integrity API Token is fetched using the "Challenge" as the Request Hash. The resulting token is encoded into a value usable as the "attestation" parameter in the Salesforce OAuth authorization request.

Link copied to clipboard
fun createAppAttestationBlocking(appAttestationChallenge: String): String?

A blocking Java-callable wrapper for createAppAttestation

Fetches a new "Challenge" from the Salesforce App Attestation External Client App (ECA) Plug-In.