Skip to content

Commit

Permalink
bug fix: Fixed id for other credential other than EBSIV2
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Aug 9, 2023
1 parent 1ab5f4a commit 621f0f6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {
case CredentialSubjectType.residentCard:
return 'ResidentCard';
case CredentialSubjectType.employeeCredential:
//return 'EmployeeCredential';
return 'https://raw.githubusercontent.com/walt-id/waltid-ssikit-vclib/master/src/test/resources/schemas/ParticipantCredential.json';
return 'EmployeeCredential';
case CredentialSubjectType.selfIssued:
return 'SelfIssued';
case CredentialSubjectType.studentCard:
Expand Down
9 changes: 6 additions & 3 deletions lib/oidc4vc/add_oidc4vc_credential.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ Future<void> addOIDC4VCCredential(

newCredential['credentialPreview'] = credentialFromOIDC4VC;

/// added id as type to recognise the card
newCredential['credentialPreview']['credentialSubject']['type'] =
credentialFromOIDC4VC['credentialSchema']['id'];
if (oidc4vcType == OIDC4VCType.EBSIV2) {
/// added id as type to recognise the card
/// for ebsiv2 only
newCredential['credentialPreview']['credentialSubject']['type'] =
credentialFromOIDC4VC['credentialSchema']['id'];
}

final CredentialManifest credentialManifest = await getCredentialManifest(
Dio(),
Expand Down
2 changes: 2 additions & 0 deletions lib/oidc4vc/initiate_oidv4vc_credential_issuance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ Future<void> getAndAddCredential({
privateKey,
);

print(encodedCredentialFromOIDC4VC);

await addOIDC4VCCredential(
encodedCredentialFromOIDC4VC,
uriFromScannedResponse,
Expand Down

0 comments on commit 621f0f6

Please sign in to comment.