是否有C#版认证型可验证凭证示例?Authenticator触发遇阻
问题:实现基于可验证凭证的认证型签发流程遇阻
已成功测试idtokenhint示例,现尝试实现类似Woodgrove员工入职演示的认证型可验证凭证,但未成功,寻求对应C#实现代码。
核心需求:让Authenticator先请求VerifiedCredentialExpert凭证,但不清楚触发方式;已尝试修改issuance_request_config.json文件,添加requestedCredentials指定VerifiedCredentialExpert类型,但问题未解决。
配置代码(issuance_request_config.json)
"includeQRCode": false, "callback": { //In this sample code we will overwrite the callback and use the HOSTNAME dynamicall //make sure you use ngrok or something like that when running on a local devbox. //The MS AAD VC Request service needs to be able to reach the callback URI "url": "https://YOURPUBLICREACHABLEHOSTNAME/api/issuer/issuanceCallback", "state": "STATEWILLBESETINCODE", "headers": { "api-key": "OPTIONAL API-KEY for ISSUANCE CALLBACK API" } }, //The Authority is the DID from your MS AAD Verifiable Credential service, you can copy this from the VC page in azure portal "authority": "did:ion: THIS IS YOUR DID FROM THE VC PAGE IN AZURE PORTAL WHICH IS SET IN THE SAMPLE BY COPYING THE VALUE FROM APPSETTINGS.JSON ", "registration": { "clientName": "Verifiable Test Register Verifiable Credential" }, //The type needs to be the same as defined in the rules json definitione. The manifest can be copied after the credential has been //created in the azure portal "type": "VerifiedTestRegistration", "manifest": "CREDENTIAL URL IN THIS SAMPLE WILL BE COPIED FROM APPSETTINGS.JSON", //Recommendation is to protect issuance payload with a PIN code. //The pincode is set to a random value in code and will be displayed in the UI to the user "pin": { "value": "123456", "length": 4 }, //This is an example payload which will be used in the rules file of the credential. //The rules files maps information from the ID Token (hint) to the VC "claims": { "country_of_registry": "", "registration_number": "", }, //You can request multiple verifiable credentials at once that's whty the requestCredentials is an array "requestedCredentials": [ { "type": "VerifiedCredentialExpert", "purpose": "Required presentation of verifiable credentials expert to get Test Registration card.", //You can trust multiple issuers who might be issuing the same credential type (for example certifications or diplomas) //You need to specify at least 1 trusted issuer DID, for this sample code we copy the IssuerAuthority from appsettings to the request //"acceptedIssuers": [ "did:ion: copied from your VC portal in this sample the code copies it from APPSETTINGS.JSON" ] "acceptedIssuers": [ "theaccepetedidissuer" ] } ] }
Display定义
{ "locale": "en-US", "card": { "title": "Test Verified Credential", "issuedBy": "TheIssuer", "backgroundColor": "#000000", "textColor": "#ffffff", "logo": { "uri": "https://example.com/image.png", "description": "Test Verified Credential" }, "description": "Use this card to verify." }, "consent": { "title": "Do you want to get your Test Verified Credential?", "instructions": "Sign in with your Verified Credential Expert Card to get your card." }, "claims": [ { "claim": "$.vc.country_of_registry", "label": "Country of Registry", "type": "String" }, { "claim": "$.vc.registration_number", "label": "Registration Number", "type": "String" } ] }
Rules定义
{ "attestations": { "presentations": [ { "mapping": [ { "outputClaim": "firstName", "required": true, "inputClaim": "$.vc.credentialSubject.given_name", "indexed": false }, { "outputClaim": "lastName", "required": true, "inputClaim": "$.vc.credentialSubject.family_name", "indexed": false } ], "required": true, "credentialType": "VerifiedCredentialExpert", "contracts": [ "https://verifiedid.did.msidentity.com/v1.0/tenants/id/verifiableCredentials/contracts/abcd/manifest" ], "trustedIssuers": [ "did:ion:thedid" ] } ], "idTokenHints": [ { "mapping": [ { "outputClaim": "countryOfRegistry", "required": true, "inputClaim": "$.country_of_registry", "indexed": false }, { "outputClaim": "registrationNumber", "required": true, "inputClaim": "$.registration_number", "indexed": true } ], "required": true } ] }, "validityInterval": 2592000, "vc": { "type": [ "VerifiedTestRegistration" ] } }
测试环境:iPhone12 Pro(安装最新iOS版本),此前在对应Git项目提问未获帮助。
内容的提问来源于stack exchange,提问作者Sergio Solorzano
相关产品推荐
相关产品推荐

