r2dbc / r2dbc-mssql

R2DBC Driver for Microsoft SQL Server using TDS (Tabular Data Stream) Protocol
Apache License 2.0
178 stars 32 forks source link

Support Azure Managed Identities to authenticate to Azure SQL DB #281

Open mnowrot opened 9 months ago

mnowrot commented 9 months ago

Feature Request

Is your feature request related to a problem? Please describe

I'd like to use passwordless authentication to my AzureSQL database. So far I'm unable to do it. My question on StackOverflow remains unanswered so far.

Describe the solution you'd like

Indicate the name of the managed identity I want to use to connect in the driver settings. The driver, possibly with support of external libraries should attempt to authenticate with this managed identity. Both System- and User-assigned managed identities shall be supported.

Describe alternatives you've considered

So far, I fell back to using usernname/password authentication. An alternative would be to use the JDBC driver which supports this authentication style.

Teachability, Documentation, Adoption, Migration Strategy

I'd consider introducing a property to driver settings: azureManagedIdentityClientId

Authentication should be performed if the given managed identity is assigned to the azure resource from which I'm attempting to authenticate (a Virtual Machine, Azure Container App, etc.)

mp911de commented 9 months ago

Thanks a lot. We have quite some requests asking for additional authentication options. Our maintainer team is rather small without Microsoft being involved in the driver. We don't have the bandwidth nor infrastructure to test and develop additional auth mechanisms at the time being. We happily accept contributions from the community though.