Authentication

Running SmartSelfie™ Authentication (Authentication) on Flutter

  1. Create a Callback Endpoint

  2. Get your user's Selfie & ID Card images

  3. Submit the Job to Smile ID

  4. Authenticate the user

  5. Interpret your results

Authenticate a User

The SmartSelfie™ Authentication entails comparing a SmartSelfie™ against the Selfie on file of a registered user. To register a user, the job request payload is exactly the same as a SmartSelfie™ Authentication except for two differences (both changes are to be made in the Making a Job Request section of this page):

  1. Since you are authenticating the user, you need an existing user_id (details of Key in Making a Job Request of a user previously successfully enrolled on the Smile ID system)

  2. Set the job_type to "2" (details of Key in Making a Job Request section of this page)

Get the User's Selfie

To successfully run Enhanced KYC + SmartSelfie™ jobs you need to submit the user's selfie.Please see SmartSelfie capture as specified here, it is important to recognise that the tag supplied and or returned from this is what will need to be used to submit the Job

Submit the Job to Smile ID

var partnerParams = HashMap<String, String>();
partnerParams["user_id"] = <User ID>;
partnerParams["job_id"] = <Job ID>;

Step 2: Optional Set Geo Information

var geoInfo = HashMap<String, String>();
geoInfo["altitude"] = <Altitude>;// a string value of a latitude
geoInfo["longitude"] = <Longitude>;// a string value of a longitude

Step 3: Submit the Job

 var submitResult = await SmileFlutter.submitJob( String tag,
      int jobType,
      bool isProduction,
      String callBackUrl,
      Map<String, String>? partnerParams,
      Map<String, String>? idInfo,
      Map<String, String>? geoInfo);
  • jobType should be set to 2 and is required

  • isProduction (required)should be set to true if you intent to run in production and false if you intend to run in sandbox, it is important to note you cannot run real ID Numbers check on sandbox, for test data please see here

  • callBackUrl (Optional)can be null but if not it should be a url which the job data will be posted to depending on the status the job is in

  • partnerParams (Optional)This is the object create in the step above related to partner params

  • idInfo (Required)This is the object create in the step above related to user id information

  • geoInfo (Optional) This is any information that may be necessary to associate the job with any geolocation

Step 4: Interpret your results

The result hashmap will be an object which will contain results returned from the api this contains strongly typed method to get the response as individual items or as json object or as a string, for more information on how to interpret results you can read more about result codes and responses in the SmartSelfie™ Authentication section of the docs.

Last updated