Dotvvm で Cookie 認証を使用すると、Null ユーザー例外がスローされます。
dotvvm 構成で次のコードを使用しました。
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
Dotvvm で Cookie 認証を使用すると、Null ユーザー例外がスローされます。
dotvvm 構成で次のコードを使用しました。
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
次の認証コードは、Configuration(IAppBuilder アプリ) 関数の最初の行にある必要があり、null ユーザー例外を取り除きます。
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
Provider
プロパティを設定して を処理することもお勧めしますOnRedirect
。そうしないと、OWIN セキュリティ ライブラリによって行われたリダイレクトが正しく適用されません。
app.UseCookieAuthentication(new CookieAuthenticationOptions()
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/login"),
Provider = new CookieAuthenticationProvider()
{
OnApplyRedirect = e => DotvvmAuthenticationHelper.ApplyRedirectResponse(e.OwinContext, e.RedirectUri)
}
});