I found out about IdentityServer4 https://identityserver4.readthedocs.io/en/release/quickstarts/0_overview.html , but I seem to have problems with its operation.
After creating the project API section and the corresponding settings:
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'm missing here?
UPDATE 1: I noticed that I cannot reference the namespace, even if the package is installed and present.
those.
using IdentityServer4.AccessTokenValidation;
or
using IdentityServer4;
source share