Skip to content

Commit

Permalink
Merge pull request #2 from cbarberis/master
Browse files Browse the repository at this point in the history
use score intead of BandText to pass/fail verification
  • Loading branch information
Firesphere authored Jul 5, 2016
2 parents 3caed63 + 820d0ae commit 24ef3c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
5 changes: 5 additions & 0 deletions src/Identity/Identity.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ class Identity {
*/
const IDENTITY_BAND_ALERT = 'Alert';

/**
* Minimum score to pass verification
*/
const IDENTITY_SCORE_PASS = 2022;

/**
* @var \ID3Global\Identity\PersonalDetails
*/
Expand Down
18 changes: 7 additions & 11 deletions src/Service/GlobalAuthenticationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,17 @@ public function verifyIdentity()

$validResult = false;

if(isset($response) && isset($response->AuthenticateSPResult) && isset($response->AuthenticateSPResult->BandText)) {
$validStatuses = array(
Identity::IDENTITY_BAND_PASS,
Identity::IDENTITY_BAND_REFER,
Identity::IDENTITY_BAND_ALERT
);

if(in_array($response->AuthenticateSPResult->BandText, $validStatuses)) {
$validResult = true;
}
if(
isset($response) &&
isset($response->AuthenticateSPResult) &&
isset($response->AuthenticateSPResult->BandText) && isset($response->AuthenticateSPResult->Score)
) {
$validResult = true;
}

if($validResult) {
$this->lastVerifyIdentityResponse = $response;
return $response->AuthenticateSPResult->BandText;
return $response->AuthenticateSPResult->Score;
} else {
throw new IdentityVerificationFailureException($response);
}
Expand Down

0 comments on commit 24ef3c5

Please sign in to comment.