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

[#6589] Default to MSAL and eliminate ADAL without breaking changes#6605

Merged
tracyboehrer merged 4 commits into
mainfrom
southworks/update/adal-to-msal
May 10, 2023
Merged

[#6589] Default to MSAL and eliminate ADAL without breaking changes#6605
tracyboehrer merged 4 commits into
mainfrom
southworks/update/adal-to-msal

Conversation

@sw-joelmut
Copy link
Copy Markdown
Collaborator

Fixes #6589

Description

This PR migrates ADAL related functionality to MSAL internally.

Note: The public JwtTokenProviderFactory class has been deprecated since its all related to ADAL functionality, said class is only being used for MSI classes, these classes will no longer use the deprecated provider and instead use the MSAL functionality.

Specific Changes

  • AppCredentials.BuildAuthenticator has been deprecated and the BuildIAuthenticator method should be used instead.
  • Added BuildIAuthenticator method to the CertificateAppCredentials class, providing the MSAL authenticator instance, also the internal class variables have been changed to minimize the ADAL implementation without generating breaking changes.
  • Deprecated JwtTokenProviderFactory since it's no longer used in MSI related classes internally. Related classes will redirect any constructor using the provider to the one without it.
  • Updated the ManagedIdentityAuthenticator class to use MSAL functionality instead of JwtTokenProviderFactory to acquire the token.
  • Added BuildIAuthenticator method to the MicrosoftAppCredentials class, providing the MSAL authenticator instance.
  • Removed the Microsoft.IdentityModel.Clients.ActiveDirectory (ADAL) package reference from Connector, since it's no longer used.
    • The Microsoft.Azure.Services.AppAuthentication package reference that uses ADAL underneath couldn't be removed, since it will generate breaking changes.
  • Updated existing unit tests due to failures when providing and mocking the JwtTokenProviderFactory parameter class.
  • Added new unit tests to validate the new implementation works as expected.

Testing

The following image shows a few bots working, the combination of skill bots and the FunctionalTests pipeline passing successfully.
image

@sw-joelmut sw-joelmut added the Automation: Parity with js The PR needs to be ported to JS label Mar 20, 2023
@sw-joelmut sw-joelmut requested a review from a team as a code owner March 20, 2023 17:41
@tracyboehrer tracyboehrer reopened this May 10, 2023
@coveralls
Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 351054

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 110 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-0.08%) to 79.026%

Files with Coverage Reduction New Missed Lines %
/libraries/Microsoft.Bot.Connector.Streaming/Application/TimerAwaitable.cs 1 68.25%
/libraries/Microsoft.Bot.Streaming/Payloads/StreamManager.cs 1 90.0%
/libraries/Microsoft.Bot.Connector/Authentication/AppCredentials.cs 3 38.46%
/libraries/Microsoft.Bot.Connector/Authentication/ManagedIdentityAppCredentials.cs 4 63.64%
/libraries/Microsoft.Bot.Connector/Authentication/ManagedIdentityAuthenticator.cs 5 88.1%
/libraries/Microsoft.Bot.Connector/Authentication/MicrosoftAppCredentials.cs 23 40.91%
/libraries/Microsoft.Bot.Connector/Authentication/MsalAppCredentials.cs 25 0%
/libraries/Microsoft.Bot.Connector/Authentication/CertificateAppCredentials.cs 48 0%
Totals Coverage Status
Change from base Build 350786: -0.08%
Covered Lines: 25851
Relevant Lines: 32712

💛 - Coveralls

@BruceHaley
Copy link
Copy Markdown
Contributor

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Integration.AspNet.Core.dll
✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll

@tracyboehrer tracyboehrer merged commit 0da46de into main May 10, 2023
@tracyboehrer tracyboehrer deleted the southworks/update/adal-to-msal branch May 10, 2023 19:57
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: Parity with js The PR needs to be ported to JS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default to MSAL and eliminate ADAL without breaking changes (research)

4 participants