I am currently using the quick start to get a basic implementation going in my framework I'm building, and I'm busy adding in the following:
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
{
Authority = "http://localhost:5000",
RequireHttpsMetadata = false,
ApiName = "api1"
});
I get the following error
Could not load file or assembly 'Microsoft.IdentityModel.Tokens,
Version=5.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
The problem is that I have installed the nuget packages as explained on the IdentityServer4 site:
IdentityServer4
IdentityServer4.AccessTokenValidation
I've looked through the dependencies and 5.1.3 is installed along with these packages, but for some reason it is looking for 5.1.2.
I've cleared my nuget cache, restarted visual studio numerous times etc...
My code looks like this:
loggerFactory.Initialise(Configuration.GetSection("Logging"));
_applicationProvider.ConfigurePreMvc(app, env, serviceProvider);
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
})
.UseSwagger();
_applicationProvider.ConfigurePostMvc(app, env, serviceProvider);
and where _applicationProvider.ConfigurePreMvc(app, env, serviceProvider);
executes it is executing the following:
var settings = serviceProvider.GetService<IOptions<Settings>>().Value;
app
.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
{
Authority = settings.IdentityServerUrl,
RequireHttpsMetadata = false,
ApiName = "api1"
});
the error happens on .UseIdentityServerAuthentication
Any one else had this problem? Strange how the version is wrong even though it specifies the dependency, I have also tried to download the package myself which is 5.1.4 and then it was suddenly looking for 5.1.3 and not 5.1.2, which is even more confusing...