My solution consists of three projects, which are:
- An ASP.NET MVC Core project that hosts the IdentityServer.
- An ASP.NET Core API project which is protected and manages the IdentityServer.
- Another ASP.NET MVC Core that calls the API.
So, the MVC client must sent on each request also an access_token
to the API.
If I run the solution with docker-compose command it works, but if I push/pull the images to/from the Azure repositories, I have the issue.
The error that I get is: ErrorMessage: Bearer error="invalid_token", error_description="The signature key was not found"
This is my configuation
services.AddIdentityServer()
.AddDeveloperSigningCredential()
.AddAspNetIdentity<ApplicationUser>()
.AddConfigurationStore(options =>
{
options.ConfigureDbContext = builder =>
builder.UseNpgsql(connectionString,
sql => sql.MigrationsAssembly(migrationsAssembly));
})
.AddOperationalStore(options =>
{
options.ConfigureDbContext = builder =>
builder.UseNpgsql(connectionString,
sql => sql.MigrationsAssembly(migrationsAssembly));
options.EnableTokenCleanup = true;
options.TokenCleanupInterval = 30;
});
services.AddAuthentication(IdentityServerConstants.DefaultCookieAuthenticationScheme)
.AddIdentityServerAuthentication(options =>
{
options.Authority = EnvironmentReader.AuthorityUrl;
options.ApiName = "api1";
options.RequireHttpsMetadata = false;
});