danielgerlag / workflow-core

Lightweight workflow engine for .NET Standard
MIT License
5.39k stars 1.2k forks source link

Always Encrypted and Keyword not supported : Authentication #1301

Open Tim-AskClem opened 1 month ago

Tim-AskClem commented 1 month ago

Describe the bug

We try to connect WorkflowCore in our .Net core app to our Azure SQL db via Microsoft Entra ID, using the same connection string AND Microsoft entra ID as our app uses (it is an Always Encrypted DB that only allows Entra ID authentication):

Server=somesqlserver.database.windows.net;Database=somedb;Trusted_Connection=False;Encrypt=True;Column Encryption Setting=enabled;MultipleActiveResultSets=true;persist security info=True;Authentication=Active Directory Password;user id=some@entraId.com;password=SomePassword;

When the workflowhost started initially it complained about the "Column Encryption setting=enabled" So we removed that - (we should NOT have to remove anything from our connection string since it will give issues with always encrypted) :

Server=somesqlserver.database.windows.net;Database=somedb;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=true;persist security info=True;Authentication=Active Directory Password;user id=some@entraId.com;password=SomePassword;

When the workflowhost started next it threw an error : Keyword not supported : Authentication We had to setup our test SQL server to also allow SQL server authtentication, and change the connection string to this

Server=somesqlserver.database.windows.net;Database=somedb;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=true;persist security info=True;user id=thecloudamin;password=SomePassword;

Connection strings without these keywords (the "old" way) succeed, but it should support to use the authentication keyword and the Always Encrypted option.

To Reproduce Use a connectionstring that uses the keyword "Authentication" and/or the "Column Encryption Setting=enabled;" options

Expected behavior It allows connection with microsoft entra id and always encrypted and thus accepts AT MINIMUM the keyword "Authentication" and optionally the "Column Encryption Setting=enabled;" (using latest Microsoft.Data.SqlClient)

Additional context None