Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

[#6628] port [#4449] CloudAdapter always builds Connector with MicrosoftAppCredentials (never CertificateAppCredentials) -- certificate auth flow broken#6631

Merged
tracyboehrer merged 4 commits into
mainfrom
southworks/add/certificate-factory
May 16, 2023
Merged

[#6628] port [#4449] CloudAdapter always builds Connector with MicrosoftAppCredentials (never CertificateAppCredentials) -- certificate auth flow broken#6631
tracyboehrer merged 4 commits into
mainfrom
southworks/add/certificate-factory

Conversation

@sw-joelmut
Copy link
Copy Markdown
Collaborator

Fixes #6628

Description

This PR add the CertificateServiceClientCredentialsFactory class to allow bot authentication with a certificate.

Note: to provide a certificate, add the CertificateServiceClientCredentialsFactory class to the bot's service collection in the Setup.cs file.

// Setup.cs file.
// Note: add `Configuration["MicrosoftAppTenantId"]` to the `tenantId` parameter when using `SingleTenant`.

services.AddSingleton<ServiceClientCredentialsFactory>((e) => new CertificateServiceClientCredentialsFactory(certificate, Configuration["MicrosoftAppId"], Configuration["MicrosoftAppTenantId"]));

Specific Changes

  • Added CertificateServiceClientCredentialsFactory class to instantiate and use the CertificateAppCredentials.
  • Added CertificateServiceClientCredentialsFactoryTests class with all the unit tests for the methods.

Testing

The following image shows the changes working as expected.
imagen

sw-joelmut and others added 3 commits May 11, 2023 11:36
Co-authored-by: Cecilia Avila <44245136+ceciliaavila@users.noreply.github.com>
@sw-joelmut sw-joelmut requested a review from a team as a code owner May 16, 2023 13:25
@sw-joelmut sw-joelmut added the Automation: No parity PR does not need to be applied to other languages. label May 16, 2023
@coveralls
Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 351865

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.03%) to 79.058%

Files with Coverage Reduction New Missed Lines %
/libraries/AdaptiveExpressions/BuiltinFunctions/GetNextViableTime.cs 1 90.91%
/libraries/AdaptiveExpressions/BuiltinFunctions/GetPreviousViableTime.cs 1 90.91%
/libraries/integration/Microsoft.Bot.Builder.Integration.AspNet.Core/ServiceCollectionExtensions.cs 1 93.55%
Totals Coverage Status
Change from base Build 351371: 0.03%
Covered Lines: 25874
Relevant Lines: 32728

💛 - Coveralls

@BruceHaley
Copy link
Copy Markdown
Contributor

✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll

@tracyboehrer tracyboehrer merged commit 0cda584 into main May 16, 2023
@tracyboehrer tracyboehrer deleted the southworks/add/certificate-factory branch May 16, 2023 16:23
This was referenced May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Automation: No parity PR does not need to be applied to other languages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

port [#4449] CloudAdapter always builds Connector with MicrosoftAppCredentials (never CertificateAppCredentials) -- certificate auth flow broken

4 participants