Skip to Content

Configuration

SladeIDConfig

Top-level SDK configuration.

data class SladeIDConfig( val serviceUrl: String, val auth: AuthConfig, val encryptBiometrics: Boolean = true, )
  • serviceUrl — base URL of the Slade ID service (e.g. https://id.example.com/api/v1).
  • auth — an AuthConfig supplying request headers.
  • encryptBiometrics — when true (the default), images are encrypted before transmission; set false to send base64.

FingerprintReaderCaptureConfig

Per-session capture tuning. See Tune capture quality.

data class FingerprintReaderCaptureConfig( val captureTimeoutSeconds: Int = 30, // must be > 0 val dpi: Int? = null, // must be 1..4000 when set )
  • captureTimeoutSeconds — seconds the vendor capture call blocks polling for a quality frame before failing.
  • dpi — scanner resolution sent with enroll/verify/search so the Slade ID service tunes its matching thresholds. null uses the capture-modality default.

AuthConfig

A fun interface returning the headers the Slade ID service expects.

fun interface AuthConfig { suspend fun getHeaders(): Map<String, String> }

Return { "Authorization": "Bearer <token>" }. The SDK adds the device identifier itself.

val auth = AuthConfig { mapOf("Authorization" to "Bearer ${backend.freshToken()}") }

ClientCredentialsAuth

An AuthConfig that runs the OAuth2 client_credentials grant on-device, caches the token, and refreshes proactively before expiry.

class ClientCredentialsAuth( clientId: String, clientSecret: String, tokenUrl: String = DEFAULT_TOKEN_URL, // defaults to the Slade ID identity service scope: String? = null, refreshSkewSeconds: Long = 30, ) : AuthConfig
  • clientId / clientSecret — your integrator credentials. The secret lives in the app process — acceptable for a device/kiosk, not for untrusted clients.
  • tokenUrl — the token endpoint of the Slade ID identity service; override per environment.
  • scope — optional OAuth scope.
  • refreshSkewSeconds — refresh this many seconds before expiry (default 30).
  • invalidate() — drop the cached token so the next call re-mints (e.g. after a hard 401).

See Authentication.