0

以前のバージョンの IIS で動作していたモジュールを使用しています。

http://www.velocityreviews.com/forums/t94333-re-how-do-i-create-a-httpmodule-to-authenticate-in-aspnet.html

統合フレームワークが原因で機能しなくなり、Classic に戻すことはできません。

クライアントが Web サイトへのアクセスを試みる必要があり、サイトへのアクセス権を持つ Windows またはドメイン ユーザーである場合、データベースによると、自動的にログインされます。そうでない場合は、ログイン ページに移動します。

サイト全体は、呼び出しごとに動的に生成される default.aspx ページから実行されるため、別のログイン ページを持つことはできません。

IIS 7/7.5でこれを機能させるためのモジュールまたは方法を知っている人はいますか?

編集: 以下は、モジュールが生成する JavaScript です。location.replace("/default.aspx?abortScreening=true"); を返す場所に常にジャンプしているように見えます。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Loading ...</title>
</head>
<body>
<script type="text/javascript" language="javascript">
    function canAuthenticate() 
    { 
        try 
        {
        alert("Try canAuthenticate");
            var dom = new ActiveXObject("Msxml2.DOMDocument.4.0");
            dom.async = false;
            dom.load("CredentialsScreeningRequiresAuthentication.aspx?ReturnUrl=");
        }
        catch(e)
        {
            return false;
        }
    return true;
    }
    if (document.cookie.length != 0)
    {
        if (canAuthenticate())
        {
            location.reload();
        }
        else 
        { 
            location.replace("/default.aspx");
        }
    }
    else
    {
        location.replace("/default.aspx?abortScreening=true");
    }
</script>
<noscript>
"Your browser does not support JavaScript or has scripting disabled, which prevents credentials screening from working."
 Please click <a href="/default.aspx?abortScreening=true">here</a> to go to the requested page without authentication.
</noscript>
</body></html>
4

1 に答える 1

0

これは、別のログイン ページを使用しないと実行できません。可能であれば、そこに解決策があり、おそらくグーグルで見つけたように、何も見つかりません.

3 つのオプションがあります。クラシック モードに戻るか、別のログイン ページを使用するか、この機能を使用しないでください。

于 2013-03-19T21:49:50.790 に答える