Skip to content

FEAT: Adding support for Device Code#133

Closed
jahnvi480 wants to merge 1 commit intojahnvi/interactive_mac_linuxfrom
jahnvi/device_code_auth
Closed

FEAT: Adding support for Device Code#133
jahnvi480 wants to merge 1 commit intojahnvi/interactive_mac_linuxfrom
jahnvi/device_code_auth

Conversation

@jahnvi480
Copy link
Copy Markdown
Contributor

@jahnvi480 jahnvi480 commented Jul 11, 2025

ADO Work Item Reference

AB#37926


Summary

This pull request updates the add_driver_name_to_app_parameter function in mssql_python/helpers.py to add support for the Active Directory Device Code authentication method. It introduces logic for handling this authentication type and modifies connection parameters accordingly.

Added support for Active Directory Device Code authentication:

  • Introduced a new flag has_aad_device_code to track if the ActiveDirectoryDeviceCode authentication method is used. [1] [2]
  • Added logic to remove specific connection parameters (Uid, Pwd, Connection Timeout, Encrypt, TrustServerCertificate, and Authentication) when ActiveDirectoryDeviceCode is detected. A default Connection Timeout=180 is added.
  • Implemented authentication handling using DeviceCodeCredential from the azure-identity library, including token retrieval and connection string modification.
  • Added an exception to prompt users to install the azure-identity library if it is not already available.

@github-actions github-actions bot added the pr-size: small Minimal code update label Jul 11, 2025
@jahnvi480 jahnvi480 closed this Jul 16, 2025
@jahnvi480
Copy link
Copy Markdown
Contributor Author

Added a new PR with required changes #135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: small Minimal code update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant