Azure-Samples / active-directory-verifiable-credentials

A code sample demonstrating how to use Azure Active Directory's preview functionality to issue and consume verifiable credentials.
107 stars 64 forks source link

AADB2C90027: Basic credentials specified for 'REST-VC-PostIssuanceClaims' are invalid #66

Closed AmitavaHazra closed 1 year ago

AmitavaHazra commented 1 year ago

Create the REST API key in the portal The Technical Profile REST-VC-PostIssuanceClaims, that is used during VC innuance during user signup, is configured to use an api-key for security. Therefor, create a Policy Key in the B2C portal with the name RestApiKey and manually set the key value to something unique. You need to add this value to the sample app's appSettings file also.

Case:

I have created api key (signature type) B2C_1A_RestApiKey in b2c portal and have set some unique value. Also in sample code , appsettings.json file has been updated as "B2C1ARestApiKey": "B2C_1A_RestApiKey". Now while doing sign up using B2C_1A_VC_SUSIQ policy , I am getting error but user is getting created in Azure AD B2C without verifiable credential.

Error: AADB2C90027: Basic credentials specified for 'REST-VC-PostIssuanceClaims' are invalid. Check that the credentials are correct and that access has been granted by the resource.

Kindly help.

AmitavaHazra commented 1 year ago

@cljung , Kindly have a look and suggest please

cljung commented 1 year ago

@AmitavaHazra - The instructions says that you should create your B2C policy key in the B2C blade in portal.azure.com and update it the appsettings.json file for the setting B2C1ARestApiKey. It is not the key name that should in the appsettings.json file but the key value. The sample code will check this key value when B2C makes the REST API call to the sample.