Skip to content

Commit df104b7

Browse files
DindexxJoTiTu
andauthored
Bugfix/jwks parsing (#304)
* introduced JwkSet Signed-off-by: Kevin <kevin.dinh@lissi.id> * implement dynamic jwks for encryption Signed-off-by: Kevin <kevin.dinh@lissi.id> * implement requested changes Signed-off-by: Kevin <kevin.dinh@lissi.id> * fix jwks parsing Signed-off-by: Kevin <kevin.dinh@lissi.id> * Update publish-nuget.yaml pipeline workaround Signed-off-by: Kevin Dinh <92726228+Dindexx@users.noreply.github.com> * Update publish-nuget.yaml pipeline workaround Signed-off-by: Kevin Dinh <92726228+Dindexx@users.noreply.github.com> * Update publish-nuget.yaml set version in yaml Signed-off-by: Kevin Dinh <92726228+Dindexx@users.noreply.github.com> * revert pipeline workaround Signed-off-by: Johannes Tuerk <johannes.tuerk@lissi.id> --------- Signed-off-by: Kevin <kevin.dinh@lissi.id> Signed-off-by: Kevin Dinh <92726228+Dindexx@users.noreply.github.com> Signed-off-by: Johannes Tuerk <johannes.tuerk@lissi.id> Co-authored-by: Johannes Tuerk <johannes.tuerk@lissi.id>
1 parent f36b625 commit df104b7

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

src/WalletFramework.Oid4Vc/Oid4Vp/Models/ClientJwksConverter.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@ public override Option<JwkSet> ReadJson(JsonReader reader, Type objectType, Opti
1616
bool hasExistingValue,
1717
JsonSerializer serializer)
1818
{
19-
var jObject = JObject.Load(reader);
20-
return JwkSet.FromJObject(jObject).ToOption();
19+
try
20+
{
21+
var jObject = JObject.Load(reader);
22+
return JwkSet.FromJObject(jObject).ToOption();
23+
}
24+
catch (Exception)
25+
{
26+
return Option<JwkSet>.None;
27+
}
2128
}
2229

23-
public override void WriteJson(JsonWriter writer, Option<JwkSet> value, JsonSerializer serializer)
24-
{
30+
public override void WriteJson(JsonWriter writer, Option<JwkSet> value, JsonSerializer serializer) =>
2531
throw new NotImplementedException();
26-
}
2732
}

src/WalletFramework.Oid4Vc/Oid4Vp/Models/ClientMetadata.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,33 @@ namespace WalletFramework.Oid4Vc.Oid4Vp.Models;
99
/// </summary>
1010
public record ClientMetadata
1111
{
12+
// Needed for Newtonsoft Json Serialization
13+
public ClientMetadata(
14+
string? authorizationEncryptedResponseEnc,
15+
string[] redirectUris,
16+
string? clientName,
17+
string? clientUri,
18+
string[]? contacts,
19+
string? logoUri,
20+
Option<JwkSet> jwks,
21+
string? jwksUri,
22+
string? policyUri,
23+
string? tosUri,
24+
Formats formats)
25+
{
26+
AuthorizationEncryptedResponseEnc = authorizationEncryptedResponseEnc;
27+
RedirectUris = redirectUris;
28+
ClientName = clientName;
29+
ClientUri = clientUri;
30+
Contacts = contacts;
31+
LogoUri = logoUri;
32+
JwkSet = jwks;
33+
JwksUri = jwksUri;
34+
PolicyUri = policyUri;
35+
TosUri = tosUri;
36+
Formats = formats;
37+
}
38+
1239
/// <summary>
1340
/// Defined the encoding that should be used when an encrypted Auth Response is requested by the verifier.
1441
/// </summary>

0 commit comments

Comments
 (0)