-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDK-2371 added advanced identity profile to sharev1,example and updat… (
#359) * SDK-2371 added advanced identity profile to sharev1,example and updated tests * SDK-2371 updated test coverage info * SDK-2371 updated example page title
- Loading branch information
1 parent
d9442d5
commit f454c03
Showing
7 changed files
with
245 additions
and
6 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
examples/profile/app/Http/Controllers/AdvancedIdentityController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Routing\Controller as BaseController; | ||
use Yoti\ShareUrl\DynamicScenarioBuilder; | ||
use Yoti\ShareUrl\Policy\DynamicPolicyBuilder; | ||
use Yoti\YotiClient; | ||
|
||
class AdvancedIdentityController extends BaseController | ||
{ | ||
public function show(YotiClient $client) | ||
{ | ||
$advancedIdentityProfileJson = | ||
(object)[ | ||
"profiles" => [(object)[ | ||
|
||
"trust_framework" => "YOTI_GLOBAL", | ||
"schemes" => [(object)[ | ||
|
||
"label" => "identity-AL-L1", | ||
"type" => "IDENTITY", | ||
"objective" => "AL_L1" | ||
], | ||
[ | ||
"label" => "identity-AL-M1", | ||
"type" => "IDENTITY", | ||
"objective" => "AL_M1" | ||
] | ||
] | ||
] | ||
] | ||
] | ||
; | ||
|
||
$policy = (new DynamicPolicyBuilder()) | ||
->withAdvancedIdentityProfileRequirements($advancedIdentityProfileJson) | ||
->build(); | ||
|
||
$dynamicScenario = (new DynamicScenarioBuilder()) | ||
->withCallbackEndpoint("/profile") | ||
->withPolicy($policy) | ||
->withSubject((object)[ | ||
'subject_id' => "some_subject_id_string" | ||
]) | ||
->build(); | ||
|
||
return view('advanced', [ | ||
'title' => 'Advanced Identity Share Example', | ||
'buttonConfig' => [ | ||
'elements' => [ | ||
[ | ||
'domId' => 'yoti-share-button', | ||
'clientSdkId' => config('yoti')['client.sdk.id'], | ||
'shareUrl' => $client->createShareUrl($dynamicScenario)->getShareUrl(), | ||
'button' => [ | ||
'label' => 'Use Yoti', | ||
'align' => 'center', | ||
'width' => 'auto', | ||
'verticalAlign' => 'top' | ||
], | ||
'type' => 'modal' | ||
] | ||
] | ||
] | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
<html class="yoti-html"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<title>{{ $title }}</title> | ||
<link rel="stylesheet" type="text/css" href="assets/css/index.css"> | ||
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet"> | ||
</head> | ||
|
||
<body class="yoti-body"> | ||
<main> | ||
<section class="yoti-top-section"> | ||
<div class="yoti-logo-section"> | ||
<a href="https://www.yoti.com" target="_blank"> | ||
<img class="yoti-logo-image" src="assets/images/logo.png" srcset="assets/images/[email protected] 2x" alt="Yoti" /> | ||
</a> | ||
</div> | ||
|
||
<h1 class="yoti-top-header">{{ $title }}</h1> | ||
|
||
<div class="yoti-sdk-integration-section"> | ||
<div id="yoti-share-button"></div> | ||
</div> | ||
|
||
<div class="yoti-login-or-separator">or</div> | ||
|
||
<div class="yoti-login-dialog"> | ||
<h2 class="yoti-login-dialog-header">Login with your email:</h2> | ||
|
||
<input class="yoti-input" type="text" placeholder="Name" /> | ||
|
||
<input class="yoti-input" type="text" placeholder="Email address" /> | ||
|
||
<div class="yoti-login-actions"> | ||
<span class="yoti-login-forgot-button">forgot password?</span> | ||
|
||
<button class="yoti-login-button">login</button> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section class="yoti-sponsor-app-section"> | ||
<h3 class="yoti-sponsor-app-header">The Yoti app is free to download and use:</h3> | ||
|
||
<div class="yoti-store-buttons-section"> | ||
<a href="https://itunes.apple.com/us/app/yoti/id983980808?ls=1&mt=8" class="yoti-app-button-link"> | ||
<img src="assets/images/app-store-badge.png" srcset="assets/images/[email protected] 2x" alt="Download on the App Store" /> | ||
</a> | ||
|
||
<a href="https://play.google.com/store/apps/details?id=com.yoti.mobile.android.live" class="yoti-app-button-link"> | ||
<img src="assets/images/google-play-badge.png" srcset="assets/images/[email protected] 2x" alt="Yoti" alt="get it on Google Play" /> | ||
</a> | ||
</div> | ||
</section> | ||
</main> | ||
|
||
<script src="https://www.yoti.com/share/client/"></script> | ||
<script> | ||
window.Yoti.Share.init(@json($buttonConfig, JSON_PRETTY_PRINT)); | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.