XmBindIdSdk

XmBindIdSdk

Entry point interface to the BindID Client SDK.

@objc(XmBindIdSdk)
public class XmBindIdSdk : NSObject, Codable

This interface declares all top level services supported by the SDK. An instance of this interface is available to client applications as window.XmBindId.

Before the BindID SDK can be used, the {@link XmBindIdSdk.initialize} call must be invoked, with proper configuration for the client application using BindID.

Inheritance

Codable, NSObject

Properties

shared

public static let shared: XmBindIdSdk

Methods

initialize(config:completion:)

Initialize the BindID Client SDK and set application-wide configuration.

public func initialize(config: XmBindIdConfig, completion: ((Bool?, XmBindIdError?) -> ())?)

All BindID Client SDK calls must be invoked only after succesful completion of this asynchornous initialization call.

The returned promise will either be resolved with a boolean 'true' value, or rejected with an error.

@param config Application-wide BindID Client SDK configuration.

  • @param handler

authenticate(bindIdRequestParams:completion:)

Invoke a BindID authentication flow.

public func authenticate(bindIdRequestParams: XmBindIdAuthenticationRequest, completion: ((XmBindIdResponse?, XmBindIdError?) -> ())?)

This call will start a user login flow using BindID. The browser will be redirected to BindID's login page, where user identity will be established. Once complete, BindID will redirect the user back to the invoking web/mobile application based on the URL provided in the authentication request parameters, sending back authentication result information.

If invoked by a web application, the web application should invoke #processRedirectResponse to extract the information returned in the response and complete the authentication process.

The returned Promise will either be rejected with an error, or never complete (since this call may redirect the user agent to another page).

@param bindIdRequestParams Authentication request object.

  • @param handler

authenticateBoundUser(bindIdRequestParams:completion:)

Invoke a BindID authentication flow using native mobile biometrics. This call will start a user login flow using BindID only if native biometric authentication can be performed; otherwise, an error will be returned.

public func authenticateBoundUser(bindIdRequestParams: XmBindIdBoundUserAuthenticationRequest, completion: ((XmBindIdResponse?, XmBindIdError?) -> ())?)

The native flow comprises only of providing a biometric sample (e.g., fingerprint), and is not available when other actions are required to process the authentication request (e.g., for new device registration using FIDO2 biometrics).

Once complete, BindID will redirect the user back to the invoking mobile application based on the URL provided in the authentication request parameters, sending back authentication result information.

@param bindIdRequestParams Bound user authentication request object.

  • @param handler

signTransaction(bindIdTransactionRequest:completion:)

Invoke BindID authentication flow for transaction signing.

public func signTransaction(bindIdTransactionRequest: XmBindIdTransactionSigningRequest, completion: ((XmBindIdResponse?, XmBindIdError?) -> ())?)

This request will behave similarly to an authentication request, with the following additions:

OIDC claims parameter will be added to the request to indicate the BindID server that this is a transaction signing request. By default the request will be sent as an encrypted JWT. BindID server will show the transaction details to the user. BindID server will include the transaction claim in the id_token upon successful authentication and token exchange.

@param bindIdTransactionRequest Transaction request object.

  • @param handler

exchangeToken(exchangeRequest:completion:)

Invoke a PKCE token exchange using the BindID SDK. The response will include the ID and access tokens.

public func exchangeToken(exchangeRequest: XmBindIdExchangeTokenRequest, completion: ((XmBindIdExchangeTokenResponse?, XmBindIdError?) -> ())?)

@param exchangeRequest Exchange token request object.

  • @param handler