イントラネットサイトでも同様の問題が発生し、統合Windows認証からサイトで直接ネットワークユーザー名/パスワードを要求するようになりました。そうすれば、認証ポップアップがいつ表示されるかを気にすることなく、HTTPSなどにリダイレクトできます。
これに似たコード(ASP.NETを使用していると仮定)があり、ユーザーを認証してから、認証状態をCookieに保存します。
public static bool AuthenticateUser(string username, string password)
{
System.DirectoryServices.DirectoryEntry _entry = new System.DirectoryServices.DirectoryEntry(ldap_path, username, password, System.DirectoryServices.AuthenticationTypes.Delegation);
bool _authenticated = false;
try
{
Object _o = _entry.NativeObject;
_authenticated = true;
}
catch
{
_authenticated = false;
}
finally
{
// Avoids the "multiple connections to server not allowed" error.
_entry.Close();
_entry.Dispose();
}
return _authenticated;
}
IISに依存するのではなく、アプリケーションですべての認証を処理することで、頭痛やフラストレーションを大幅に軽減することができました。