Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/utils/oid4vc-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent
agentContext,
authorization,
}) => {
const requestedFormat = credentialConfiguration.format as string
const issuanceMetadata = issuanceSession.issuanceMetadata
if (!issuanceMetadata?.['credentials']) throw new Error('credential payload is not provided')

Expand Down Expand Up @@ -98,7 +99,13 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent
)
}

if (credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtDc) {
// Both `dc+sd-jwt` and `vc+sd-jwt` are signed with the same sd-jwt API. Credo's
// OpenId4VcIssuerService accepts `ClaimFormat.SdJwtDc` sign options for either
// configuration format and passes the format through as the credential `typ` header.
if (
credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtDc ||
credentialConfiguration.format === OpenId4VciCredentialFormatProfile.SdJwtVc
) {
return handleSdJwtDcFormat(
agentContext,
credentialConfiguration,
Expand All @@ -125,7 +132,7 @@ export function getMixedCredentialRequestToCredentialMapper(): OpenId4VciCredent
) as any
}

throw new Error('Invalid request format ' + credentialConfiguration.format)
throw new Error('Invalid request format ' + requestedFormat)
}
}

Expand Down
Loading