@sphereon/oid4vci-client 0.2.0 → 0.4.1-next.285

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +494 -371
  3. package/dist/AccessTokenClient.d.ts +30 -0
  4. package/dist/AccessTokenClient.d.ts.map +1 -0
  5. package/dist/AccessTokenClient.js +222 -0
  6. package/dist/AccessTokenClient.js.map +1 -0
  7. package/dist/AuthorizationDetailsBuilder.d.ts +11 -0
  8. package/dist/AuthorizationDetailsBuilder.d.ts.map +1 -0
  9. package/dist/AuthorizationDetailsBuilder.js +44 -0
  10. package/dist/AuthorizationDetailsBuilder.js.map +1 -0
  11. package/dist/CredentialOfferClient.d.ts +10 -0
  12. package/dist/CredentialOfferClient.d.ts.map +1 -0
  13. package/dist/CredentialOfferClient.js +101 -0
  14. package/dist/CredentialOfferClient.js.map +1 -0
  15. package/dist/CredentialRequestClient.d.ts +33 -0
  16. package/dist/CredentialRequestClient.d.ts.map +1 -0
  17. package/dist/CredentialRequestClient.js +118 -0
  18. package/dist/CredentialRequestClient.js.map +1 -0
  19. package/dist/CredentialRequestClientBuilder.d.ts +34 -0
  20. package/dist/CredentialRequestClientBuilder.d.ts.map +1 -0
  21. package/dist/CredentialRequestClientBuilder.js +87 -0
  22. package/dist/CredentialRequestClientBuilder.js.map +1 -0
  23. package/dist/{main/lib/MetadataClient.d.ts → MetadataClient.d.ts} +39 -38
  24. package/dist/MetadataClient.d.ts.map +1 -0
  25. package/dist/MetadataClient.js +148 -0
  26. package/dist/MetadataClient.js.map +1 -0
  27. package/dist/OpenID4VCIClient.d.ts +75 -0
  28. package/dist/OpenID4VCIClient.d.ts.map +1 -0
  29. package/dist/OpenID4VCIClient.js +403 -0
  30. package/dist/OpenID4VCIClient.js.map +1 -0
  31. package/dist/ProofOfPossessionBuilder.d.ts +38 -0
  32. package/dist/ProofOfPossessionBuilder.d.ts.map +1 -0
  33. package/dist/ProofOfPossessionBuilder.js +129 -0
  34. package/dist/ProofOfPossessionBuilder.js.map +1 -0
  35. package/dist/functions/ProofUtil.d.ts +29 -0
  36. package/dist/functions/ProofUtil.d.ts.map +1 -0
  37. package/dist/functions/ProofUtil.js +104 -0
  38. package/dist/functions/ProofUtil.js.map +1 -0
  39. package/dist/functions/index.d.ts +4 -0
  40. package/dist/functions/index.d.ts.map +1 -0
  41. package/dist/{main → functions}/index.js +20 -18
  42. package/dist/functions/index.js.map +1 -0
  43. package/dist/index.d.ts +9 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/{main/lib/index.js → index.js} +25 -24
  46. package/dist/index.js.map +1 -0
  47. package/lib/AccessTokenClient.ts +249 -0
  48. package/lib/AuthorizationDetailsBuilder.ts +46 -0
  49. package/lib/CredentialOfferClient.ts +108 -0
  50. package/lib/CredentialRequestClient.ts +137 -0
  51. package/lib/CredentialRequestClientBuilder.ts +110 -0
  52. package/lib/MetadataClient.ts +147 -0
  53. package/lib/OpenID4VCIClient.ts +523 -0
  54. package/lib/ProofOfPossessionBuilder.ts +181 -0
  55. package/lib/__tests__/AccessTokenClient.spec.ts +225 -0
  56. package/lib/__tests__/AuthorizationDetailsBuilder.spec.ts +65 -0
  57. package/lib/__tests__/AuthzFlowType.spec.ts +39 -0
  58. package/lib/__tests__/CredentialRequestClient.spec.ts +291 -0
  59. package/lib/__tests__/CredentialRequestClientBuilder.spec.ts +121 -0
  60. package/lib/__tests__/HttpUtils.spec.ts +37 -0
  61. package/lib/__tests__/IT.spec.ts +173 -0
  62. package/lib/__tests__/IssuanceInitiation.spec.ts +48 -0
  63. package/lib/__tests__/JsonURIConversions.spec.ts +146 -0
  64. package/lib/__tests__/MetadataClient.spec.ts +203 -0
  65. package/lib/__tests__/MetadataMocks.ts +444 -0
  66. package/lib/__tests__/OpenID4VCIClient.spec.ts +166 -0
  67. package/lib/__tests__/OpenID4VCIClientPAR.spec.ts +112 -0
  68. package/lib/__tests__/ProofOfPossessionBuilder.spec.ts +110 -0
  69. package/lib/__tests__/data/VciDataFixtures.ts +744 -0
  70. package/lib/functions/ProofUtil.ts +120 -0
  71. package/lib/functions/index.ts +3 -0
  72. package/{dist/main/lib/index.d.ts → lib/index.ts} +8 -7
  73. package/package.json +68 -71
  74. package/CHANGELOG.md +0 -21
  75. package/dist/main/index.d.ts +0 -1
  76. package/dist/main/lib/AccessTokenClient.d.ts +0 -20
  77. package/dist/main/lib/AccessTokenClient.js +0 -141
  78. package/dist/main/lib/CredentialRequestClient.d.ts +0 -31
  79. package/dist/main/lib/CredentialRequestClient.js +0 -66
  80. package/dist/main/lib/CredentialRequestClientBuilder.d.ts +0 -21
  81. package/dist/main/lib/CredentialRequestClientBuilder.js +0 -56
  82. package/dist/main/lib/IssuanceInitiation.d.ts +0 -5
  83. package/dist/main/lib/IssuanceInitiation.js +0 -29
  84. package/dist/main/lib/MetadataClient.js +0 -127
  85. package/dist/main/lib/functions/Encoding.d.ts +0 -17
  86. package/dist/main/lib/functions/Encoding.js +0 -138
  87. package/dist/main/lib/functions/HttpUtils.d.ts +0 -17
  88. package/dist/main/lib/functions/HttpUtils.js +0 -133
  89. package/dist/main/lib/functions/ProofUtil.d.ts +0 -9
  90. package/dist/main/lib/functions/ProofUtil.js +0 -76
  91. package/dist/main/lib/functions/index.d.ts +0 -3
  92. package/dist/main/lib/functions/index.js +0 -20
  93. package/dist/main/lib/types/Authorization.types.d.ts +0 -66
  94. package/dist/main/lib/types/Authorization.types.js +0 -35
  95. package/dist/main/lib/types/CredentialIssuance.types.d.ts +0 -88
  96. package/dist/main/lib/types/CredentialIssuance.types.js +0 -8
  97. package/dist/main/lib/types/Generic.types.d.ts +0 -19
  98. package/dist/main/lib/types/Generic.types.js +0 -11
  99. package/dist/main/lib/types/OAuth2ASMetadata.d.ts +0 -37
  100. package/dist/main/lib/types/OAuth2ASMetadata.js +0 -3
  101. package/dist/main/lib/types/OID4VCIServerMetadata.d.ts +0 -65
  102. package/dist/main/lib/types/OID4VCIServerMetadata.js +0 -3
  103. package/dist/main/lib/types/Oidc4vciErrors.d.ts +0 -3
  104. package/dist/main/lib/types/Oidc4vciErrors.js +0 -7
  105. package/dist/main/lib/types/index.d.ts +0 -6
  106. package/dist/main/lib/types/index.js +0 -23
  107. package/dist/main/tsconfig.build.tsbuildinfo +0 -1
@@ -0,0 +1,203 @@
1
+ import { getIssuerFromCredentialOfferPayload, WellKnownEndpoints } from '@sphereon/oid4vci-common';
2
+ import nock from 'nock';
3
+
4
+ import { CredentialOfferClient } from '../CredentialOfferClient';
5
+ import { MetadataClient } from '../MetadataClient';
6
+
7
+ import {
8
+ DANUBE_ISSUER_URL,
9
+ DANUBE_OIDC_METADATA,
10
+ IDENTIPROOF_AS_METADATA,
11
+ IDENTIPROOF_AS_URL,
12
+ IDENTIPROOF_ISSUER_URL,
13
+ IDENTIPROOF_OID4VCI_METADATA,
14
+ SPRUCE_ISSUER_URL,
15
+ SPRUCE_OID4VCI_METADATA,
16
+ WALT_ISSUER_URL,
17
+ WALT_OID4VCI_METADATA,
18
+ } from './MetadataMocks';
19
+
20
+ describe('MetadataClient with IdentiProof Issuer should', () => {
21
+ beforeAll(() => {
22
+ nock.cleanAll();
23
+ });
24
+
25
+ afterEach(() => {
26
+ nock.cleanAll();
27
+ });
28
+
29
+ it('succeed with OID4VCI and separate AS metadata', async () => {
30
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OPENID4VCI_ISSUER).reply(200, JSON.stringify(IDENTIPROOF_OID4VCI_METADATA));
31
+
32
+ nock(IDENTIPROOF_AS_URL).get(WellKnownEndpoints.OAUTH_AS).reply(200, JSON.stringify(IDENTIPROOF_AS_METADATA));
33
+
34
+ const metadata = await MetadataClient.retrieveAllMetadata(IDENTIPROOF_ISSUER_URL);
35
+ expect(metadata.credential_endpoint).toEqual('https://issuer.research.identiproof.io/credential');
36
+ expect(metadata.token_endpoint).toEqual('https://auth.research.identiproof.io/oauth2/token');
37
+ expect(metadata.issuerMetadata).toEqual(IDENTIPROOF_OID4VCI_METADATA);
38
+ });
39
+
40
+ it('succeed with OID4VCI and separate AS metadata from Initiation', async () => {
41
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OPENID4VCI_ISSUER).reply(200, JSON.stringify(IDENTIPROOF_OID4VCI_METADATA));
42
+ nock(IDENTIPROOF_AS_URL).get(WellKnownEndpoints.OAUTH_AS).reply(200, JSON.stringify(IDENTIPROOF_AS_METADATA));
43
+
44
+ const INITIATE_URI =
45
+ 'openid-initiate-issuance://?issuer=https%3A%2F%2Fissuer.research.identiproof.io&credential_type=OpenBadgeCredential&pre-authorized_code=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhOTUyZjUxNi1jYWVmLTQ4YjMtODIxYy00OTRkYzgyNjljZjAiLCJwcmUtYXV0aG9yaXplZCI6dHJ1ZX0.YE5DlalcLC2ChGEg47CQDaN1gTxbaQqSclIVqsSAUHE&user_pin_required=false';
46
+ const initiation = await CredentialOfferClient.fromURI(INITIATE_URI);
47
+ const metadata = await MetadataClient.retrieveAllMetadata(getIssuerFromCredentialOfferPayload(initiation.credential_offer) as string);
48
+ expect(metadata.credential_endpoint).toEqual('https://issuer.research.identiproof.io/credential');
49
+ expect(metadata.token_endpoint).toEqual('https://auth.research.identiproof.io/oauth2/token');
50
+ expect(metadata.issuerMetadata).toEqual(IDENTIPROOF_OID4VCI_METADATA);
51
+ });
52
+
53
+ it('Fail without OID4VCI and only AS metadata (no credential endpoint)', async () => {
54
+ nock(IDENTIPROOF_ISSUER_URL)
55
+ .get(WellKnownEndpoints.OPENID4VCI_ISSUER)
56
+ .reply(404, JSON.stringify({ error: 'does not exist' }));
57
+
58
+ nock(IDENTIPROOF_ISSUER_URL)
59
+ .get(WellKnownEndpoints.OPENID_CONFIGURATION)
60
+ .reply(404, JSON.stringify({ error: 'does not exist' }));
61
+
62
+ nock(IDENTIPROOF_ISSUER_URL)
63
+ .get(WellKnownEndpoints.OAUTH_AS)
64
+ .reply(404, JSON.stringify({ error: 'does not exist' }));
65
+
66
+ await expect(() => MetadataClient.retrieveAllMetadata(IDENTIPROOF_ISSUER_URL, { errorOnNotFound: true })).rejects.toThrowError(
67
+ 'Could not deduce the token endpoint for https://issuer.research.identiproof.io'
68
+ );
69
+ });
70
+
71
+ it('Fail with OID4VCI and no AS metadata', async () => {
72
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OPENID4VCI_ISSUER).reply(200, JSON.stringify(IDENTIPROOF_OID4VCI_METADATA));
73
+ nock(IDENTIPROOF_ISSUER_URL)
74
+ .get(WellKnownEndpoints.OPENID_CONFIGURATION)
75
+ .reply(404, JSON.stringify({ error: 'does not exist' }));
76
+
77
+ nock(IDENTIPROOF_AS_URL).get(WellKnownEndpoints.OAUTH_AS).reply(404, JSON.stringify({}));
78
+ await expect(() => MetadataClient.retrieveAllMetadata(IDENTIPROOF_ISSUER_URL)).rejects.toThrowError('{"error": "not found"}');
79
+ });
80
+
81
+ it('Fail if there is no token endpoint with errors enabled', async () => {
82
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OPENID4VCI_ISSUER).reply(200, JSON.stringify(IDENTIPROOF_OID4VCI_METADATA));
83
+ const meta = JSON.parse(JSON.stringify(IDENTIPROOF_AS_METADATA));
84
+ delete meta.token_endpoint;
85
+ nock(IDENTIPROOF_AS_URL).get(WellKnownEndpoints.OAUTH_AS).reply(200, JSON.stringify(meta));
86
+
87
+ await expect(() => MetadataClient.retrieveAllMetadata(IDENTIPROOF_ISSUER_URL, { errorOnNotFound: true })).rejects.toThrowError(
88
+ 'Could not deduce the token endpoint for https://issuer.research.identiproof.io'
89
+ );
90
+ });
91
+
92
+ it('Fail if there is no credential endpoint with errors enabled', async () => {
93
+ const meta = JSON.parse(JSON.stringify(IDENTIPROOF_OID4VCI_METADATA));
94
+ delete meta.credential_endpoint;
95
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OPENID4VCI_ISSUER).reply(200, JSON.stringify(meta));
96
+ nock(IDENTIPROOF_AS_URL).get(WellKnownEndpoints.OAUTH_AS).reply(200, JSON.stringify(IDENTIPROOF_AS_METADATA));
97
+
98
+ await expect(() => MetadataClient.retrieveAllMetadata(IDENTIPROOF_ISSUER_URL, { errorOnNotFound: true })).rejects.toThrowError(
99
+ 'Could not deduce the credential endpoint for https://issuer.research.identiproof.io'
100
+ );
101
+ });
102
+
103
+ it('Succeed with default value if there is no credential endpoint with errors disabled', async () => {
104
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OPENID4VCI_ISSUER).reply(200, JSON.stringify(IDENTIPROOF_OID4VCI_METADATA));
105
+ nock(IDENTIPROOF_AS_URL).get(WellKnownEndpoints.OAUTH_AS).reply(200, JSON.stringify(IDENTIPROOF_AS_METADATA));
106
+
107
+ const metadata = await MetadataClient.retrieveAllMetadata(IDENTIPROOF_ISSUER_URL);
108
+ expect(metadata.credential_endpoint).toEqual('https://issuer.research.identiproof.io/credential');
109
+ });
110
+
111
+ it('Succeed with no well-known endpoints and errors disabled', async () => {
112
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OPENID4VCI_ISSUER).reply(404, {});
113
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OAUTH_AS).reply(404, {});
114
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OPENID_CONFIGURATION).reply(404, {});
115
+
116
+ const metadata = await MetadataClient.retrieveAllMetadata(IDENTIPROOF_ISSUER_URL);
117
+ expect(metadata.credential_endpoint).toEqual('https://issuer.research.identiproof.io/credential');
118
+ });
119
+
120
+ it('Fail when specific well-known is not found with errors enabled', async () => {
121
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OPENID4VCI_ISSUER).reply(404, {});
122
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OAUTH_AS).reply(404, {});
123
+ nock(IDENTIPROOF_ISSUER_URL).get(WellKnownEndpoints.OPENID_CONFIGURATION).reply(404, {});
124
+
125
+ const metadata = MetadataClient.retrieveWellknown(IDENTIPROOF_ISSUER_URL, WellKnownEndpoints.OPENID4VCI_ISSUER, { errorOnNotFound: true });
126
+ await expect(metadata).rejects.toThrowError('{"error": "not found"}');
127
+ });
128
+ });
129
+
130
+ describe('Metadataclient with Spruce Issuer should', () => {
131
+ it('succeed with OID4VCI and separate AS metadata', async () => {
132
+ nock(SPRUCE_ISSUER_URL).get(WellKnownEndpoints.OPENID4VCI_ISSUER).reply(200, JSON.stringify(SPRUCE_OID4VCI_METADATA));
133
+
134
+ const metadata = await MetadataClient.retrieveAllMetadata(SPRUCE_ISSUER_URL);
135
+ expect(metadata.credential_endpoint).toEqual('https://ngi-oidc4vci-test.spruceid.xyz/credential');
136
+ expect(metadata.token_endpoint).toEqual('https://ngi-oidc4vci-test.spruceid.xyz/token');
137
+ expect(metadata.issuerMetadata).toEqual(SPRUCE_OID4VCI_METADATA);
138
+ });
139
+
140
+ it('Fail without OID4VCI', async () => {
141
+ nock(SPRUCE_ISSUER_URL)
142
+ .get(/.*/)
143
+ .times(3)
144
+ .reply(404, JSON.stringify({ error: 'does not exist' }));
145
+
146
+ await expect(() => MetadataClient.retrieveAllMetadata(SPRUCE_ISSUER_URL, { errorOnNotFound: true })).rejects.toThrowError(
147
+ 'Could not deduce the token endpoint for https://ngi-oidc4vci-test.spruceid.xyz'
148
+ );
149
+ });
150
+ });
151
+
152
+ describe('Metadataclient with Danubetech should', () => {
153
+ it('succeed without OID4VCI and with OIDC metadata', async () => {
154
+ nock(DANUBE_ISSUER_URL).get(WellKnownEndpoints.OPENID_CONFIGURATION).reply(200, JSON.stringify(DANUBE_OIDC_METADATA));
155
+
156
+ nock(DANUBE_ISSUER_URL)
157
+ .get(/.well-known\/.*/)
158
+ .times(2)
159
+ .reply(404, JSON.stringify({ error: 'does not exist' }));
160
+ const metadata = await MetadataClient.retrieveAllMetadata(DANUBE_ISSUER_URL);
161
+ expect(metadata.credential_endpoint).toEqual('https://oidc4vc.uniissuer.io/credential');
162
+ expect(metadata.token_endpoint).toEqual('https://oidc4vc.uniissuer.io/token');
163
+ expect(metadata.issuerMetadata).toEqual(DANUBE_OIDC_METADATA);
164
+ });
165
+
166
+ it('Fail without OID4VCI', async () => {
167
+ nock(SPRUCE_ISSUER_URL)
168
+ .get(/.*/)
169
+ .times(3)
170
+ .reply(404, JSON.stringify({ error: 'does not exist' }));
171
+
172
+ await expect(() => MetadataClient.retrieveAllMetadata(SPRUCE_ISSUER_URL, { errorOnNotFound: true })).rejects.toThrowError(
173
+ 'Could not deduce the token endpoint for https://ngi-oidc4vci-test.spruceid.xyz'
174
+ );
175
+ });
176
+ });
177
+
178
+ describe('Metadataclient with Walt-id should', () => {
179
+ it('succeed without OID4VCI and with OIDC metadata', async () => {
180
+ nock(WALT_ISSUER_URL).get(WellKnownEndpoints.OPENID4VCI_ISSUER).reply(200, JSON.stringify(WALT_OID4VCI_METADATA));
181
+
182
+ nock(WALT_ISSUER_URL)
183
+ .get(/.well-known\/.*/)
184
+ .times(2)
185
+ .reply(404, JSON.stringify({ error: 'does not exist' }));
186
+
187
+ const metadata = await MetadataClient.retrieveAllMetadata(WALT_ISSUER_URL);
188
+ expect(metadata.credential_endpoint).toEqual('https://jff.walt.id/issuer-api/oidc/credential');
189
+ expect(metadata.token_endpoint).toEqual('https://jff.walt.id/issuer-api/oidc/token');
190
+ expect(metadata.issuerMetadata).toEqual(WALT_OID4VCI_METADATA);
191
+ });
192
+
193
+ it('Fail without OID4VCI', async () => {
194
+ nock(WALT_ISSUER_URL)
195
+ .get(/.*/)
196
+ .times(4)
197
+ .reply(404, JSON.stringify({ error: 'does not exist' }));
198
+
199
+ await expect(() => MetadataClient.retrieveAllMetadata(WALT_ISSUER_URL, { errorOnNotFound: true })).rejects.toThrowError(
200
+ 'Could not deduce the token endpoint for https://jff.walt.id/issuer-api/oidc'
201
+ );
202
+ });
203
+ });
@@ -0,0 +1,444 @@
1
+ import { AuthzFlowType, CredentialOfferRequestWithBaseUrl } from '@sphereon/oid4vci-common';
2
+
3
+ export const IDENTIPROOF_ISSUER_URL = 'https://issuer.research.identiproof.io';
4
+ export const IDENTIPROOF_AS_URL = 'https://auth.research.identiproof.io';
5
+ export const SPRUCE_ISSUER_URL = 'https://ngi-oidc4vci-test.spruceid.xyz';
6
+ export const DANUBE_ISSUER_URL = 'https://oidc4vc.uniissuer.io';
7
+ export const WALT_ISSUER_URL = 'https://jff.walt.id/issuer-api/oidc';
8
+ export const INITIATION_TEST_HTTPS_URI =
9
+ 'https://server.example.com?issuer=https%3A%2F%2Fserver%2Eexample%2Ecom&credential_type=https%3A%2F%2Fdid%2Eexample%2Eorg%2FhealthCard&credential_type=https%3A%2F%2Fdid%2Eexample%2Eorg%2FdriverLicense&op_state=eyJhbGciOiJSU0Et...FYUaBy';
10
+ export const INITIATION_TEST_URI =
11
+ 'openid-initiate-issuance://?credential_type=OpenBadgeCredential&issuer=https%3A%2F%2Fjff%2Ewalt%2Eid%2Fissuer-api%2Foidc%2F&pre-authorized_code=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhOTUyZjUxNi1jYWVmLTQ4YjMtODIxYy00OTRkYzgyNjljZjAiLCJwcmUtYXV0aG9yaXplZCI6dHJ1ZX0.YE5DlalcLC2ChGEg47CQDaN1gTxbaQqSclIVqsSAUHE&user_pin_required=false';
12
+
13
+ export const INITIATION_TEST: CredentialOfferRequestWithBaseUrl = {
14
+ baseUrl: 'openid-initiate-issuance://',
15
+ credential_offer: {
16
+ credential_issuer: 'https://jff.walt.id/issuer-api/oidc/',
17
+ credentials: ['OpenBadgeCredential'],
18
+ grants: {
19
+ 'urn:ietf:params:oauth:grant-type:pre-authorized_code': {
20
+ 'pre-authorized_code':
21
+ 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhOTUyZjUxNi1jYWVmLTQ4YjMtODIxYy00OTRkYzgyNjljZjAiLCJwcmUtYXV0aG9yaXplZCI6dHJ1ZX0.YE5DlalcLC2ChGEg47CQDaN1gTxbaQqSclIVqsSAUHE',
22
+ user_pin_required: false,
23
+ },
24
+ },
25
+ },
26
+ original_credential_offer: {
27
+ credential_type: ['OpenBadgeCredential'],
28
+ issuer: 'https://jff.walt.id/issuer-api/oidc/',
29
+ 'pre-authorized_code':
30
+ 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhOTUyZjUxNi1jYWVmLTQ4YjMtODIxYy00OTRkYzgyNjljZjAiLCJwcmUtYXV0aG9yaXplZCI6dHJ1ZX0.YE5DlalcLC2ChGEg47CQDaN1gTxbaQqSclIVqsSAUHE',
31
+ user_pin_required: 'false',
32
+ },
33
+ preAuthorizedCode:
34
+ 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhOTUyZjUxNi1jYWVmLTQ4YjMtODIxYy00OTRkYzgyNjljZjAiLCJwcmUtYXV0aG9yaXplZCI6dHJ1ZX0.YE5DlalcLC2ChGEg47CQDaN1gTxbaQqSclIVqsSAUHE',
35
+ scheme: 'openid-initiate-issuance',
36
+ supportedFlows: [AuthzFlowType.PRE_AUTHORIZED_CODE_FLOW],
37
+ userPinRequired: false,
38
+ version: 1008,
39
+ };
40
+ export const IDENTIPROOF_AS_METADATA = {
41
+ issuer: 'https://auth.research.identiproof.io',
42
+ authorization_endpoint: 'https://auth.research.identiproof.io/oauth2/authorize',
43
+ token_endpoint: 'https://auth.research.identiproof.io/oauth2/token',
44
+ token_endpoint_auth_methods_supported: ['client_secret_basic', 'client_secret_post', 'client_secret_jwt', 'private_key_jwt'],
45
+ jwks_uri: 'https://auth.research.identiproof.io/oauth2/jwks',
46
+ response_types_supported: ['code'],
47
+ grant_types_supported: ['authorization_code', 'urn:ietf:params:oauth:grant-type:pre-authorized_code', 'client_credentials', 'refresh_token'],
48
+ revocation_endpoint: 'https://auth.research.identiproof.io/oauth2/revoke',
49
+ revocation_endpoint_auth_methods_supported: ['client_secret_basic', 'client_secret_post', 'client_secret_jwt', 'private_key_jwt'],
50
+ introspection_endpoint: 'https://auth.research.identiproof.io/oauth2/introspect',
51
+ introspection_endpoint_auth_methods_supported: ['client_secret_basic', 'client_secret_post', 'client_secret_jwt', 'private_key_jwt'],
52
+ code_challenge_methods_supported: ['S256'],
53
+ };
54
+
55
+ export const IDENTIPROOF_OID4VCI_METADATA = {
56
+ issuer: 'https://issuer.research.identiproof.io',
57
+ authorization_server: 'https://auth.research.identiproof.io',
58
+ credential_endpoint: 'https://issuer.research.identiproof.io/credential',
59
+ jwks_uri: 'https://issuer.research.identiproof.io/.well-known/did.json',
60
+ credentials_supported: {
61
+ 'Cyber Security Certificate': {
62
+ formats: {
63
+ jwt_vc: {
64
+ types: ['VerifiableCredential', 'Cyber Security Certificate'],
65
+ cryptographic_binding_methods_supported: ['did'],
66
+ cryptographic_suites_supported: ['ES256'],
67
+ },
68
+ },
69
+ },
70
+ OpenBadgeCredential: {
71
+ formats: {
72
+ jwt_vc: {
73
+ types: ['VerifiableCredential', 'OpenBadgeCredential'],
74
+ cryptographic_binding_methods_supported: ['did'],
75
+ cryptographic_suites_supported: ['ES256'],
76
+ },
77
+ },
78
+ },
79
+ OpenBadgeExtendedCredential: {
80
+ formats: {
81
+ jwt_vc: {
82
+ types: ['VerifiableCredential', 'OpenBadgeExtendedCredential'],
83
+ cryptographic_binding_methods_supported: ['did'],
84
+ cryptographic_suites_supported: ['ES256'],
85
+ },
86
+ },
87
+ },
88
+ },
89
+ };
90
+
91
+ export const SPRUCE_OID4VCI_METADATA = {
92
+ issuer: 'https://ngi-oidc4vci-test.spruceid.xyz',
93
+ credential_endpoint: 'https://ngi-oidc4vci-test.spruceid.xyz/credential',
94
+ token_endpoint: 'https://ngi-oidc4vci-test.spruceid.xyz/token',
95
+ jwks_uri: 'https://ngi-oidc4vci-test.spruceid.xyz/jwks',
96
+ grant_types_supported: ['urn:ietf:params:oauth:grant-type:pre-authorized_code'],
97
+ credentials_supported: {
98
+ OpenBadgeCredential: {
99
+ formats: {
100
+ jwt_vc: {
101
+ types: ['VerifiableCredential', 'OpenBadgeCredential'],
102
+ cryptographic_binding_methods_supported: ['did'],
103
+ cryptographic_suites_supported: ['ES256', 'ES256K'],
104
+ },
105
+ ldp_vc: {
106
+ types: ['VerifiableCredential', 'OpenBadgeCredential'],
107
+ cryptographic_binding_methods_supported: ['did'],
108
+ cryptographic_suites_supported: ['Ed25519Signature2018'],
109
+ },
110
+ },
111
+ },
112
+ },
113
+ };
114
+
115
+ export const DANUBE_OIDC_METADATA = {
116
+ response_types_supported: ['code', 'token'],
117
+ credentials_supported: {
118
+ OpenBadgeCredential: {
119
+ display: [
120
+ {
121
+ name: 'Open Badge V3',
122
+ locale: 'en-US',
123
+ logo: { url: 'https://uniissuer.io/images/logo.jpg' },
124
+ },
125
+ ],
126
+ formats: {
127
+ ldp_vc: {
128
+ types: ['VerifiableCredential', 'OpenBadgeCredential'],
129
+ cryptographic_binding_methods_supported: ['did'],
130
+ cryptographic_suites_supported: ['Ed25519Signature2018', 'Ed25519Signature2020', 'EcdsaSecp256k1Signature2019', 'JsonWebSignature2020'],
131
+ },
132
+ jwt_vc: {
133
+ types: ['VerifiableCredential', 'OpenBadgeCredential'],
134
+ cryptographic_binding_methods_supported: ['did'],
135
+ cryptographic_suites_supported: ['Ed25519Signature2018', 'Ed25519Signature2020', 'EcdsaSecp256k1Signature2019', 'JsonWebSignature2020'],
136
+ },
137
+ },
138
+ claims: { achievement: { mandatory: true, value_type: 'object' } },
139
+ },
140
+ VaccinationCertificate: {
141
+ formats: {
142
+ jwt_vc: {
143
+ types: ['VerifiableCredential', 'VaccinationCertificate'],
144
+ cryptographic_binding_methods_supported: ['did'],
145
+ cryptographic_suites_supported: ['Ed25519Signature2018', 'Ed25519Signature2020', 'EcdsaSecp256k1Signature2019', 'JsonWebSignature2020'],
146
+ },
147
+ },
148
+ },
149
+ },
150
+ credential_issuer: {
151
+ display: [
152
+ {
153
+ name: 'Danube Tech',
154
+ locale: 'en-US',
155
+ logo: { url: 'https://uniissuer.io/images/logo.jpg' },
156
+ },
157
+ ],
158
+ },
159
+ code_challenge_methods_supported: ['plain', 'S256'],
160
+ grant_types_supported: ['authorization_code', 'urn:ietf:params:oauth:grant-type:pre-authorized_code'],
161
+ token_endpoint_auth_methods_supported: ['client_secret_post', 'client_secret_basic'],
162
+ authorization_endpoint: 'https://oidc4vc.uniissuer.io/authorize',
163
+ token_endpoint: 'https://oidc4vc.uniissuer.io/token',
164
+ credential_endpoint: 'https://oidc4vc.uniissuer.io/credential',
165
+ };
166
+
167
+ export const WALT_OID4VCI_METADATA = {
168
+ authorization_endpoint: 'https://jff.walt.id/issuer-api/oidc/fulfillPAR',
169
+ token_endpoint: 'https://jff.walt.id/issuer-api/oidc/token',
170
+ pushed_authorization_request_endpoint: 'https://jff.walt.id/issuer-api/oidc/par',
171
+ issuer: 'https://jff.walt.id/issuer-api',
172
+ jwks_uri: 'https://jff.walt.id/issuer-api/oidc',
173
+ grant_types_supported: ['authorization_code', 'urn:ietf:params:oauth:grant-type:pre-authorized_code'],
174
+ request_uri_parameter_supported: true,
175
+ credentials_supported: {
176
+ VerifiableDiploma: {
177
+ display: [{ name: 'VerifiableDiploma' }],
178
+ formats: {
179
+ ldp_vc: {
180
+ cryptographic_binding_methods_supported: ['did'],
181
+ cryptographic_suites_supported: [
182
+ 'Ed25519Signature2018',
183
+ 'Ed25519Signature2020',
184
+ 'EcdsaSecp256k1Signature2019',
185
+ 'RsaSignature2018',
186
+ 'JsonWebSignature2020',
187
+ 'JcsEd25519Signature2020',
188
+ ],
189
+ types: ['VerifiableCredential', 'VerifiableAttestation', 'VerifiableDiploma'],
190
+ },
191
+ jwt_vc: {
192
+ cryptographic_binding_methods_supported: ['did'],
193
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
194
+ types: ['VerifiableCredential', 'VerifiableAttestation', 'VerifiableDiploma'],
195
+ },
196
+ },
197
+ },
198
+ VerifiableVaccinationCertificate: {
199
+ display: [{ name: 'VerifiableVaccinationCertificate' }],
200
+ formats: {
201
+ ldp_vc: {
202
+ cryptographic_binding_methods_supported: ['did'],
203
+ cryptographic_suites_supported: [
204
+ 'Ed25519Signature2018',
205
+ 'Ed25519Signature2020',
206
+ 'EcdsaSecp256k1Signature2019',
207
+ 'RsaSignature2018',
208
+ 'JsonWebSignature2020',
209
+ 'JcsEd25519Signature2020',
210
+ ],
211
+ types: ['VerifiableCredential', 'VerifiableAttestation', 'VerifiableVaccinationCertificate'],
212
+ },
213
+ jwt_vc: {
214
+ cryptographic_binding_methods_supported: ['did'],
215
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
216
+ types: ['VerifiableCredential', 'VerifiableAttestation', 'VerifiableVaccinationCertificate'],
217
+ },
218
+ },
219
+ },
220
+ Europass: {
221
+ display: [{ name: 'Europass' }],
222
+ formats: {
223
+ ldp_vc: {
224
+ cryptographic_binding_methods_supported: ['did'],
225
+ cryptographic_suites_supported: [
226
+ 'Ed25519Signature2018',
227
+ 'Ed25519Signature2020',
228
+ 'EcdsaSecp256k1Signature2019',
229
+ 'RsaSignature2018',
230
+ 'JsonWebSignature2020',
231
+ 'JcsEd25519Signature2020',
232
+ ],
233
+ types: ['VerifiableCredential', 'VerifiableAttestation', 'Europass'],
234
+ },
235
+ jwt_vc: {
236
+ cryptographic_binding_methods_supported: ['did'],
237
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
238
+ types: ['VerifiableCredential', 'VerifiableAttestation', 'Europass'],
239
+ },
240
+ },
241
+ },
242
+ VerifiableMandate: {
243
+ display: [{ name: 'VerifiableMandate' }],
244
+ formats: {
245
+ ldp_vc: {
246
+ cryptographic_binding_methods_supported: ['did'],
247
+ cryptographic_suites_supported: [
248
+ 'Ed25519Signature2018',
249
+ 'Ed25519Signature2020',
250
+ 'EcdsaSecp256k1Signature2019',
251
+ 'RsaSignature2018',
252
+ 'JsonWebSignature2020',
253
+ 'JcsEd25519Signature2020',
254
+ ],
255
+ types: ['VerifiableCredential', 'VerifiableMandate'],
256
+ },
257
+ jwt_vc: {
258
+ cryptographic_binding_methods_supported: ['did'],
259
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
260
+ types: ['VerifiableCredential', 'VerifiableMandate'],
261
+ },
262
+ },
263
+ },
264
+ EuropeanBankIdentity: {
265
+ display: [{ name: 'EuropeanBankIdentity' }],
266
+ formats: {
267
+ ldp_vc: {
268
+ cryptographic_binding_methods_supported: ['did'],
269
+ cryptographic_suites_supported: [
270
+ 'Ed25519Signature2018',
271
+ 'Ed25519Signature2020',
272
+ 'EcdsaSecp256k1Signature2019',
273
+ 'RsaSignature2018',
274
+ 'JsonWebSignature2020',
275
+ 'JcsEd25519Signature2020',
276
+ ],
277
+ types: ['VerifiableCredential', 'EuropeanBankIdentity'],
278
+ },
279
+ jwt_vc: {
280
+ cryptographic_binding_methods_supported: ['did'],
281
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
282
+ types: ['VerifiableCredential', 'EuropeanBankIdentity'],
283
+ },
284
+ },
285
+ },
286
+ VerifiableAttestation: {
287
+ display: [{ name: 'VerifiableAttestation' }],
288
+ formats: {
289
+ ldp_vc: {
290
+ cryptographic_binding_methods_supported: ['did'],
291
+ cryptographic_suites_supported: [
292
+ 'Ed25519Signature2018',
293
+ 'Ed25519Signature2020',
294
+ 'EcdsaSecp256k1Signature2019',
295
+ 'RsaSignature2018',
296
+ 'JsonWebSignature2020',
297
+ 'JcsEd25519Signature2020',
298
+ ],
299
+ types: ['VerifiableCredential', 'VerifiableAttestation'],
300
+ },
301
+ jwt_vc: {
302
+ cryptographic_binding_methods_supported: ['did'],
303
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
304
+ types: ['VerifiableCredential', 'VerifiableAttestation'],
305
+ },
306
+ },
307
+ },
308
+ OpenBadgeCredential: {
309
+ display: [{ name: 'OpenBadgeCredential' }],
310
+ formats: {
311
+ ldp_vc: {
312
+ cryptographic_binding_methods_supported: ['did'],
313
+ cryptographic_suites_supported: [
314
+ 'Ed25519Signature2018',
315
+ 'Ed25519Signature2020',
316
+ 'EcdsaSecp256k1Signature2019',
317
+ 'RsaSignature2018',
318
+ 'JsonWebSignature2020',
319
+ 'JcsEd25519Signature2020',
320
+ ],
321
+ types: ['VerifiableCredential', 'OpenBadgeCredential'],
322
+ },
323
+ jwt_vc: {
324
+ cryptographic_binding_methods_supported: ['did'],
325
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
326
+ types: ['VerifiableCredential', 'OpenBadgeCredential'],
327
+ },
328
+ },
329
+ },
330
+ PeerReview: {
331
+ display: [{ name: 'PeerReview' }],
332
+ formats: {
333
+ ldp_vc: {
334
+ cryptographic_binding_methods_supported: ['did'],
335
+ cryptographic_suites_supported: [
336
+ 'Ed25519Signature2018',
337
+ 'Ed25519Signature2020',
338
+ 'EcdsaSecp256k1Signature2019',
339
+ 'RsaSignature2018',
340
+ 'JsonWebSignature2020',
341
+ 'JcsEd25519Signature2020',
342
+ ],
343
+ types: ['VerifiableCredential', 'PeerReview'],
344
+ },
345
+ jwt_vc: {
346
+ cryptographic_binding_methods_supported: ['did'],
347
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
348
+ types: ['VerifiableCredential', 'PeerReview'],
349
+ },
350
+ },
351
+ },
352
+ ProofOfResidence: {
353
+ display: [{ name: 'ProofOfResidence' }],
354
+ formats: {
355
+ ldp_vc: {
356
+ cryptographic_binding_methods_supported: ['did'],
357
+ cryptographic_suites_supported: [
358
+ 'Ed25519Signature2018',
359
+ 'Ed25519Signature2020',
360
+ 'EcdsaSecp256k1Signature2019',
361
+ 'RsaSignature2018',
362
+ 'JsonWebSignature2020',
363
+ 'JcsEd25519Signature2020',
364
+ ],
365
+ types: ['VerifiableCredential', 'VerifiableAttestation', 'ProofOfResidence'],
366
+ },
367
+ jwt_vc: {
368
+ cryptographic_binding_methods_supported: ['did'],
369
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
370
+ types: ['VerifiableCredential', 'VerifiableAttestation', 'ProofOfResidence'],
371
+ },
372
+ },
373
+ },
374
+ AmletCredential: {
375
+ display: [{ name: 'AmletCredential' }],
376
+ formats: {
377
+ ldp_vc: {
378
+ cryptographic_binding_methods_supported: ['did'],
379
+ cryptographic_suites_supported: [
380
+ 'Ed25519Signature2018',
381
+ 'Ed25519Signature2020',
382
+ 'EcdsaSecp256k1Signature2019',
383
+ 'RsaSignature2018',
384
+ 'JsonWebSignature2020',
385
+ 'JcsEd25519Signature2020',
386
+ ],
387
+ types: ['VerifiableCredential', 'AmletCredential'],
388
+ },
389
+ jwt_vc: {
390
+ cryptographic_binding_methods_supported: ['did'],
391
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
392
+ types: ['VerifiableCredential', 'AmletCredential'],
393
+ },
394
+ },
395
+ },
396
+ ParticipantCredential: {
397
+ display: [{ name: 'ParticipantCredential' }],
398
+ formats: {
399
+ ldp_vc: {
400
+ cryptographic_binding_methods_supported: ['did'],
401
+ cryptographic_suites_supported: [
402
+ 'Ed25519Signature2018',
403
+ 'Ed25519Signature2020',
404
+ 'EcdsaSecp256k1Signature2019',
405
+ 'RsaSignature2018',
406
+ 'JsonWebSignature2020',
407
+ 'JcsEd25519Signature2020',
408
+ ],
409
+ types: ['VerifiableCredential', 'ParticipantCredential'],
410
+ },
411
+ jwt_vc: {
412
+ cryptographic_binding_methods_supported: ['did'],
413
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
414
+ types: ['VerifiableCredential', 'ParticipantCredential'],
415
+ },
416
+ },
417
+ },
418
+ VerifiableId: {
419
+ display: [{ name: 'VerifiableId' }],
420
+ formats: {
421
+ ldp_vc: {
422
+ cryptographic_binding_methods_supported: ['did'],
423
+ cryptographic_suites_supported: [
424
+ 'Ed25519Signature2018',
425
+ 'Ed25519Signature2020',
426
+ 'EcdsaSecp256k1Signature2019',
427
+ 'RsaSignature2018',
428
+ 'JsonWebSignature2020',
429
+ 'JcsEd25519Signature2020',
430
+ ],
431
+ types: ['VerifiableCredential', 'VerifiableAttestation', 'VerifiableId'],
432
+ },
433
+ jwt_vc: {
434
+ cryptographic_binding_methods_supported: ['did'],
435
+ cryptographic_suites_supported: ['ES256', 'ES256K', 'EdDSA', 'RS256', 'PS256'],
436
+ types: ['VerifiableCredential', 'VerifiableAttestation', 'VerifiableId'],
437
+ },
438
+ },
439
+ },
440
+ },
441
+ credential_issuer: { display: [{ locale: null, name: 'https://jff.walt.id/issuer-api' }] },
442
+ credential_endpoint: 'https://jff.walt.id/issuer-api/oidc/credential',
443
+ subject_types_supported: ['public'],
444
+ };