Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Conversation

@cdonke
Copy link
Contributor

@cdonke cdonke commented Oct 2, 2020

Description

Bot wasn't starting complaning that the service Microsoft.Bot.Connector.Authentication.AuthenticationConfiguration wasn't found.

It's a common exception when something is not added to the ServiceProviders, therefore, the DI engine cannot find it.

When the screen for Skills were created, a validation to check whether it is a skill or not was also added, because the AllowedCallersClaimsValidator method.
image

If not, the AuthenticationConfiguration wasn't added:
image

Later on the Startup.cs, on the GetBotAdapter method, when creating the BotFrameworkHttpAdapter, the ServiceProvider was called to get the AuthenticationConfiguration method, which did not exist, causing the exception.

image

Since, on the Service Locator Pattern, optional Dependencies are considered an anti-pattern, the AuthenticationConfiguration should always exists, and not be branched.
image

For that to work, the Singleton for AuthenticationConfiguration should be changed to:
image

Task Item

Closes #4313

@cdonke
Copy link
Contributor Author

cdonke commented Oct 2, 2020

Already fixed at #4312

@cdonke cdonke closed this Oct 2, 2020
@cdonke cdonke deleted the fix_AuthenticationConfiguration branch October 2, 2020 12:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Unable to resolve service for type 'Microsoft.Bot.Connector.Authentication.AuthenticationConfiguration'

1 participant