diff --git a/Sources/EudiWalletKit/Services/OpenId4VpService.swift b/Sources/EudiWalletKit/Services/OpenId4VpService.swift index 75aa6ea..2cff369 100644 --- a/Sources/EudiWalletKit/Services/OpenId4VpService.swift +++ b/Sources/EudiWalletKit/Services/OpenId4VpService.swift @@ -129,7 +129,7 @@ public class OpenId4VpService: PresentationService { fileprivate func SendVpToken(_ vpTokenStr: String?, _ pd: PresentationDefinition, _ resolved: ResolvedRequestData, _ onSuccess: ((URL?) -> Void)?) async throws { let consent: ClientConsent = if let vpTokenStr { - .vpToken(vpToken: .msoMdoc(vpTokenStr, apu: mdocGeneratedNonce.base64urlEncode), presentationSubmission: .init(id: UUID().uuidString, definitionID: pd.id, descriptorMap: pd.inputDescriptors.filter { $0.formatContainer?.formats.contains(where: { $0["designation"].string?.lowercased() == "mso_mdoc" }) ?? false }.map { DescriptorMap(id: $0.id, format: "mso_mdoc", path: "$")} )) + .vpToken(vpToken: .init(verifiablePresentations: [.generic(vpTokenStr)]), presentationSubmission: .init(id: UUID().uuidString, definitionID: pd.id, descriptorMap: pd.inputDescriptors.filter { $0.formatContainer?.formats.contains(where: { $0["designation"].string?.lowercased() == "mso_mdoc" }) ?? false }.map { DescriptorMap(id: $0.id, format: "mso_mdoc", path: "$")} )) } else { .negative(message: "Rejected") } // Generate a direct post authorisation response let response = try AuthorizationResponse(resolvedRequest: resolved, consent: consent, walletOpenId4VPConfig: getWalletConf(verifierApiUrl: openId4VpVerifierApiUri, verifierLegalName: openId4VpVerifierLegalName))