From 6c6e59d6796efeb680619256def113f51af671cc Mon Sep 17 00:00:00 2001 From: Johannes Tuerk Date: Wed, 14 Feb 2024 16:25:56 +0100 Subject: [PATCH 1/6] adjust CredentialMetadata Signed-off-by: Johannes Tuerk --- .../Credential/OidCredentialMetadata.cs | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Credential/OidCredentialMetadata.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Credential/OidCredentialMetadata.cs index 7807c40a..2aa5ba1f 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Credential/OidCredentialMetadata.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Credential/OidCredentialMetadata.cs @@ -30,10 +30,11 @@ public class OidCredentialMetadata public List? CryptographicBindingMethodsSupported { get; set; } /// - /// Gets or sets a list of identifiers for the cryptographic suites that are supported. + /// Gets or sets a list of identifiers for the signing algorithms that are supported by the issuer and used + /// to sign credentials. /// - [JsonProperty("cryptographic_suites_supported", NullValueHandling = NullValueHandling.Ignore)] - public List? CryptographicSuitesSupported { get; set; } + [JsonProperty("credential_signing_alg_values_supported", NullValueHandling = NullValueHandling.Ignore)] + public List? CredentialSigningAlgValuesSupported { get; set; } /// /// A list of claim display names, arranged in the order in which they should be displayed by the Wallet. @@ -52,5 +53,23 @@ public class OidCredentialMetadata /// [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] public string? Id { get; set; } + + /// + /// Gets or sets a dictionary which maps a credential type to its supported signing algorithms for key proofs. + /// + [JsonProperty("proof_types_supported", NullValueHandling = NullValueHandling.Ignore)] + public Dictionary? ProofTypesSupported { get; set; } + } + + /// + /// Represents credential type specific signing algorithm information. + /// + public class OidCredentialProofType + { + /// + /// Gets or sets the available signing algorithms for the associated credential type. + /// + [JsonProperty("proof_signing_alg_values_supported")] + public string[] ProofSigningAlgValuesSupported { get; set; } = null!; } } From a75af63da2563994dff029d4ee89247575572b3d Mon Sep 17 00:00:00 2001 From: Johannes Tuerk Date: Wed, 14 Feb 2024 16:28:19 +0100 Subject: [PATCH 2/6] adjust IssuerMetadata and CredentialOffer Signed-off-by: Johannes Tuerk --- .../VCI/Models/CredentialOffer/OidCredentialOffer.cs | 6 +++--- .../VCI/Models/Metadata/Issuer/OidIssuerMetadata.cs | 10 +++++----- .../Vci/Services/Oid4VciClientServiceTests.cs | 6 +++--- .../Integration/Oid4VpClientServiceTests.cs | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialOffer/OidCredentialOffer.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialOffer/OidCredentialOffer.cs index 48e64891..ec77b0d2 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialOffer/OidCredentialOffer.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialOffer/OidCredentialOffer.cs @@ -21,10 +21,10 @@ public class OidCredentialOffer /// /// Gets or sets the list of credentials that the Wallet may request. The List contains CredentialMetadataIds - /// that must map to the keys in the credentials_supported dictionary of the Issuer Metadata + /// that must map to the keys in the credential_configurations_supported dictionary of the Issuer Metadata /// - [JsonProperty("credentials")] - public List Credentials { get; set; } = null!; + [JsonProperty("credential_configuration_ids")] + public List CredentialConfigurationIds { get; set; } = null!; /// /// Gets or sets the URL of the Credential Issuer from where the Wallet is requested to obtain one or more Credentials diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Issuer/OidIssuerMetadata.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Issuer/OidIssuerMetadata.cs index 4e5bcbb6..04da53ce 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Issuer/OidIssuerMetadata.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Issuer/OidIssuerMetadata.cs @@ -16,8 +16,8 @@ public class OidIssuerMetadata /// /// Gets or sets a dictionary which maps a CredentialMetadataId to its credential metadata. /// - [JsonProperty("credentials_supported")] - public Dictionary CredentialsSupported { get; set; } = null!; + [JsonProperty("credential_configurations_supported")] + public Dictionary CredentialConfigurationsSupported { get; set; } = null!; /// /// Gets or sets a list of display properties of a Credential Issuer for different languages. @@ -56,7 +56,7 @@ public class OidIssuerMetadata /// metadata. /// public List? GetCredentialDisplay(string credentialMetadataId) - => CredentialsSupported[credentialMetadataId].Display; + => CredentialConfigurationsSupported[credentialMetadataId].Display; /// /// Gets the claim attributes of a given Credential. @@ -67,7 +67,7 @@ public class OidIssuerMetadata /// null if the Credential is not found in the metadata. /// public Dictionary? GetCredentialClaims(string credentialMetadataId) => - CredentialsSupported[credentialMetadataId].CredentialDefinition.Claims; + CredentialConfigurationsSupported[credentialMetadataId].CredentialDefinition.Claims; /// /// Gets the localized attribute names of a given Credential for a specific locale. @@ -82,7 +82,7 @@ public class OidIssuerMetadata { var displayNames = new List(); - var matchingCredential = CredentialsSupported[credentialMetadataId]; + var matchingCredential = CredentialConfigurationsSupported[credentialMetadataId]; if (matchingCredential == null) return null; diff --git a/test/Hyperledger.Aries.Tests/Features/OpenId4Vc/Vci/Services/Oid4VciClientServiceTests.cs b/test/Hyperledger.Aries.Tests/Features/OpenId4Vc/Vci/Services/Oid4VciClientServiceTests.cs index 0b1065bf..12038cc2 100644 --- a/test/Hyperledger.Aries.Tests/Features/OpenId4Vc/Vci/Services/Oid4VciClientServiceTests.cs +++ b/test/Hyperledger.Aries.Tests/Features/OpenId4Vc/Vci/Services/Oid4VciClientServiceTests.cs @@ -26,7 +26,7 @@ public class Oid4VciClientServiceTests "{\"issuer\":\"https://issuer.io\",\"token_endpoint\":\"https://issuer.io/token\",\"token_endpoint_auth_methods_supported\":[\"urn:ietf:params:oauth:client-assertion-type:verifiable-presentation\"],\"response_types_supported\":[\"urn:ietf:params:oauth:grant-type:pre-authorized_code\"]}\n"; private const string IssuerMetadataResponseContent = - "{\"credential_issuer\":\"https://issuer.io/\",\"credential_endpoint\":\"https://issuer.io/credential\",\"display\":[{\"name\":\"Aussteller\",\"locale\":\"de-DE\"},{\"name\":\"Issuer\",\"locale\":\"en-US\"}],\"credentials_supported\":{\"IdentityCredential\":{\"format\":\"vc+sd-jwt\",\"scope\":\"IdentityCredential_SD-JWT-VC\",\"cryptographic_binding_methods_supported\":[\"did:example\"],\"cryptographic_suites_supported\":[\"ES256K\"],\"display\":[{\"name\":\"IdentityCredential\",\"locale\":\"en-US\",\"background_color\":\"#12107c\",\"text_color\":\"#FFFFFF\"}],\"credential_definition\":{\"type\":\"IdentityCredential\",\"claims\":{\"given_name\":{\"display\":[{\"name\":\"GivenName\",\"locale\":\"en-US\"},{\"name\":\"Vorname\",\"locale\":\"de-DE\"}]},\"last_name\":{\"display\":[{\"name\":\"Surname\",\"locale\":\"en-US\"},{\"name\":\"Nachname\",\"locale\":\"de-DE\"}]},\"email\":{},\"phone_number\":{},\"address\":{\"street_address\":{},\"locality\":{},\"region\":{},\"country\":{}},\"birthdate\":{},\"is_over_18\":{},\"is_over_21\":{},\"is_over_65\":{}}}}}}"; + "{\"credential_issuer\":\"https://issuer.io/\",\"credential_endpoint\":\"https://issuer.io/credential\",\"display\":[{\"name\":\"Aussteller\",\"locale\":\"de-DE\"},{\"name\":\"Issuer\",\"locale\":\"en-US\"}],\"credential_configurations_supported\":{\"IdentityCredential\":{\"format\":\"vc+sd-jwt\",\"scope\":\"IdentityCredential_SD-JWT-VC\",\"cryptographic_binding_methods_supported\":[\"did:example\"],\"credential_signing_alg_values_supported\":[\"ES256K\"],\"display\":[{\"name\":\"IdentityCredential\",\"locale\":\"en-US\",\"background_color\":\"#12107c\",\"text_color\":\"#FFFFFF\"}],\"credential_definition\":{\"type\":\"IdentityCredential\",\"claims\":{\"given_name\":{\"display\":[{\"name\":\"GivenName\",\"locale\":\"en-US\"},{\"name\":\"Vorname\",\"locale\":\"de-DE\"}]},\"last_name\":{\"display\":[{\"name\":\"Surname\",\"locale\":\"en-US\"},{\"name\":\"Nachname\",\"locale\":\"de-DE\"}]},\"email\":{},\"phone_number\":{},\"address\":{\"street_address\":{},\"locality\":{},\"region\":{},\"country\":{}},\"birthdate\":{},\"is_over_18\":{},\"is_over_21\":{},\"is_over_65\":{}}}}}}"; private const string PreAuthorizedCode = "1234"; @@ -63,7 +63,7 @@ public class Oid4VciClientServiceTests { CredentialIssuer = "https://issuer.io", CredentialEndpoint = "https://issuer.io/credential", - CredentialsSupported = new Dictionary + CredentialConfigurationsSupported = new Dictionary { { "VerifiedEmail", new OidCredentialMetadata @@ -181,7 +181,7 @@ public async Task CanRequestCredentialAsync() // Act var actualCredentialResponse = await _oid4VciClientService.RequestCredentialAsync( - _oidIssuerMetadata.CredentialsSupported.First().Value, + _oidIssuerMetadata.CredentialConfigurationsSupported.First().Value, _oidIssuerMetadata, mockTokenResponse ); diff --git a/test/Hyperledger.Aries.Tests/Integration/Oid4VpClientServiceTests.cs b/test/Hyperledger.Aries.Tests/Integration/Oid4VpClientServiceTests.cs index f5f34a5e..812cec5d 100644 --- a/test/Hyperledger.Aries.Tests/Integration/Oid4VpClientServiceTests.cs +++ b/test/Hyperledger.Aries.Tests/Integration/Oid4VpClientServiceTests.cs @@ -84,7 +84,7 @@ public Oid4VpClientServiceTests() { CredentialIssuer = "https://issuer.io", CredentialEndpoint = "https://issuer.io/credential", - CredentialsSupported = new Dictionary() + CredentialConfigurationsSupported = new Dictionary() { { "VerifiedEmail", new OidCredentialMetadata From 245e725506b49945f3f05cb11553bb5082071aaa Mon Sep 17 00:00:00 2001 From: Johannes Tuerk Date: Fri, 23 Feb 2024 11:09:40 +0100 Subject: [PATCH 3/6] make response_type_supported optional Signed-off-by: Johannes Tuerk --- .../VCI/Models/Authorization/AuthorizationServerMetadata.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Authorization/AuthorizationServerMetadata.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Authorization/AuthorizationServerMetadata.cs index 4923828d..619c22af 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Authorization/AuthorizationServerMetadata.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Authorization/AuthorizationServerMetadata.cs @@ -24,8 +24,8 @@ public class AuthorizationServerMetadata /// Gets or sets the response types that the OAuth 2.0 Authorization Server supports. /// These types determine how the Authorization Server responds to client requests. /// - [JsonProperty("response_types_supported")] - public string[] ResponseTypesSupported { get; set; } + [JsonProperty("response_types_supported", NullValueHandling = NullValueHandling.Ignore)] + public string[]? ResponseTypesSupported { get; set; } /// /// Gets or sets the supported authentication methods the OAuth 2.0 Authorization Server supports From 9f0b32b835830136a34f15215be1b6d3637a866e Mon Sep 17 00:00:00 2001 From: Johannes Tuerk Date: Fri, 23 Feb 2024 11:22:40 +0100 Subject: [PATCH 4/6] remove credential_defintion from OidCredentialMetadata Signed-off-by: Johannes Tuerk --- .../CredentialRequest/OidCredentialRequest.cs | 17 ++++++++++++----- .../Credential/OidCredentialMetadata.cs | 13 ++++++++++--- .../Models/Metadata/Issuer/OidIssuerMetadata.cs | 4 ++-- .../Oid4VciClientService.cs | 2 +- .../Vci/Services/Oid4VciClientServiceTests.cs | 7 ++----- .../Integration/Oid4VpClientServiceTests.cs | 7 ++----- 6 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialRequest/OidCredentialRequest.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialRequest/OidCredentialRequest.cs index fd78b3e3..cbacfab2 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialRequest/OidCredentialRequest.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialRequest/OidCredentialRequest.cs @@ -1,4 +1,5 @@ -using Hyperledger.Aries.Features.OpenId4Vc.Vci.Models.Metadata.Credential; +using System.Collections.Generic; +using Hyperledger.Aries.Features.OpenId4Vc.Vci.Models.Metadata.Credential.Attributes; using Newtonsoft.Json; namespace Hyperledger.Aries.Features.OpenId4Vc.Vci.Models.CredentialRequest @@ -21,11 +22,17 @@ public class OidCredentialRequest /// [JsonProperty("format")] public string Format { get; set; } = null!; - + + /// + /// Gets or sets the dictionary representing the attributes of the credential in different languages. + /// + [JsonProperty("claims")] + public Dictionary? Claims { get; set; } + /// - /// Gets or sets the Credential Definition. + /// Gets or sets the verifiable credential type (vct). /// - [JsonProperty("credential_definition")] - public OidCredentialDefinition CredentialDefinition { get; set; } = null!; + [JsonProperty("vct")] + public string Vct { get; set; } = null!; } } diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Credential/OidCredentialMetadata.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Credential/OidCredentialMetadata.cs index 2aa5ba1f..9d831aea 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Credential/OidCredentialMetadata.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Credential/OidCredentialMetadata.cs @@ -1,6 +1,7 @@ #nullable enable using System.Collections.Generic; +using Hyperledger.Aries.Features.OpenId4Vc.Vci.Models.Metadata.Credential.Attributes; using Newtonsoft.Json; namespace Hyperledger.Aries.Features.OpenId4Vc.Vci.Models.Metadata.Credential @@ -11,10 +12,16 @@ namespace Hyperledger.Aries.Features.OpenId4Vc.Vci.Models.Metadata.Credential public class OidCredentialMetadata { /// - /// Gets or sets the credential definition which specifies a specific credential. + /// Gets or sets the verifiable credential type (vct). /// - [JsonProperty("credential_definition")] - public OidCredentialDefinition CredentialDefinition { get; set; } = null!; + [JsonProperty("vct")] + public string Vct { get; set; } = null!; + + /// + /// Gets or sets the dictionary representing the attributes of the credential in different languages. + /// + [JsonProperty("claims")] + public Dictionary? Claims { get; set; } /// /// Gets or sets a list of display properties of the supported credential for different languages. diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Issuer/OidIssuerMetadata.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Issuer/OidIssuerMetadata.cs index 04da53ce..4b2ee00e 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Issuer/OidIssuerMetadata.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/Metadata/Issuer/OidIssuerMetadata.cs @@ -67,7 +67,7 @@ public class OidIssuerMetadata /// null if the Credential is not found in the metadata. /// public Dictionary? GetCredentialClaims(string credentialMetadataId) => - CredentialConfigurationsSupported[credentialMetadataId].CredentialDefinition.Claims; + CredentialConfigurationsSupported[credentialMetadataId].Claims; /// /// Gets the localized attribute names of a given Credential for a specific locale. @@ -87,7 +87,7 @@ public class OidIssuerMetadata if (matchingCredential == null) return null; - var localeDisplayNames = matchingCredential.CredentialDefinition.Claims + var localeDisplayNames = matchingCredential.Claims .SelectMany(subject => subject.Value.Display) .Where(display => display.Locale == locale) .Select(display => display.Name); diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/Oid4VciClientService.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/Oid4VciClientService.cs index e1f7557f..bb2477a6 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/Oid4VciClientService.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/Oid4VciClientService.cs @@ -92,7 +92,7 @@ await response.Content.ReadAsStringAsync() content: new OidCredentialRequest { Format = credentialMetadata.Format, - CredentialDefinition = credentialMetadata.CredentialDefinition, + Vct = credentialMetadata.Vct, Proof = new OidProofOfPossession { ProofType = "jwt", diff --git a/test/Hyperledger.Aries.Tests/Features/OpenId4Vc/Vci/Services/Oid4VciClientServiceTests.cs b/test/Hyperledger.Aries.Tests/Features/OpenId4Vc/Vci/Services/Oid4VciClientServiceTests.cs index 12038cc2..9b3ff8fa 100644 --- a/test/Hyperledger.Aries.Tests/Features/OpenId4Vc/Vci/Services/Oid4VciClientServiceTests.cs +++ b/test/Hyperledger.Aries.Tests/Features/OpenId4Vc/Vci/Services/Oid4VciClientServiceTests.cs @@ -69,11 +69,8 @@ public class Oid4VciClientServiceTests "VerifiedEmail", new OidCredentialMetadata { Format = "vc+sdjwt", - CredentialDefinition = new OidCredentialDefinition - { - Vct = Vct, - Claims = new Dictionary() - } + Vct = Vct, + Claims = new Dictionary() } } } diff --git a/test/Hyperledger.Aries.Tests/Integration/Oid4VpClientServiceTests.cs b/test/Hyperledger.Aries.Tests/Integration/Oid4VpClientServiceTests.cs index 812cec5d..317ad480 100644 --- a/test/Hyperledger.Aries.Tests/Integration/Oid4VpClientServiceTests.cs +++ b/test/Hyperledger.Aries.Tests/Integration/Oid4VpClientServiceTests.cs @@ -90,11 +90,8 @@ public Oid4VpClientServiceTests() "VerifiedEmail", new OidCredentialMetadata { Format = "vc+sdjwt", - CredentialDefinition = new OidCredentialDefinition() - { - Vct = Vct, - Claims = new Dictionary() - } + Vct = Vct, + Claims = new Dictionary() } } } From 213e82ce2e04d95e02a96076ef0cdbe7fa5330a7 Mon Sep 17 00:00:00 2001 From: Johannes Tuerk Date: Thu, 2 May 2024 14:09:39 +0200 Subject: [PATCH 5/6] add http language header & remove format from credential response Signed-off-by: Johannes Tuerk --- .../Models/CredentialResponse/OidCredentialResponse.cs | 6 ------ .../Oid4VciClientService/IOid4VciClientService.cs | 3 ++- .../Oid4VciClientService/Oid4VciClientService.cs | 9 +++++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialResponse/OidCredentialResponse.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialResponse/OidCredentialResponse.cs index 3f4afe2d..7b37f547 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialResponse/OidCredentialResponse.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Models/CredentialResponse/OidCredentialResponse.cs @@ -17,12 +17,6 @@ public class OidCredentialResponse [JsonProperty("c_nonce_expires_in")] public int? CNonceExpiresIn { get; set; } - /// - /// REQUIRED. JSON string denoting the format of the issued Credential. - /// - [JsonProperty("format")] - public string Format { get; set; } = null!; - /// /// OPTIONAL. A JSON string containing a security token subsequently used to obtain a Credential. /// MUST be present when credential is not returned. diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/IOid4VciClientService.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/IOid4VciClientService.cs index a1d0da5e..6f78974f 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/IOid4VciClientService.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/IOid4VciClientService.cs @@ -17,8 +17,9 @@ public interface IOid4VciClientService /// Fetches the metadata related to the OID issuer from the specified endpoint. /// /// The endpoint URL to retrieve the issuer metadata. + /// The preferred language of the wallet in which it would like to retrieve the issuer metadata. The default is "en" /// A task that represents the asynchronous operation. The task result contains the OID issuer metadata. - Task FetchIssuerMetadataAsync(Uri endpoint); + Task FetchIssuerMetadataAsync(Uri endpoint, string preferredLanguage = "en"); /// /// Requests a verifiable credential using the provided parameters. diff --git a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/Oid4VciClientService.cs b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/Oid4VciClientService.cs index 2ad5e309..33f7940a 100644 --- a/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/Oid4VciClientService.cs +++ b/src/Hyperledger.Aries/Features/OpenID4VC/VCI/Services/Oid4VciClientService/Oid4VciClientService.cs @@ -40,7 +40,7 @@ public Oid4VciClientService( private readonly IKeyStore _keyStore; /// - public async Task FetchIssuerMetadataAsync(Uri endpoint) + public async Task FetchIssuerMetadataAsync(Uri endpoint, string preferredLanguage) { var baseEndpoint = endpoint .AbsolutePath @@ -50,9 +50,10 @@ public async Task FetchIssuerMetadataAsync(Uri endpoint) var metadataUrl = new Uri(baseEndpoint, ".well-known/openid-credential-issuer"); - var response = await _httpClientFactory - .CreateClient() - .GetAsync(metadataUrl); + var client = _httpClientFactory.CreateClient(); + client.DefaultRequestHeaders.Add("Accept-Language", preferredLanguage); + + var response = await client.GetAsync(metadataUrl); if (!response.IsSuccessStatusCode) { From afeda4ddd1f8c8cab37d1984b8fdd5171bd910d7 Mon Sep 17 00:00:00 2001 From: Johannes Tuerk Date: Thu, 2 May 2024 14:17:30 +0200 Subject: [PATCH 6/6] fix SD-JWT Record Signed-off-by: Johannes Tuerk --- .../Features/SdJwt/Models/Records/SdJwtRecord.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hyperledger.Aries/Features/SdJwt/Models/Records/SdJwtRecord.cs b/src/Hyperledger.Aries/Features/SdJwt/Models/Records/SdJwtRecord.cs index 6cc515c6..6886a7a0 100644 --- a/src/Hyperledger.Aries/Features/SdJwt/Models/Records/SdJwtRecord.cs +++ b/src/Hyperledger.Aries/Features/SdJwt/Models/Records/SdJwtRecord.cs @@ -162,7 +162,7 @@ public void SetDisplayFromIssuerMetadata( { Display = issuerMetadata.GetCredentialDisplay(credentialMetadataId); DisplayedAttributes = issuerMetadata.GetCredentialClaims(credentialMetadataId); - AttributeOrder = issuerMetadata.CredentialsSupported[credentialMetadataId].Order; + AttributeOrder = issuerMetadata.CredentialConfigurationsSupported[credentialMetadataId].Order; IssuerId = issuerMetadata.CredentialIssuer; IssuerName = CreateIssuerNameDictionary(issuerMetadata);