Closed cokkiy closed 7 years ago
wrong repo, but this sounds like a bug that we don't register those.
That's actually how it works - you would get the same result for the Microsoft authentication middleware.
you need to manually do
services.AddAuthentication
in ConfigureServices
.
If neither services.AddMvc or services.AddIdentity called in services config, app.UseIdentityServerAuthentication will throw the following exceptions: System.InvalidOperationException: Unable to resolve service for type 'System.Text.Encodings.Web.UrlEncoder' while attempting to activate 'IdentityModel.AspNetCore.OAuth2Introspection.OAuth2IntrospectionMiddleware'. [1] Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider) [1] Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters) [1] Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>cDisplayClass3_0.b0(RequestDelegate next)
[1] Microsoft.AspNetCore.Builder.Internal.ApplicationBuilder.Build()
[1] IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationMiddleware..ctor(RequestDelegate next, IApplicationBuilder app, CombinedAuthenticationOptions options, ILogger`1 logger)
[1]
[1] Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
[1] Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
[1] Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>cDisplayClass3_0.b 0(RequestDelegate next)
[1] Microsoft.AspNetCore.Builder.Internal.ApplicationBuilder.Build()
[1] Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
[1] Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
[1] SourceTraceWeb.Program.Main(String[] args)