From e55915cfe618ef4fb380dfc5d6d15893a454cdfe Mon Sep 17 00:00:00 2001 From: Niharika Arora <40764403+niharika2810@users.noreply.github.com> Date: Mon, 10 Aug 2026 11:56:21 +0530 Subject: [PATCH 1/3] Enhance JSON response example in VerifiedEmailFunctions Updated example JSON response to include protocol and nested vp_token structure. --- .../credentialmanager/VerifiedEmailFunctions.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt b/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt index 72e4058c3..840210207 100644 --- a/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt +++ b/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt @@ -201,12 +201,15 @@ class VerifiedEmailFunctions( /* // Example of the raw JSON response from credential.credentialJson: { - "vp_token": { - // This key matches the 'id' you set in your dcql_query - "user_info_query": [ - // The SD-JWT string (Issuer JWT ~ Disclosures ~ Key Binding JWT) - "eyJhbGciOiJ...~WyI...IiwgImVtYWlsIiwgInVzZXJAZXhhbXBsZS5jb20iXQ~...~eyJhbGciOiJ..." - ] + "protocol": "openid4vp-v1-unsigned", + "data": { + "vp_token": { + // This key matches the 'id' you set in your dcql_query + "user_info_query": [ + // The SD-JWT string (Issuer JWT ~ Disclosures ~ Key Binding JWT) + "eyJhbGciOiJ...~WyI...IiwgImVtYWlsIiwgInVzZXJAZXhhbXBsZS5jb20iXQ~...~eyJhbGciOiJ..." + ] + } } } From b0b8998b86cfad65751667d0b67eed1a9fed2de9 Mon Sep 17 00:00:00 2001 From: Niharika Arora <40764403+niharika2810@users.noreply.github.com> Date: Mon, 10 Aug 2026 12:02:20 +0530 Subject: [PATCH 2/3] Fix JSON parsing to access vp_token correctly --- .../identity/credentialmanager/VerifiedEmailFunctions.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt b/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt index 840210207..ea9ce033b 100644 --- a/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt +++ b/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt @@ -105,7 +105,8 @@ class VerifiedEmailFunctions( // [START_EXCLUDE] // 1. Parse the outer JSON wrapper to get the `vp_token` val responseData = JSONObject(responseJsonString) - val vpToken = responseData.getJSONObject("vp_token") + val dataObject = responseData.getJSONObject("data") + val vpToken = dataObject.getJSONObject("vp_token") // 2. Extract the raw SD-JWT string val credentialId = vpToken.keys().next() From f6ec3f6586406a7e4da2d78131a1f9f373c792a9 Mon Sep 17 00:00:00 2001 From: Niharika Arora <40764403+niharika2810@users.noreply.github.com> Date: Wed, 12 Aug 2026 13:22:15 +0530 Subject: [PATCH 3/3] Indentation correction --- .../credentialmanager/VerifiedEmailFunctions.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt b/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt index ea9ce033b..0d7895516 100644 --- a/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt +++ b/identity/credentialmanager/src/main/java/com/example/identity/credentialmanager/VerifiedEmailFunctions.kt @@ -202,13 +202,13 @@ class VerifiedEmailFunctions( /* // Example of the raw JSON response from credential.credentialJson: { - "protocol": "openid4vp-v1-unsigned", - "data": { - "vp_token": { - // This key matches the 'id' you set in your dcql_query - "user_info_query": [ - // The SD-JWT string (Issuer JWT ~ Disclosures ~ Key Binding JWT) - "eyJhbGciOiJ...~WyI...IiwgImVtYWlsIiwgInVzZXJAZXhhbXBsZS5jb20iXQ~...~eyJhbGciOiJ..." + "protocol": "openid4vp-v1-unsigned", + "data": { + "vp_token": { + // This key matches the 'id' you set in your dcql_query + "user_info_query": [ + // The SD-JWT string (Issuer JWT ~ Disclosures ~ Key Binding JWT) + "eyJhbGciOiJ...~WyI...IiwgImVtYWlsIiwgInVzZXJAZXhhbXBsZS5jb20iXQ~...~eyJhbGciOiJ..." ] } }