v3.8.0
New Feature
Support of Digital Identity share service
Yoti Digital ID is now being upgraded!
We have a new API that is improving the sharing flow, for both end-users and integrators like you.
- share is now session based (must create a share session on the server, using the SDK)
- share session details (status, progress) can be fetched anytime
- can subscribe to share session events notification
- share data can be retrieved anytime until expiration of the receipt
This comes as a replacement of the Dynamic Sharing and Profile services combination.
⚠️ You must use the new browser client to fully integrate this new version with your front-end
📖 How to
Here are some snippets of basic use cases.
Create a Digital Identity Client:
DigitalIdentityClient client = DigitalIdentityClient.builder()
.withClientSdkId(clientSdkId) // Your Yoti Client SDK ID
.withKeyPairSource(pemKey) // The content of your Yoti .pem key
.build();
Create a share session:
Policy policy = Policy.builder()
.withFullName()
.withEmail()
// any other methods supported
.build();
/*
OR with a IdentityProfileRequirements
Map<String, Object> scheme = new HashMap<>();
scheme.put("type", "RTW");
Map<String, Object> identityProfile = new HashMap<>();
identityProfile.put("trust_framework", "UK_TFIDA");
identityProfile.put("scheme", scheme);
.withIdentityProfile(identityProfile)
*/
Map<String, Object> subject = new HashMap<>();
subject.put("subject_id", "this is a new share");
ShareSessionNotification notification = ShareSessionNotification.builder(URI.create("https://service.com/yoti-notifications"))
.withHeader("X-CUSTOM", "custom")
.withMethod("GET")
.withVerifyTls(true)
.build();
ShareSessionRequest shareSessionRequest = ShareSessionRequest.builder()
.withRedirectUri(URI.create("/profile"))
.withPolicy(policy)
.withSubject(subject)
.withNotification(notification)
// .withExtension(ExtensionBuilderByType)
.build();
ShareSession shareSession = client.createShareSession(shareSessionRequest);
// shareSession.getId()
// shareSession.getStatus()
// shareSession.getExpiry()
Get the receipt of a share session:
ShareSession session = client.fetchShareSession(sessionId);
String receiptId = session.getReceiptId();
Receipt receipt = client.fetchShareReceipt(receiptId);
// Checking error
receipt.getError();
// Assuming no error, getting profile
Optional<HumanProfile> profile = receipt.getProfile();
// profile.getSelfie()
// profile.getFullName()
// profile.getFamilyName()
// profile.getGivenNames()
// profile.getDateOfBirth()
// profile.getGender()
// profile.getNationality()
// profile.getPhoneNumber()
// profile.getEmailAddress()
// profile.getPostalAddress()
// profile.getStructuredPostalAddress()
// profile.getDocumentDetails()
// profile.getDocumentImages()
// profile.getIdentityProfileReport()
Demo
Share v2 demo available, when running the Java Spring Boot example project, at https://localhost:8443/v2/digital-identity-share