Integration
Last updated
Last updated
2023 © Caf. - All rights reserved
If your application does not request it in advance, Identity will request permission at the time it is needed for CAMERA
. If your policy uses location context, your application must request CORE_LOCATION
permission.
Permission | Reason | Required |
---|---|---|
First, create an object of type Identity
. This object is for you to configure all your business rules:
Parameter | Required |
---|---|
To authenticate a user, use the verifyPolicy
method. You must enter the user's CPF and the identifier of the policy to be used.
The attestation will be available after the user authentication.
Some errors can prevent Identity from running. To identify them, check the instance of the Failure
object class.
To check the error extension use error.errorDescription
inside you code after the error return.
You can also extends IdentityError
class, and customize the error messages that you want to use. Here is an example with default error messages.
Parameter | Required |
---|---|
Case | Status |
---|---|
instanceOf | Description | Example |
---|---|---|
AV_FOUNDATION (CAMERA)
Capturing the selfie in policies with facial re-authentication
No
CORE_LOCATION
Get data on policies with location context
Yes, if the policy uses localization context
String mobileToken
Usage token associated with your Identity account (see how to get it here).
Yes
String faceAuthToken
Token associated with your Trust account (see how to get it here).
Yes
.setStage(stage: CAFStage)
Allows you to choose the environment in wich the SDK will run (production, beta).
No. The default is .PROD
.setEmailUrl(url: String)
Used to redirect the user to a custom link in the outgoing Email flow.
No
.setPhoneUrl(url: String)
Used to redirect the user to a custom link in the SMS sending flow.
No
String personId
User CPF
Yes
String policyId
Policy identifier
Yes
No Registered face
False
Fraud or no match
False
User approved
True
PermissionReason
You are missing some mandatory permission
Start facial authentication without camera permission granted
AvailabilityReason
Identity is not available for use. The variable Failure.getMessage() contains instructions for the user
The device's internal storage is full when installing the app, and it is not possible to install the face detection template together
NetworkReason
Internet connection failure
The user was without internet during face authentication
ServerReason
When a requisition receives a status code of failure
In theory, it shouldn't happen. If you see something like this, let us know!
SecurityReason
When Identity cannot be started due to a security reason
When Google Security Provider is not updating
StorageReason
There is no space on the user device's internal storage
When there is no space on the internal storage while capturing the document photo
LibraryReason
When an internal library cannot be started
Forgetting to set noCompress configuration will lead to this failure in DocumentDetector
PolicyReason
You are using a policy that we do not yet support. The variable Failure.getMessage() contains instructions for the developer
Use a policy with localization context
GetLocationReason
The SDK could not get the device location
No GPS data available