sfu-db / connector-x

Fastest library to load data from DB to DataFrames in Rust and Python
https://sfu-db.github.io/connector-x
MIT License
2.02k stars 163 forks source link

Oauth / AAD / Entra ID support for mssql #682

Open jonaslb opened 2 months ago

jonaslb commented 2 months ago

We use OAuth / AzureDefaultCredential for authentication to mssql and I would like to use this with connectorx as well.

It looks like tiberius has support for this with the AADToken auth method: https://docs.rs/tiberius/0.12.3/tiberius/enum.AuthMethod.html#variant.AADToken. I haven't tested that it works, but I suppose this would basically accept the OAuth token that you get from AzureDefaultCredential.token.

There is, as far as I can see, currently no way to encode this token in the URL for connectorx. It could perhaps be a token parameter or it could be encoded in the user/password field somehow.

jonaslb commented 2 months ago

On second thought reading the comments in tiberius for AADToken, I'm not sure that it's an OAuth token. Maybe this request should go to tiberius instead.