Check Secure ID Verification Status

To check the identity verification status of a user, such as to determine if verification is required:

do {
    let verifiedIdentity = try await identityVerificationClient.checkIdentityVerification(option: .remoteOnly)
    if verifiedIdentity.verified {
        // Identity was verified succcessfully.
        switch verifiedIdentity.verificationMethod {
        case VerificationMethod.knowledgeOfPii:
            // provide access to regulated service
        case VerificationMethod.governmentId:
            // perhaps provide a different level of service, e.g. higher 
            // entitlements
        }
    } else {
        // Identity could not be verified.
    }
} catch let error {
    // Handle error. An error may be thrown if the backend is unable to perform
    // requested operation due to availability or security issues.
    // An error might be also be thrown for unrecoverable circumstances arising
    // from programmatic error or configuration error. For example, if the keychain
    // access entitlement is not set up correctly or basic system resources are
    // unavailable.
}

The checkIdentityVerification API returns the same information as the verifyIdentity and verifyIdentityDocument APIs.

Last updated