@@ -44,8 +44,6 @@ import com.credman.cmwallet.openid4vp.OpenId4VPMatchedSdJwtClaims
44
44
import com.credman.cmwallet.pnv.maybeHandlePnv
45
45
import com.credman.cmwallet.sdjwt.SdJwt
46
46
import com.credman.cmwallet.toBase64UrlNoPadding
47
- import com.google.android.gms.identitycredentials.Credential
48
- import com.google.android.gms.identitycredentials.IntentHelper
49
47
import org.json.JSONArray
50
48
import org.json.JSONObject
51
49
@@ -135,10 +133,9 @@ fun createOpenID4VPResponse(
135
133
val response = openId4VPRequest.generateResponse(vpToken)
136
134
Log .d(TAG , " Returning $response " )
137
135
return DigitalCredentialResult (
138
- responseJsonLegacy = response,
139
136
authenticationTitle = authenticationTitle,
140
137
authenticationSubtitle = authenticationSubtitle,
141
- responseJsonModern = JSONObject ().apply {
138
+ responseJson = JSONObject ().apply {
142
139
put(" protocol" , openId4VPRequest.protocolIdentifier)
143
140
put(" data" , JSONObject (response))
144
141
}.toString()
@@ -263,7 +260,7 @@ class GetCredentialActivity : FragmentActivity() {
263
260
if (pnvResponse != null ) {
264
261
PendingIntentHandler .setGetCredentialResponse(
265
262
resultData,
266
- GetCredentialResponse (DigitalCredential (pnvResponse.responseJsonModern ))
263
+ GetCredentialResponse (DigitalCredential (pnvResponse.responseJson ))
267
264
)
268
265
setResult(RESULT_OK , resultData)
269
266
finish()
@@ -292,24 +289,9 @@ class GetCredentialActivity : FragmentActivity() {
292
289
override fun onAuthenticationSucceeded (result : BiometricPrompt .AuthenticationResult ) {
293
290
Log .d(TAG , " onAuthenticationSucceeded" )
294
291
295
- // This is a temporary solution until Chrome migrate to use
296
- // the top level DC DigitalCredential json structure.
297
- // Long term, this should be replaced by a simple
298
- // `PendingIntentHandler.setGetCredentialResponse(intent, DigitalCredential(response.responseJson))` call.
299
- IntentHelper .setGetCredentialResponse(
300
- resultData,
301
- com.google.android.gms.identitycredentials.GetCredentialResponse (
302
- Credential (
303
- DigitalCredential .TYPE_DIGITAL_CREDENTIAL ,
304
- Bundle ().apply {
305
- putByteArray(" identityToken" , response.responseJsonLegacy.toByteArray())
306
- }
307
- )
308
- )
309
- )
310
292
PendingIntentHandler .setGetCredentialResponse(
311
293
resultData,
312
- GetCredentialResponse (DigitalCredential (response.responseJsonModern ))
294
+ GetCredentialResponse (DigitalCredential (response.responseJson ))
313
295
)
314
296
315
297
setResult(RESULT_OK , resultData)
@@ -355,11 +337,9 @@ class GetCredentialActivity : FragmentActivity() {
355
337
}
356
338
357
339
data class DigitalCredentialResult (
358
- // New integration should no longer need this legacy setup
359
- val responseJsonLegacy : String ,
360
340
val authenticationTitle : CharSequence ,
361
341
val authenticationSubtitle : CharSequence? ,
362
- val responseJsonModern : String , // Now we need to include the full DigitalCredential (i.e. {"protocol": ..., "data": ...}
342
+ val responseJson : String ,
363
343
)
364
344
365
345
sealed class DigitalCredentialRequestOptions {
0 commit comments