2

OWIN-MixedAuthを使用してWeb サイト ユーザーを認証しています。Win10マシンでVS2015を使用してローカルで実行すると、すべて問題ありません。AD ドメイン内の実稼働 Windows 2008 R2 サーバーに展開すると、User.Identity は ClaimsIdentity ではなく、NameIdentifier 要求が欠落している WindowsIdentity であり、GetuserId は null を返します。

Startup.Auth.cs で、次の Cookie オプションを設定しました。ここで推奨されているように、ログイン パスは「account/windowslogin」を指しています。

    var cookieOptions = new CookieAuthenticationOptions {
        AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
        LoginPath = new PathString(ConfigurationManager.AppSettings["LoginPath"]),
        Provider = new CookieAuthenticationProvider {
            OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, IdentityUser, Guid>(
            TimeSpan.FromMinutes(30),
            async (manager, user) => await user.GenerateUserIdentityAsync(manager),
            (id) => new Guid(id.GetUserId())),
        }
    };

ここで IIS 7.5 の動作が異なる理由はありますか?

乾杯ベルント

4

0 に答える 0