I've followed the Identity Server 4 docs and created a working test instance locally. I've then added an example Javascript client following this tutorial. This all works fine whilst still using the test users and clients.
I now want to start breaking out the test data into production-ready services. I thought I'd start with my clients. Here is the Identity Server setup code from the ConfigureServices method in my Startup:
var builder = services.AddIdentityServer()
.AddDeveloperSigningCredential()
.AddInMemoryIdentityResources(Config.GetIdentityResources())
.AddInMemoryApiResources(Config.GetApiResources())
//.AddInMemoryClients(Config.GetClients())
.AddTestUsers(Config.GetUsers());
builder.Services.AddTransient<IdentityServer4.Stores.IClientStore, CustomClientStore>();
Literally the only thing I've changed here is commenting out the AddInMemoryClients line and adding the last line which registers a new client store. Right now all this CustomClientStore class does is replicate the Config.GetClients() test data.
However, when I now run my demo Javascript app and click my Login button, I now get the following Javascript error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:54458/.well-known/openid-configuration. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
http://localhost:54458 is my IS4 instance obviously. I haven't touched my CORS configuration, and if I comment out the AddTransient line above and restore the AddInMemoryClients line everything works again.
Can anyone help me understand this?