Hello,
Getting an error while loading or sign in the application related to TokenAuth.
ERROR 2019-09-14 23:35:40,694 [75 ] Mvc.ExceptionHandling.AbpExceptionFilter - Can't create component '*.Web.Controllers.TokenAuthController' as it has dependencies to be satisfied.
'*.Web.Controllers.TokenAuthController' is waiting for the following dependencies:
- Service '*.Web.Authentication.JwtBearer.IProjectJwtSecurityStampHandler' which was not registered.
Castle.MicroKernel.Handlers.HandlerException: Can't create component '*.Web.Controllers.TokenAuthController' as it has dependencies to be satisfied.
'*.Web.Controllers.TokenAuthController' is waiting for the following dependencies:
- Service '*.Web.Authentication.JwtBearer.IProjectJwtSecurityStampHandler' which was not registered.
at Castle.MicroKernel.Handlers.DefaultHandler.AssertNotWaitingForDependency()
at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)
at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)
at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, Arguments additionalArguments, IReleasePolicy policy, Boolean ignoreParentContext)
at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, Boolean ignoreParentContext)
at Castle.MicroKernel.DefaultKernel.Resolve(Type service, Arguments arguments)
at Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetServiceInternal(Type serviceType, Boolean isOptional) in D:\Github\castle-windsor-ms-adapter\src\Castle.Windsor.MsDependencyInjection\ScopedWindsorServiceProvider.cs:line 55
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.AspNetCore.Mvc.Controllers.ServiceBasedControllerActivator.Create(ControllerContext actionContext)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
Any specific reason for this?. Thanks.
7 Answer(s)
-
0
I get a similar error on 7.2.2. Can't login from angular but the error is on the server side. From swagger:
curl -X GET "http://localhost:5000/api/TokenAuth/GetExternalAuthenticationProviders" -H "accept: text/plain"
After migrating from 7.0.0 on macOS and running my Web.Host locally on port 5000. 7.0.0 server runs fine.
INFO 2019-09-14 22:08:56,871 [82 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:5000/api/TokenAuth/GetExternalAuthenticationProviders INFO 2019-09-14 22:08:57,549 [83 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'aqua.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (aqua.Web.Core)' INFO 2019-09-14 22:08:57,551 [83 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetExternalAuthenticationProviders", controller = "TokenAuth", area = ""}. Executing action aqua.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (aqua.Web.Core) ERROR 2019-09-14 22:08:57,551 [83 ] Mvc.ExceptionHandling.AbpExceptionFilter - Can't create component 'aqua.Web.Controllers.TokenAuthController' as it has dependencies to be satisfied. 'aqua.Web.Controllers.TokenAuthController' is waiting for the following dependencies: - Service 'aqua.Web.Authentication.JwtBearer.IaquaJwtSecurityStampHandler' which was not registered. Castle.MicroKernel.Handlers.HandlerException: Can't create component 'aqua.Web.Controllers.TokenAuthController' as it has dependencies to be satisfied. 'aqua.Web.Controllers.TokenAuthController' is waiting for the following dependencies: - Service 'aqua.Web.Authentication.JwtBearer.IaquaJwtSecurityStampHandler' which was not registered. at Castle.MicroKernel.Handlers.DefaultHandler.AssertNotWaitingForDependency() at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden) at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired) at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, Arguments additionalArguments, IReleasePolicy policy, Boolean ignoreParentContext) at Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetServiceInternal(Type serviceType, Boolean isOptional) in D:\Github\castle-windsor-ms-adapter\src\Castle.Windsor.MsDependencyInjection\ScopedWindsorServiceProvider.cs:line 55 at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.AspNetCore.Mvc.Controllers.ServiceBasedControllerActivator.Create(ControllerContext actionContext) at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync() INFO 2019-09-14 22:08:58,322 [83 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'. INFO 2019-09-14 22:08:58,324 [83 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action aqua.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (aqua.Web.Core) in 772.8233ms INFO 2019-09-14 22:08:58,324 [83 ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint 'aqua.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (aqua.Web.Core)' INFO 2019-09-14 22:08:58,324 [83 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 1453.0661ms 500 application/json; charset=utf-8
Any ideas?
Thanks.
-
0
I added this line to my Startup.cs as a temporary fix:
---> services.AddScoped<IaquaJwtSecurityStampHandler,aquaJwtSecurityStampHandler>(); IdentityRegistrar.Register(services); AuthConfigurer.Configure(services, _appConfiguration);
I opened an issue #2659 in the github repo for the developers to respond to.
Hope this helps...got me going again.
-
0
Hi @mujthabagroad
Could you share the implementation class of IProjectJwtSecurityStampHandler ? Is it ProjectJwtSecurityStampHandler ?
-
0
Dear @ismcagdas,
Yes i checked this, we didn't do any changes in this classes, actual name was:
- h2oERPJwtSecurityStampHandler
- Ih2oERPJwtSecurityStampHandler
Please advice. Thanks.
-
0
UPDATE: Bug fix was just added (and closed) in 7.2.3
-
0
https://github.com/aspnetzero/aspnet-zero-core/issues/2659