So I created an ASP.NET Core website with IdentityServer authentication and published it to my Azure Web App but it complains about the certificate. I'm just using the default basic 1 tier web app with no custom domain. The web app is signed by a certificate out of the box so can't I just use that somehow?
Do I really need to buy a custom domain and my own certificate for this to work? I would prefer if I can just keep using the web app without a custom domain.
In the diagnostics dump I can see the error
Couldn't find a valid certificate with subject 'CN=MyApplication' on the 'CurrentUser\My'
at Microsoft.AspNetCore.ApiAuthorization.IdentityServer.SigningKeysLoader.LoadFromStoreCert(String subject, String storeName, StoreLocation storeLocation, DateTimeOffset currentTime)
at Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey()
at Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.Configure(ApiAuthorizationOptions options)
Startup.cs
var identityserver = services.AddIdentityServer();
identityserver.AddApiAuthorization<ApplicationUser, AutheticationDbContext>();
identityserver.AddSigningCredentials();
services.AddAuthentication()
.AddIdentityServerJwt();
appSettings.json
"IdentityServer": {
"Clients": {
"MyWebProjectName.Client": {
"Profile": "IdentityServerSPA"
}
},
"Key": {
"Type": "Store",
"StoreName": "My",
"StoreLocation": "CurrentUser",
"Name": "CN=MyApplication"
}
}