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.
}
CoroutineScope(Dispatchers.IO).launch {
try {
// verifiedIdentity: result of the last verification attempt.
val verifiedIdentity = identityVerificationClient.checkIdentityVerification()
if (verifiedIdentity.verified) {
when (verifiedIdentity.verificationMethod) {
is VerificationMethod.KNOWLEDGE_OF_PII -> {
// provide access to regulated service
}
is VerificationMethod.GOVERNMENT_ID -> {
// perhaps provide a different level of service, e.g. higher
// entitlements
}
}
}
} catch (e: SudoIdentityVerificationException) {
// Handle errors.
}
}
try {
const verifiedIdentity = await identityVerificationClient.checkIdentityVerification()
if (verifiedIdentity.verified) {
// Identity was verified succcessfully.
switch (verifiedIdentity.verificationMethod) {
case VerificationMethod.KnowledgeOfPII:
// provide access to regulated service
break
case VerificationMethod.GovernmentID:
// perhaps provide a different level of service, e.g. higher
// entitlements
break
}
} else {
// Identity could not be verified.
}
}
catch (err) {
// Handle errors
}
The checkIdentityVerification
API returns the same information as the verifyIdentity
, verifyIdentityDocument
and captureAndVerifyIdentityDocument
APIs.
Last updated