Skip to content

Commit

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

credentialData['proof'] = {
Expand Down Expand Up @@ -1411,13 +1410,11 @@ 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 @@ -1603,7 +1600,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 @@ -1708,7 +1705,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: 0 additions & 1 deletion packages/oidc4vc/test/src/oidc4vc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,6 @@ 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 0f238ed

Please sign in to comment.