Changed keyword to ActiveDirectoryServicePrincipal (#1229)

This commit is contained in:
Jenny Tam 2021-01-15 10:02:35 -08:00 коммит произвёл GitHub
Родитель 7b961b0028
Коммит 6d2b93881f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 11 добавлений и 10 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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,

Просмотреть файл

@ -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)
{

Просмотреть файл

@ -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,

Просмотреть файл

@ -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.

Просмотреть файл

@ -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

Просмотреть файл

@ -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.

Просмотреть файл

@ -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");