Skip to content

Commit

Permalink
fix ClientConsent creation due to new api
Browse files Browse the repository at this point in the history
  • Loading branch information
phisakel committed Sep 27, 2024
1 parent bf1e434 commit b97c79a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/EudiWalletKit/Services/OpenId4VpService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: "$")} ))

This comment has been minimized.

Copy link
@thomasnymand

thomasnymand Oct 8, 2024

Seems as if this change left out the "apu" header necessary for validating the document signature? Has this been moved somewhere else?

.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))
Expand Down

0 comments on commit b97c79a

Please sign in to comment.