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 merged commit ebde504 into dotnet:master 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
None yet
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