I am working with Microsoft's Verifiable Credentials sample: https://github.com/Azure-Samples/active-directory-verifiable-credentials-dotnet/tree/main/1-asp-net-core-api-idtokenhint
Rather than use fixed contact values as per the test (see IssuerController.cs), I want to use query params from a form I have added to the Index page (e.g. an input called "firstname"). I can see the params in the results page URL, however I cannot find a way to set these correctly.
I've tried a few methods in IssuerController.cs. First by amending the static value to a query request:
payload["issuance"]["claims"]["given_name"] = HttpContext.Request.Query["firstname"].ToString();
I've also tried setting a property:
[FromQuery(Name = "firstname")]
public string firstname { get; set; }
And then adding the property to the payload:
payload["issuance"]["claims"]["given_name"] = firstname;
Sadly all of this results in the same error:
"Missing provided claims in issuance: [given_name]","target":"issuance.claims"
For reference, the method signature is
public async Task<ActionResult> IssuanceRequest()
As you may gather, I am not savvy with .NET.
What is the correct way to do this please? Thanks
Right, I'm sure there are other ways to do this but we got it working in the end by amending the IssuanceRequest method in Issuer.cshtml
Thanks for the help anyway