diff --git a/src/main/kotlin/id/walt/service/SSIKit2WalletService.kt b/src/main/kotlin/id/walt/service/SSIKit2WalletService.kt index d26ce81..7150d67 100644 --- a/src/main/kotlin/id/walt/service/SSIKit2WalletService.kt +++ b/src/main/kotlin/id/walt/service/SSIKit2WalletService.kt @@ -189,8 +189,7 @@ class SSIKit2WalletService(accountId: UUID, walletId: UUID) : WalletService(acco println("USING PRESENTATION REQUEST, SELECTED CREDENTIALS: $selectedCredentialIds") - val presentationSession = credentialWallet.initializeAuthorization(authReq, 60.seconds) - .copy(selectedCredentialIds = selectedCredentialIds.toSet()) + val presentationSession = credentialWallet.initializeAuthorization(authReq, 60.seconds, selectedCredentialIds.toSet()) println("Resolved presentation definition: ${presentationSession.authorizationRequest!!.presentationDefinition!!.toJSONString()}") diff --git a/src/main/kotlin/id/walt/service/oidc4vc/TestCredentialWallet.kt b/src/main/kotlin/id/walt/service/oidc4vc/TestCredentialWallet.kt index 70a5044..c6dfcee 100644 --- a/src/main/kotlin/id/walt/service/oidc4vc/TestCredentialWallet.kt +++ b/src/main/kotlin/id/walt/service/oidc4vc/TestCredentialWallet.kt @@ -32,6 +32,7 @@ import kotlinx.uuid.UUID import kotlinx.uuid.generateUUID import kotlin.io.encoding.Base64 import kotlin.io.encoding.ExperimentalEncodingApi +import kotlin.time.Duration import kotlin.time.Duration.Companion.minutes const val WALLET_PORT = 8001 @@ -245,4 +246,14 @@ class TestCredentialWallet( fun parsePresentationRequest(request: String): AuthorizationRequest { return resolveVPAuthorizationParameters(AuthorizationRequest.fromHttpQueryString(Url(request).encodedQuery)) } + + fun initializeAuthorization( + authorizationRequest: AuthorizationRequest, + expiresIn: Duration, + selectedCredentials: Set + ): VPresentationSession { + return super.initializeAuthorization(authorizationRequest, expiresIn).copy(selectedCredentialIds = selectedCredentials).also { + putSession(it.id, it) + } + } }