Skip to content

Commit

Permalink
Updated examples /examples/idv-identity-checks to use advanced identi…
Browse files Browse the repository at this point in the history
…ty profile (to be reviewed)
  • Loading branch information
laurent-yoti committed Jun 20, 2024
1 parent fac999f commit 27b08a5
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion examples/idv-identity-checks/src/controllers/index.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ const {
IDVClient,
SessionSpecificationBuilder,
SdkConfigBuilder,
AdvancedIdentityProfileBuilder,
AdvancedIdentityProfileRequirementsBuilder,
AdvancedIdentityProfileSchemeBuilder,
} = require('yoti');
const config = require('../../config');

Expand All @@ -23,12 +26,47 @@ async function createSession() {
},
};

const advancedIdentityProfileSchemeDBS = new AdvancedIdentityProfileSchemeBuilder()
.withType('DBS')
.withObjective('BASIC')
.withLabel('lalala-DBS')
.build();

const advancedIdentityProfileSchemeRTW = new AdvancedIdentityProfileSchemeBuilder()
.withType('RTW')
.withLabel('lalala-RTW')
.build();

const advancedIdentityProfileUKTFIDA = new AdvancedIdentityProfileBuilder()
.withTrustFramework('UK_TFIDA')
.withScheme(advancedIdentityProfileSchemeDBS)
.withScheme(advancedIdentityProfileSchemeRTW)
.build();

const advancedIdentityProfileSchemeYGI = new AdvancedIdentityProfileSchemeBuilder()
.withType('IDENTITY')
.withObjective('AL_L1')
.withLabel('my-idendity-AL-L1')
.build();

const advancedIdentityProfileYotiGlobal = new AdvancedIdentityProfileBuilder()
.withTrustFramework('YOTI_GLOBAL')
.withScheme(advancedIdentityProfileSchemeYGI)
.withScheme(advancedIdentityProfileSchemeRTW)
.build();

const advancedIdentityProfileRequirements = new AdvancedIdentityProfileRequirementsBuilder()
.withProfile(advancedIdentityProfileUKTFIDA)
.withProfile(advancedIdentityProfileYotiGlobal)
.build();

const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(600) // 10 minutes
.withResourcesTtl(90000) // session TTL(10 minutes) + 24 hours(minimum required)
.withUserTrackingId('some-user-tracking-id')
.withSubject(subject)
.withIdentityProfileRequirements(identityProfileRequirements)
// .withIdentityProfileRequirements(identityProfileRequirements)
.withAdvancedIdentityProfileRequirements(advancedIdentityProfileRequirements)
.withSdkConfig(
new SdkConfigBuilder()
.withPrimaryColour('#2d9fff')
Expand All @@ -37,6 +75,7 @@ async function createSession() {
.withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`)
.withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`)
.withAllowHandoff(true)
.withAllowsCameraAndUpload()
.build()
)
.build();
Expand Down

0 comments on commit 27b08a5

Please sign in to comment.