Blog Post
Lesson Learned #533: Intermittent Azure SQL Database Connectivity and Authentication Issues
Author of HikariCP here. Thanks for writing this up. I'd like to note that v7.0.0. just released and includes support for a user-specified HikariCredentialsProvider class. HikariCP will call this whenever it needs to create a new connection to allow the kind of token generation you are discussing. However, the onus is on the implementer to wisely re-use and refresh tokens. STS tokens are valid for a specific period of time, rather than being one-time-use, so the implementation should probably refresh the token on a background schedule thread and in-between simply return whatever the "current" token is. Hopefully this will be helpful to developers, but a naive implementation that always requests a new token will run into the same issues identified here. Best regards.