Skip to content

Commit

Permalink
Revert "feat: Remove iss from jwt for cred request #2951"
Browse files Browse the repository at this point in the history
This reverts commit 0f238ed.
  • Loading branch information
hawkbee1 committed Oct 25, 2024
1 parent 0c938a2 commit 06d20db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/oidc4vc/lib/src/oidc4vc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,7 @@ class OIDC4VC {
tokenParameters: issuerTokenParameters,
clientAuthentication: clientAuthentication,
cnonce: nonce,
iss: issuerTokenParameters.clientId,
);

credentialData['proof'] = {
Expand Down Expand Up @@ -1410,11 +1411,13 @@ class OIDC4VC {
Future<String> getIssuerJwt({
required IssuerTokenParameters tokenParameters,
required ClientAuthentication clientAuthentication,
required String iss,
String? cnonce,
}) async {
final iat = (DateTime.now().millisecondsSinceEpoch / 1000).round() - 30;

final payload = {
'iss': iss,
'iat': iat,
'aud': tokenParameters.issuer,
};
Expand Down Expand Up @@ -1600,7 +1603,7 @@ class OIDC4VC {
'aud': tokenParameters.audience,
'exp': iat + 1000,
'sub': tokenParameters.did,
//'iss': tokenParameters.did,
'iss': tokenParameters.did,
'vp': {
'@context': ['https://www.w3.org/2018/credentials/v1'],
'id': presentationId,
Expand Down Expand Up @@ -1705,7 +1708,7 @@ class OIDC4VC {
'aud': tokenParameters.audience, // devrait être verifier
'exp': iat + 1000,
'sub': issAndSub,
// 'iss': issAndSub,
'iss': issAndSub,
};

if (tokenParameters.nonce != null) {
Expand Down
1 change: 1 addition & 0 deletions packages/oidc4vc/test/src/oidc4vc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ void main() {
final issuerJwt = await oidc4vc.getIssuerJwt(
tokenParameters: tokenParameters,
clientAuthentication: ClientAuthentication.clientId,
iss: clientId,
cnonce: '2da2d506-0910-11ef-9e49-0a1628958560',
);

Expand Down

0 comments on commit 06d20db

Please sign in to comment.