From 6ae1278eee8ce5808b20ee98d8d5a3da1c34143c Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Wed, 24 Jul 2024 12:29:31 +0100 Subject: [PATCH] Added-example-for-DBS-and-updated-failure-details --- .../app/Http/Controllers/DbsController.php | 71 +++++++++++++++ .../views/advancedidentity.blade.php | 2 +- .../resources/views/dbs.blade.php | 89 +++++++++++++++++++ .../resources/views/identity.blade.php | 2 +- examples/digitalidentity/routes/web.php | 2 + .../resources/views/advanced.blade.php | 2 +- .../profile/resources/views/dbs.blade.php | 2 +- 7 files changed, 166 insertions(+), 4 deletions(-) create mode 100644 examples/digitalidentity/app/Http/Controllers/DbsController.php create mode 100644 examples/digitalidentity/resources/views/dbs.blade.php diff --git a/examples/digitalidentity/app/Http/Controllers/DbsController.php b/examples/digitalidentity/app/Http/Controllers/DbsController.php new file mode 100644 index 00000000..8c31533d --- /dev/null +++ b/examples/digitalidentity/app/Http/Controllers/DbsController.php @@ -0,0 +1,71 @@ + [(object)[ + + "trust_framework" => "UK_TFIDA", + "schemes" => [(object)[ + + "label" => "identity-AL-L1", + "type" => "DBS", + "objective"=> "BASIC" + ], + [ + "label" => "identity-AL-M1", + "type" => "DBS", + "objective" => "BASIC" + ] + ] + ] + ] + ] + ; + + $policy = (new PolicyBuilder()) + ->withAdvancedIdentityProfileRequirements((object)$advancedIdentityProfileJson) + ->build(); + + $redirectUri = 'https://host/redirect/'; + + $shareSessionRequest = (new ShareSessionRequestBuilder()) + ->withPolicy($policy) + ->withRedirectUri($redirectUri) + ->build(); + $session = $client->createShareSession($shareSessionRequest); + return $session->getId(); + } + catch (\Throwable $e) { + Log::error($e->getTraceAsString()); + throw new BadRequestHttpException($e->getMessage()); + } + } + public function show(DigitalIdentityClient $client) + { + try { + return view('dbs', [ + 'title' => 'Digital Identity DBS Check Example', + 'sdkId' => $client->id + ]); + } catch (\Throwable $e) { + Log::error($e->getTraceAsString()); + throw new BadRequestHttpException($e->getMessage()); + } + } +} diff --git a/examples/digitalidentity/resources/views/advancedidentity.blade.php b/examples/digitalidentity/resources/views/advancedidentity.blade.php index 289e9e1e..fbe60828 100644 --- a/examples/digitalidentity/resources/views/advancedidentity.blade.php +++ b/examples/digitalidentity/resources/views/advancedidentity.blade.php @@ -84,6 +84,6 @@ function onErrorListener(...data) { await Yoti.ready() await onReadyToStart() } - + diff --git a/examples/digitalidentity/resources/views/dbs.blade.php b/examples/digitalidentity/resources/views/dbs.blade.php new file mode 100644 index 00000000..0f525dd3 --- /dev/null +++ b/examples/digitalidentity/resources/views/dbs.blade.php @@ -0,0 +1,89 @@ + + + + + + + {{ $title }} + + + + + +
+
+
+ + Yoti + +
+

Digital Identity DBS Ckeck Example

+ +
+
+
+ +
+ +
+

The Yoti app is free to download and use:

+ +
+ + Download on the App Store + + + + get it on Google Play + +
+
+
+ + + + diff --git a/examples/digitalidentity/resources/views/identity.blade.php b/examples/digitalidentity/resources/views/identity.blade.php index de3cd057..c09c2c47 100644 --- a/examples/digitalidentity/resources/views/identity.blade.php +++ b/examples/digitalidentity/resources/views/identity.blade.php @@ -84,6 +84,6 @@ function onErrorListener(...data) { await Yoti.ready() await onReadyToStart() } - + diff --git a/examples/digitalidentity/routes/web.php b/examples/digitalidentity/routes/web.php index 44933279..3fb377e7 100644 --- a/examples/digitalidentity/routes/web.php +++ b/examples/digitalidentity/routes/web.php @@ -18,3 +18,5 @@ Route::get('/generate-session', 'IdentityController@generateSession'); Route::get('/generate-advanced-identity-share', 'AdvancedIdentityController@show'); Route::get('/generate-advanced-identity-session', 'AdvancedIdentityController@generateSession'); +Route::get('/generate-dbs-share', 'DbsController@show'); +Route::get('/generate-dbs-session', 'DbsController@generateSession'); \ No newline at end of file diff --git a/examples/profile/resources/views/advanced.blade.php b/examples/profile/resources/views/advanced.blade.php index f158d88b..fb6856d2 100644 --- a/examples/profile/resources/views/advanced.blade.php +++ b/examples/profile/resources/views/advanced.blade.php @@ -56,7 +56,7 @@ - + diff --git a/examples/profile/resources/views/dbs.blade.php b/examples/profile/resources/views/dbs.blade.php index f158d88b..fb6856d2 100644 --- a/examples/profile/resources/views/dbs.blade.php +++ b/examples/profile/resources/views/dbs.blade.php @@ -56,7 +56,7 @@ - +