Skip to content

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

Merged
cheenamalhotra merged 5 commits into
dotnet:masterfrom
cheenamalhotra:accessTokenFix
Jul 21, 2020
Merged

Fix pooled connection re-use on access token expiry#635
cheenamalhotra merged 5 commits into
dotnet:masterfrom
cheenamalhotra:accessTokenFix

Conversation

@cheenamalhotra

@cheenamalhotra cheenamalhotra commented Jul 6, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown

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

@JRahnama

JRahnama commented Oct 2, 2020

Copy link
Copy Markdown
Contributor

@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