The next thing to do is to add those missing AppSettings values that we're already looking for in the Startup class. Open the appsettings.json file and add the following lines to the existing JSON configuration object (new lines are highlighted):
[...]
{
"Data": {
"DefaultConnection": {
"ConnectionString": "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=TestMakerFree;Integrated Security=True; MultipleActiveResultSets=True"
}
},
"Auth": {
"Jwt": {
"Issuer": "http://www.testmakerfree.com/",
"Audience": "http://www.testmakerfree.com/",
"Key": "---insert-your-own-key-here---"
"TokenExpirationInMinutes": 86400
}
},
"Logging": {
[...]
For demonstration purposes, we did set the TokenExpirationInMinutes with a value of 60 days; you're highly encouraged to opt for a shorter value for any production-wise scenario!
These settings will be good for the published version of our app, but won't work in our local development environment. To fix that, open the appsettings.Development.json file and add the alternative configuration:
[...]
"Auth": {
"Jwt": {
"Issuer": "http://localhost:14600/",
"Audience": "http://localhost:14600/",
}
},
[...]
This uses the same keys, but different issuer.