Skip to content

Commit 6d2b938

Browse files
authored
Changed keyword to ActiveDirectoryServicePrincipal (#1229)
1 parent 7b961b0 commit 6d2b938

File tree

8 files changed

+11
-10
lines changed

8 files changed

+11
-10
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ jobs:
313313
php --ri sqlsrv
314314
php --ri pdo_sqlsrv
315315
displayName: 'Load drivers'
316+
condition: false
316317
317318
- script: |
318319
docker pull microsoft/mssql-server-windows-developer

source/pdo_sqlsrv/pdo_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ pdo_error PDO_ERRORS[] = {
379379
},
380380
{
381381
PDO_SQLSRV_ERROR_INVALID_AUTHENTICATION_OPTION,
382-
{ IMSSP, (SQLCHAR*) "Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectorySPA is supported.", -73, false }
382+
{ IMSSP, (SQLCHAR*) "Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectoryServicePrincipal is supported.", -73, false }
383383
},
384384
{
385385
SQLSRV_ERROR_CE_DRIVER_REQUIRED,

source/shared/core_conn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ namespace AzureADOptions {
719719
MAX_AAD_AUTH_TYPE
720720
};
721721

722-
const char *AADAuths[] = { "SqlPassword", "ActiveDirectoryPassword", "ActiveDirectoryMsi", "ActiveDirectorySPA" };
722+
const char *AADAuths[] = { "SqlPassword", "ActiveDirectoryPassword", "ActiveDirectoryMsi", "ActiveDirectoryServicePrincipal" };
723723

724724
bool isAuthValid(_In_z_ const char* value, _In_ size_t value_len)
725725
{

source/sqlsrv/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ ss_error SS_ERRORS[] = {
365365
},
366366
{
367367
SS_SQLSRV_ERROR_INVALID_AUTHENTICATION_OPTION,
368-
{ IMSSP, (SQLCHAR*)"Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectorySPA is supported.", -62, false }
368+
{ IMSSP, (SQLCHAR*)"Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectoryServicePrincipal is supported.", -62, false }
369369
},
370370
{
371371
SS_SQLSRV_ERROR_AE_QUERY_SQLTYPE_REQUIRED,

test/functional/pdo_sqlsrv/pdo_azure_ad_authentication.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,5 @@ if ($azureServer != 'TARGET_AD_SERVER') {
9696
Connected successfully with Authentication=SqlPassword.
9797
string(1) "%d"
9898
Could not connect with Authentication=ActiveDirectoryIntegrated.
99-
SQLSTATE[IMSSP]: Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectorySPA is supported.
99+
SQLSTATE[IMSSP]: Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectoryServicePrincipal is supported.
100100
%s with Authentication=ActiveDirectoryPassword.

test/functional/pdo_sqlsrv/pdo_azure_ad_service_principal.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function connectAzureDB($showException)
6262

6363
$conn = false;
6464
try {
65-
$connectionInfo = "Database = $adDatabase; Authentication = ActiveDirectorySPA;";
65+
$connectionInfo = "Database = $adDatabase; Authentication = ActiveDirectoryServicePrincipal;";
6666
$conn = new PDO("sqlsrv:server = $adServer; $connectionInfo", $adSPClientId, $adSPClientSecret);
6767
} catch (PDOException $e) {
6868
if ($showException) {
@@ -78,7 +78,7 @@ function connectAzureDB($showException)
7878
// First test connecting to regular sql server
7979
require_once('MsSetup.inc');
8080
try {
81-
$conn = new PDO("sqlsrv:server = $server; Authentication = ActiveDirectorySPA;", $uid, $pwd);
81+
$conn = new PDO("sqlsrv:server = $server; Authentication = ActiveDirectoryServicePrincipal;", $uid, $pwd);
8282
echo "Expect regular connection to fail\n";
8383
} catch(PDOException $e) {
8484
// do nothing

test/functional/sqlsrv/sqlsrv_azure_ad_authentication.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Array
106106
[SQLSTATE] => IMSSP
107107
[1] => -62
108108
[code] => -62
109-
[2] => Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectorySPA is supported.
110-
[message] => Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectorySPA is supported.
109+
[2] => Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectoryServicePrincipal is supported.
110+
[message] => Invalid option for the Authentication keyword. Only SqlPassword, ActiveDirectoryPassword, ActiveDirectoryMsi or ActiveDirectoryServicePrincipal is supported.
111111
)
112112
%s with Authentication=ActiveDirectoryPassword.

test/functional/sqlsrv/sqlsrv_azure_ad_service_principal.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function connectAzureDB($showException)
7070

7171
$conn = false;
7272
$connectionInfo = array("Database"=>$adDatabase,
73-
"Authentication"=>"ActiveDirectorySPA",
73+
"Authentication"=>"ActiveDirectoryServicePrincipal",
7474
"UID"=>$adSPClientId,
7575
"PWD"=>$adSPClientSecret);
7676

@@ -89,7 +89,7 @@ function connectAzureDB($showException)
8989
}
9090

9191
// Try connecting to an invalid server. Expect this to fail.
92-
$connectionInfo = array("Authentication"=>"ActiveDirectorySPA");
92+
$connectionInfo = array("Authentication"=>"ActiveDirectoryServicePrincipal");
9393
$conn = sqlsrv_connect('invalidServer', $connectionInfo);
9494
if ($conn) {
9595
fatalError("AzureAD Service Principal test: expected to fail with invalidServer\n");

0 commit comments

Comments
 (0)