Skip to content

Commit

Permalink
feat: Use didkey instead of random string and change parameter #2122
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Nov 27, 2023
1 parent 79bf3cc commit 79caef2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lib/dashboard/profile/cubit/profile_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,10 @@ class ProfileCubit extends Cubit<ProfileState> {
);
final ebsiV3Profile = ProfileModel.EbsiV3();
final profileModel = state.model.copyWith(
isDeveloperMode: ebsiV3Profile.isDeveloperMode,
isEbsiV3Profile: enabled,
enableSecurity: ebsiV3Profile.enableSecurity,
enable4DigitPINCode: ebsiV3Profile.enable4DigitPINCode,
enableJWKThumbprint: ebsiV3Profile.enable4DigitPINCode,
enableJWKThumbprint: ebsiV3Profile.enableJWKThumbprint,
enableCryptographicHolderBinding:
ebsiV3Profile.enableCryptographicHolderBinding,
didKeyType: ebsiV3Profile.didKeyType,
Expand All @@ -466,11 +465,10 @@ class ProfileCubit extends Cubit<ProfileState> {
json.decode(customProfileBackupValue) as Map<String, dynamic>,
);
final profileModel = state.model.copyWith(
isDeveloperMode: customProfileBackup.isDeveloperMode,
isEbsiV3Profile: enabled,
enableSecurity: customProfileBackup.enableSecurity,
enable4DigitPINCode: customProfileBackup.enable4DigitPINCode,
enableJWKThumbprint: customProfileBackup.enable4DigitPINCode,
enableJWKThumbprint: customProfileBackup.enableJWKThumbprint,
enableCryptographicHolderBinding:
customProfileBackup.enableCryptographicHolderBinding,
didKeyType: customProfileBackup.didKeyType,
Expand Down
15 changes: 14 additions & 1 deletion lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,20 @@ class QRCodeScanCubit extends Cubit<QRCodeScanState> {
clientId = profileCubit.state.model.clientId;
clientSecret = profileCubit.state.model.clientSecret;
} else {
clientId = const Uuid().v4();
final privateKey = await fetchPrivateKey(
oidc4vc: oidc4vc,
secureStorage: secureStorageProvider,
isEBSIV3: isEBSIV3,
);

final (did, _) = await fetchDidAndKid(
privateKey: privateKey,
isEBSIV3: isEBSIV3,
didKitProvider: didKitProvider,
secureStorage: secureStorageProvider,
);
clientId = did;
//clientId = const Uuid().v4();
}

await getAuthorizationUriForIssuer(
Expand Down

0 comments on commit 79caef2

Please sign in to comment.