Open
Description
If I misspell the DefaultHandlerName, the agent with throw an exception on the first message
"UserAuthorization": {
"DefaultHandlerName": "NotFound",
"AutoSignin": true,
"Handlers": {
"graph": {
"Settings": {
"AzureBotOAuthConnectionName": "MCS",
"Title": "SigIn for Sample",
"Text": "Please sign in and send the 6-digit code for MCS"
}
},
"github": {
"Settings": {
"AzureBotOAuthConnectionName": "GH",
"Title": "SigIn for Me",
"Text": "Please sign in and send the 6-digit code for github"
}
}
}
}
System.IndexOutOfRangeException
HResult=0xFFFF3CA6
Message=Handler name 'NotFound' not found in configuration under AgentApplication:UserAuthorization:Handlers, or AgentApplication:UserAuthorization:DefaultHandlerName is invalid.
Source=Microsoft.Agents.Builder
StackTrace:
at Microsoft.Agents.Builder.App.UserAuth.UserAuthorization..ctor(AgentApplication app, UserAuthorizationOptions options) in C:\_code\Agents-for-net\src\libraries\Builder\Microsoft.Agents.Builder\App\UserAuth\UserAuthorization.cs:line 87
at Microsoft.Agents.Builder.App.AgentApplication..ctor(AgentApplicationOptions options) in C:\_code\Agents-for-net\src\libraries\Builder\Microsoft.Agents.Builder\App\AgentApplication.cs:line 65
at ManualAuthAgent..ctor(AgentApplicationOptions options) in C:\_code\Agents-for-net\src\samples\Authorization\ManualSignIn\ManualAuthAgent.cs:line 14
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.<Invoke>d__11.MoveNext()