Currently I have an Identity server that runs perfectly, but I want to add an API on top of it to make some database configuration changes through a web front end. The examples in the docs show how to do this with MVC, but not WebAPI.
The Startup.Configuration method looks like this:
app.UseIdentityServer(new IdentityServerOptions{ ... });
...
app.Map("/api", apiApp =>
{
apiApp.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
{
Authority = "https://localhost:44300", // URL of identity server
});
});
However, when app.Map
gets called, it throws an error because it can't reach the identity server, presumably because it hasn't started yet. How can I get them to properly work together?