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..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 @@ -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() @@ -201,12 +202,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..." + ] + } } }