Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pooled connection re-use on access token expiry #635

Merged
merged 5 commits into from Jul 21, 2020

Conversation

cheenamalhotra
Copy link
Member

@cheenamalhotra cheenamalhotra commented Jul 6, 2020

Fixes #617

When federated authentication mode is used, the driver continues to re-use pooled connection even if associated access token is expired. This leads to failures on client environments when Azure DB re-validates credentials after 10 hours (as of now), and physical connection ends up no longer usable.

This PR fixes the behavior and does not let the pooled connection be re-used again if associated access token is due expire soon.

NuGet package for testing is available here:
https://dev.azure.com/sqlclientdrivers-ci/sqlclient/_build/results?buildId=13352&view=artifacts&type=publishedArtifacts

@cheenamalhotra cheenamalhotra added this to In progress in SqlClient v2.1 via automation Jul 8, 2020
@cheenamalhotra cheenamalhotra moved this from In progress to Review in progress in SqlClient v2.1 Jul 8, 2020
@cheenamalhotra cheenamalhotra added this to the 2.1.0-preview1 milestone Jul 8, 2020
cheenamalhotra added a commit to cheenamalhotra/SqlClient that referenced this pull request Jul 8, 2020
SqlClient v2.1 automation moved this from Review in progress to Reviewer approved Jul 21, 2020
@cheenamalhotra cheenamalhotra merged commit ebde504 into dotnet:master Jul 21, 2020
SqlClient v2.1 automation moved this from Reviewer approved to Done Jul 21, 2020
@PouyaPanahy
Copy link

Hi,
What about the cases when using AAD-Integrated Authentication? Would the PR solve my problem too?

@JRahnama
Copy link
Member

JRahnama commented Oct 2, 2020

@PouyaPanahy, If your case matches the underlying issue, yes. (AAD Integrated Authentication uses access tokens.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

"Login failed for user ***. Token is expired." when using Azure Active Directory password authentication
5 participants