iSHARE Community Forum

Send grid key

Does anybody have detailed documentation about the appsettings.Development.json?

we have an error message telling e-mail configuration was incorrect.


the json shows:

“Email”: {
“SendGridKey”: “<<<< SEND GRID KEY >>>>”,
“From”: {
“Address”: “<<<< sender@mail.com >>>>”,
“DisplayName”: “Dummy Name”
}

Hi Nijac,

Good to see you on the Community Forum! It seems like you are in step 3 of " Setup the development environment" described on the Github documentation:

  1. Copy the content of ‘appsettings.Development.json.template’ into ‘appsettings.Development.json’ and complete all fields with the necessary information and save the changes

Specifically, what the necessary information is for the value
“SendGridKey”: “<<<< SEND GRID KEY >>>>”.

The dummy-AR uses SendGrid to send e-mails on behalf of
"Address”: “<<<< sender@mail.com >>>>”,

The SendGridKey is the authentication key used so that the SendGrid client can send these e-mails (to activate new users, for example). More documentation on this can be found on the SendGrid documentation.

Hi Krijn,

we have created the SendGridApiKey and populated into the appsettings.Development.json and run again the dotnet run. the program failedx again on another problemAR%20signing_verification%20failed

Can you give me a hint how to solve this?

Hi Nijac,

From the error message, it seems that step 3 and 4 are not fully completed. Specifically there seems to be an issue with the private/public pair. Have you checked if these are in the format specified in step 4?

i. Change DigitalSigner -> PrivateKey value to the valid RSA private key value with the following format: “-----BEGIN RSA PRIVATE KEY-----\n…\n-----END RSA PRIVATE KEY-----” (with line separators)
ii. Change DigitalSigner -> RawPublicKey value to the valid public key value with the following format: “-----BEGIN CERTIFICATE-----…-----END CERTIFICATE-----” (without line separators)
iii. Save changes

Hi Krijn,
which json file do I’ve to change the private and public key?
I think you mean the appesxetting.json instead of appsettings.Development.json file whihc is writting in the installation instructions whihc is shown below:

Setup the development environment

  1. Create environment variable ‘ENVIRONMENT’ with the value ‘Development’
  2. Navigate to iSHARE.AuthorizationRegistry.Api and create a new file named ‘appsettings.Development.json’
  3. Copy the content of ‘appsettings.Development.json.template’ into ‘appsettings.Development.json’ and complete all fields with the necessary information and save the changes
  4. Into appsettings.Development.json file:
  5. Change DigitalSigner -> PrivateKey value to the valid RSA private key value with the following format: “-----BEGIN RSA PRIVATE KEY-----\n…\n-----END RSA PRIVATE KEY-----” (with line separators)
  6. Change DigitalSigner -> RawPublicKey value to the valid public key value with the following format: “-----BEGIN CERTIFICATE-----…-----END CERTIFICATE-----” (without line separators)
  7. Save changes

Hi Nijac,

As per the instructions,

Navigate to iSHARE.AuthorizationRegistry.Api and create a new file named ‘appsettings.Development.json’
Copy the content of ‘appsettings.Development.json.template’ into ‘appsettings.Development.json’

In the content of ‘appsettings.Development.json.template’, you’ll find the two fields

“PrivateKey”: “<<<< RSA Private Key used for signing tokens >>>>”,
“RawPublicKey”: “<<<< Public Key used for validating tokens >>>>”

So, after copying the content into ‘appsettings.Development.json’, enter the correct values for your certificate/key pair (and as well for the other values, such as the SendGridKey and e-mail address)

Hi Nijac,

Additionaly, it is possible that there is a mismatch between the appsettings structure in the current version on the Github and the version you have on your local machine. There has been an update to these appsettings on the Github on April 23, which explains the miscommunication with regards to which settings are where. Previously the public/private pair was available under PartyDetails entry, but now it has it’s own entry under DigitalSigner entry.

Hi Krijn,

I’ve downloaded the zip file and reinstalled and set up the settings files. After that I run the dotnet and received the following error.


what went wrong?

Hi Nijac!

It seems that the value for public key is in the wrong format. Can you check if this is correct in your settings? The format should be something like
“-----BEGIN CERTIFICATE-----[no line breaks here]-----END CERTIFICATE-----”

For example, the value for Warehouse 13 would be (removed the middle because of length)
-----BEGIN CERTIFICATE-----MIIEgTA....Cjzex5Nw0t4=-----END CERTIFICATE-----

Hi Krijn,

There were no 5 "-"characters on each side of BEGIN CERTIFICATE. After correcting his the program shows application started Press Crtl+C to Shutdown.

1 Like

Almost there.

in the last step I’ve received an eror message see ociture.

Do you know how to fix it?

I am not sure what the error is here, Nijac. Were you able to run the process as described in the section ‘Run process’? Or did the error occur when you were doing the installation for SPA?