示例#1
0
        /// <summary>
        /// Identify biometric
        /// </summary>
        /// <param name="template">Templte or image</param>
        /// <param name="token"></param>
        /// <param name="format">Format value needs only for FingerPrint operation</param>
        public string Identify(string template, string token, string format = CloudABISConstant.CLOUDABIS_ISO)
        {
            CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest
            {
                BiometricXml = template,
                CustomerKey  = _customerKey,
                EngineName   = _engineName,
                Format       = format,
                Token        = token
            };
            CloudABISAPI      cloudABISAPI     = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl);
            CloudABISResponse matchingResponse = cloudABISAPI.Identify(biometricRequest);

            if (matchingResponse != null)
            {
                if (matchingResponse.OperationName.Equals(EnumOperationName.Identify) && matchingResponse.OperationResult.Equals(CloudABISConstant.MATCH_FOUND))
                {
                    return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult) + ": " + matchingResponse.BestResult.ID);
                }
                else
                {
                    return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult));
                }
            }
            else
            {
                return("Something went wrong!");
            }
        }
示例#2
0
        /// <summary>
        /// Update existing employee/person biometric data
        /// </summary>
        /// <param name="template">Templte or image</param>
        /// <param name="registrationid"></param>
        /// <param name="token"></param>
        /// <param name="format">Format value needs only for FingerPrint operation</param>
        public string Update(string template, string registrationid, string token, string format = CloudABISConstant.CLOUDABIS_ISO)
        {
            CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest
            {
                RegistrationID = registrationid,
                BiometricXml   = template,
                CustomerKey    = _customerKey,
                EngineName     = _engineName,
                Format         = format,
                Token          = token
            };
            CloudABISAPI      cloudABISAPI     = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl);
            CloudABISResponse matchingResponse = cloudABISAPI.Update(biometricRequest);

            if (matchingResponse != null)
            {
                if (matchingResponse.OperationName.Equals(EnumOperationName.Register) && matchingResponse.OperationResult.Equals(CloudABISConstant.SUCCESS))
                {
                    return("Update Biometric Success!");
                }
                else
                {
                    return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult));
                }
            }
            else
            {
                return("Something went wrong!");
            }
        }
示例#3
0
        /// <summary>
        /// Is Registered
        /// </summary>
        /// <param name="id"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        public string IsRegister(string id, string token)
        {
            CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest
            {
                RegistrationID = id,
                CustomerKey    = _customerKey,
                EngineName     = _engineName,
                Token          = token
            };
            CloudABISAPI      cloudABISAPI     = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl);
            CloudABISResponse matchingResponse = cloudABISAPI.IsRegistered(biometricRequest);

            if (matchingResponse != null)
            {
                return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult));
            }
            else
            {
                return("Something went wrong!");
            }
        }
示例#4
0
 private static bool InitCloudABIS()
 {
     //It could be coming from database, app configuration file or a secured source
     _cloudABISAPICredentials = new CloudABISAPICredentials
     {
         BaseAPIURL  = "https://demo-fp.cloudabis.com/v1/",
         AppKey      = "059d8c941ced41a4b11769908f237b31",
         SecretKey   = "eNssBOV0dBxGCJDQaZrrVkzbwns=",
         CustomerKey = "1B2E60DA116D47E9B31AEFB0E5663A04"
     };
     //Init CloudABIS API
     _cloudABISAPI   = new CloudABISAPI(_cloudABISAPICredentials.AppKey, _cloudABISAPICredentials.SecretKey, _cloudABISAPICredentials.BaseAPIURL);
     _cloudABISToken = _cloudABISAPI.GetToken();
     if (!string.IsNullOrEmpty(_cloudABISToken.AccessToken))
     {
         return(true);
     }
     else
     {
         Console.WriteLine("CloudABIS token getting failed: " + _cloudABISToken.ErrorDescription);
         return(false);
     }
 }
示例#5
0
        /// <summary>
        /// Verify existing employee/person biometric data
        /// </summary>
        /// <param name="template">Templte or image</param>
        /// <param name="verifyID"></param>
        /// <param name="token"></param>
        /// <param name="format">Format value needs only for FingerPrint operation</param>
        public string Verify(string template, string verifyID, string token, string format = CloudABISConstant.CLOUDABIS_ISO)
        {
            CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest
            {
                RegistrationID = verifyID,
                BiometricXml   = template,
                CustomerKey    = _customerKey,
                EngineName     = _engineName,
                Format         = format,
                Token          = token
            };
            CloudABISAPI      cloudABISAPI     = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl);
            CloudABISResponse matchingResponse = cloudABISAPI.Verify(biometricRequest);

            if (matchingResponse != null)
            {
                return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult));
            }
            else
            {
                return("Something went wrong!");
            }
        }
示例#6
0
        /// <summary>
        /// Returns api token if given credentails is correct
        /// </summary>
        /// <returns></returns>
        public CloudABISToken GetCloudABISToken()
        {
            CloudABISAPI cloudABISAPI = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl);

            return(cloudABISAPI.GetToken());
        }