Support for ASP.Net core 2.0 api securing with IdentityServer3
Hi I am new to this forum. I am having an issue. I have my auth server developed using Identityserver3 framework. i am using local signing cert and ssl enabled. The auth server is working fine and i get the response to https://localhost:44300/identity/.well-known/openid-configuration.
Recently, i started developing asp.net core 2.0 webapi and i had to use the existing auth server as mentioend above.
I tried the following in core api startup.cs.
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication("Bearer")
.AddIdentityServerAuthentication(options =>
{
options.Authority= "https://localhost:44300";
options.ApiName = "web_api";
services.AddMvc();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
// Enable CORS
app.UseCors(builder => builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());
app.UseAuthentication();
app.UseMvc();
}
I used postman to get a token and use the token to access my api and getting error saying:
<h1>An unhandled exception occurred while processing the request.</h1>
<div class="titleerror">JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.</div>
<p class="location">Newtonsoft.Json.JsonTextReader.ParseValue()</p>
<div class="titleerror">InvalidOperationException: IDX10803: Unable to obtain configuration from: 'https://localhost:44300/.well-known/openid-configuration'.</div>
<p class="location">Microsoft.IdentityModel.Protocols.ConfigurationManager+<GetConfigurationAsync>d__24.MoveNext()</p>
As mentioned above, i am completely new to Identityserver.
Appreciate if anyone could help with this?
Thanks
This seems to be a general question about IdentityServer - not a bug report or an issue.
Please use one of the our free or commercial support options
See here for more details.
Thanks!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.