Skip to content

Commit

Permalink
SDK-2386 updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmet-yoti committed Nov 13, 2023
1 parent 6457d5c commit 0c4a6b9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
8 changes: 8 additions & 0 deletions _examples/idv/handlers.session.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,11 @@ func showPrivacyPolicyPage(c *gin.Context) {
render(c, gin.H{}, "privacy.html")
return
}

func showErrorPage(c *gin.Context) {
render(c, gin.H{
"ErrorTitle": "Error Code",
"ErrorMessage": c.Request.URL.Query().Get("yotiErrorCode")},
"error.html")
return
}
8 changes: 5 additions & 3 deletions _examples/idv/models.sessionspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) {
WithErrorUrl("https://localhost:8080/error").
WithPrivacyPolicyUrl("https://localhost:8080/privacy-policy").
WithIdDocumentTextExtractionGenericAttempts(2).
WithAllowHandOff(true).
Build()
if err != nil {
return nil, err
Expand Down Expand Up @@ -158,7 +159,7 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) {

sessionSpec, err = create.NewSessionSpecificationBuilder().
WithClientSessionTokenTTL(600).
WithResourcesTTL(86400).
WithResourcesTTL(87000).
WithUserTrackingID("some-tracking-id").
WithRequestedCheck(faceMatchCheck).
WithRequestedCheck(documentAuthenticityCheck).
Expand Down Expand Up @@ -203,7 +204,8 @@ func buildDBSSessionSpec() (sessionSpec *create.SessionSpecification, err error)
identityProfile := []byte(`{
"trust_framework": "UK_TFIDA",
"scheme": {
"type": "RTW"
"type": "DBS",
"objective": "BASIC"
}
}`)

Expand All @@ -221,7 +223,7 @@ func buildDBSSessionSpec() (sessionSpec *create.SessionSpecification, err error)

sessionSpec, err = create.NewSessionSpecificationBuilder().
WithClientSessionTokenTTL(600).
WithResourcesTTL(86400).
WithResourcesTTL(87000).
WithUserTrackingID("some-tracking-id").
WithSDKConfig(sdkConfig).
WithIdentityProfileRequirements(identityProfile).
Expand Down
1 change: 1 addition & 0 deletions _examples/idv/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ func initializeRoutes() {
router.GET("/success", showSuccessPage)
router.GET("/media", getMedia)
router.GET("/privacy-policy", showPrivacyPolicyPage)
router.GET("/error", showErrorPage)
}
2 changes: 2 additions & 0 deletions _examples/profile/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
YOTI_SCENARIO_ID=
YOTI_CLIENT_SDK_ID=
YOTI_KEY_FILE_PATH=
# Optional configuration
YOTI_API_URL=

0 comments on commit 0c4a6b9

Please sign in to comment.