I am learning about the IdentityServer4 https://identityserver4.readthedocs.io/en/release/quickstarts/0_overview.html but seem to be having issues getting it working.
After creating the API section of the project and configured accordingly:
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
{
Authority = "http://localhost:5000",
RequireHttpsMetadata = false,
ApiName = "api1"
});
app.UseMvc();
}
I get the following error:
'IApplicationBuilder' does not contain a definition for 'UseIdentityServerAuthentication' and no extension method 'UseIdentityServerAuthentication' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)
Any advice what i am missing here?
EDIT 1: I've noticed i cannot reference the namespace either even tho the package is installed and present.
i.e.
using IdentityServer4.AccessTokenValidation;
or
using IdentityServer4;
Well, I just closed and reopened Visual Studio 2017, and the problem went away. Perhaps Visual Studio choked on pulling down the IdentityServer4.AccessTokenValidation package the first time, and reopening the project caused it to try again and this time it succeeded.