diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3ce38ac1..57824f77 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -313,6 +313,7 @@ jobs: php --ri sqlsrv php --ri pdo_sqlsrv displayName: 'Load drivers' + condition: false - script: | docker pull microsoft/mssql-server-windows-developer diff --git a/source/pdo_sqlsrv/pdo_util.cpp b/source/pdo_sqlsrv/pdo_util.cpp index 1613fa38..bab79c99 100644 --- a/source/pdo_sqlsrv/pdo_util.cpp +++ b/source/pdo_sqlsrv/pdo_util.cpp @@ -379,7 +379,7 @@ pdo_error PDO_ERRORS[] = { }, { PDO_SQLSRV_ERROR_INVALID_AUTHENTICATION_OPTION, - { IMSSP, (SQLCHAR*) "Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectorySPA is supported.", -73, false } + { IMSSP, (SQLCHAR*) "Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectoryServicePrincipal is supported.", -73, false } }, { SQLSRV_ERROR_CE_DRIVER_REQUIRED, diff --git a/source/shared/core_conn.cpp b/source/shared/core_conn.cpp index 8c90461c..293cc790 100644 --- a/source/shared/core_conn.cpp +++ b/source/shared/core_conn.cpp @@ -719,7 +719,7 @@ namespace AzureADOptions { MAX_AAD_AUTH_TYPE }; - const char *AADAuths[] = { "SqlPassword", "ActiveDirectoryPassword", "ActiveDirectoryMsi", "ActiveDirectorySPA" }; + const char *AADAuths[] = { "SqlPassword", "ActiveDirectoryPassword", "ActiveDirectoryMsi", "ActiveDirectoryServicePrincipal" }; bool isAuthValid(_In_z_ const char* value, _In_ size_t value_len) { diff --git a/source/sqlsrv/util.cpp b/source/sqlsrv/util.cpp index 0575ab28..bb57c2d2 100644 --- a/source/sqlsrv/util.cpp +++ b/source/sqlsrv/util.cpp @@ -365,7 +365,7 @@ ss_error SS_ERRORS[] = { }, { SS_SQLSRV_ERROR_INVALID_AUTHENTICATION_OPTION, - { IMSSP, (SQLCHAR*)"Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectorySPA is supported.", -62, false } + { IMSSP, (SQLCHAR*)"Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectoryServicePrincipal is supported.", -62, false } }, { SS_SQLSRV_ERROR_AE_QUERY_SQLTYPE_REQUIRED, diff --git a/test/functional/pdo_sqlsrv/pdo_azure_ad_authentication.phpt b/test/functional/pdo_sqlsrv/pdo_azure_ad_authentication.phpt index 8c06d4bb..3d5147b5 100644 --- a/test/functional/pdo_sqlsrv/pdo_azure_ad_authentication.phpt +++ b/test/functional/pdo_sqlsrv/pdo_azure_ad_authentication.phpt @@ -96,5 +96,5 @@ if ($azureServer != 'TARGET_AD_SERVER') { Connected successfully with Authentication=SqlPassword. string(1) "%d" Could not connect with Authentication=ActiveDirectoryIntegrated. -SQLSTATE[IMSSP]: Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectorySPA is supported. +SQLSTATE[IMSSP]: Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectoryServicePrincipal is supported. %s with Authentication=ActiveDirectoryPassword. diff --git a/test/functional/pdo_sqlsrv/pdo_azure_ad_service_principal.phpt b/test/functional/pdo_sqlsrv/pdo_azure_ad_service_principal.phpt index ba24b3ac..a54ae7cc 100644 --- a/test/functional/pdo_sqlsrv/pdo_azure_ad_service_principal.phpt +++ b/test/functional/pdo_sqlsrv/pdo_azure_ad_service_principal.phpt @@ -62,7 +62,7 @@ function connectAzureDB($showException) $conn = false; try { - $connectionInfo = "Database = $adDatabase; Authentication = ActiveDirectorySPA;"; + $connectionInfo = "Database = $adDatabase; Authentication = ActiveDirectoryServicePrincipal;"; $conn = new PDO("sqlsrv:server = $adServer; $connectionInfo", $adSPClientId, $adSPClientSecret); } catch (PDOException $e) { if ($showException) { @@ -78,7 +78,7 @@ function connectAzureDB($showException) // First test connecting to regular sql server require_once('MsSetup.inc'); try { - $conn = new PDO("sqlsrv:server = $server; Authentication = ActiveDirectorySPA;", $uid, $pwd); + $conn = new PDO("sqlsrv:server = $server; Authentication = ActiveDirectoryServicePrincipal;", $uid, $pwd); echo "Expect regular connection to fail\n"; } catch(PDOException $e) { // do nothing diff --git a/test/functional/sqlsrv/sqlsrv_azure_ad_authentication.phpt b/test/functional/sqlsrv/sqlsrv_azure_ad_authentication.phpt index 90b9f0ab..5614ab00 100644 --- a/test/functional/sqlsrv/sqlsrv_azure_ad_authentication.phpt +++ b/test/functional/sqlsrv/sqlsrv_azure_ad_authentication.phpt @@ -106,7 +106,7 @@ Array [SQLSTATE] => IMSSP [1] => -62 [code] => -62 - [2] => Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectorySPA is supported. - [message] => Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectorySPA is supported. + [2] => Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectoryServicePrincipal is supported. + [message] => Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectoryServicePrincipal is supported. ) %s with Authentication=ActiveDirectoryPassword. diff --git a/test/functional/sqlsrv/sqlsrv_azure_ad_service_principal.phpt b/test/functional/sqlsrv/sqlsrv_azure_ad_service_principal.phpt index e6daf0e2..58593ee3 100644 --- a/test/functional/sqlsrv/sqlsrv_azure_ad_service_principal.phpt +++ b/test/functional/sqlsrv/sqlsrv_azure_ad_service_principal.phpt @@ -70,7 +70,7 @@ function connectAzureDB($showException) $conn = false; $connectionInfo = array("Database"=>$adDatabase, - "Authentication"=>"ActiveDirectorySPA", + "Authentication"=>"ActiveDirectoryServicePrincipal", "UID"=>$adSPClientId, "PWD"=>$adSPClientSecret); @@ -89,7 +89,7 @@ function connectAzureDB($showException) } // Try connecting to an invalid server. Expect this to fail. -$connectionInfo = array("Authentication"=>"ActiveDirectorySPA"); +$connectionInfo = array("Authentication"=>"ActiveDirectoryServicePrincipal"); $conn = sqlsrv_connect('invalidServer', $connectionInfo); if ($conn) { fatalError("AzureAD Service Principal test: expected to fail with invalidServer\n");