Backport of: 2132 Fix support for enhanced authentication #2171
+480
−21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a backport of #2132 for the version 4 library.
This PR has a number of changes as compared to the PR on which it is based. Since this PR is a fix for the v4 library I stuck with the original "ExtendedAuthenticationExchange" naming convention that was used in the v4 library instead of the more correct "EnhancedAuthentication" naming convention used in the v5 library.
Additionally I tried to avoid any changes to existing interfaces/method signatures that would cause breaking changes. The PR on which these changes are based has many breaking changes as compared to the v4 library.
Another significant difference between this PR and the original is in the client handler. The original PR allowed you to both send and receive packets from inside the client handler until the exchange is complete. This PR uses the pre-existing handler context that only supports sending a response. As a result, a multi-step authentication exchange will result in the handler being called multiple times. This works fine, but it is a key difference between this PR and the v5 PR. I made this choice in an effort to avoid any breaking changes.
My company is unable to use the v5 library because we are constrained by having to support the .Net Framework, but we need to be able to authenticate clients using Enhanced Authentication.
This PR addresses the following issues: