の主張を読み取ることができません私はこのようなstartup.auth.csで定義されてApplicationCookie認証がありますウェブAPIは、私がアイデンティティ2.0</p> <p>でWEBAPI 2.0を使用していますリクエスト
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
CookieName = "MyAppCookieName"
});
AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier;
を私がでアクションを持っていますAccountController to login:
var claims = new List<Claim>();
// create required claims
claims.Add(new Claim(ClaimTypes.NameIdentifier, "harryb"));
claims.Add(new Claim(ClaimTypes.Name, "harryb"));
var identity = new ClaimsIdentity(claims, DefaultAuthenticationTypes.ApplicationCookie);
AuthenticationManager.SignIn(new AuthenticationProperties()
{
AllowRefresh = true,
IsPersistent = true,
ExpiresUtc = DateTime.UtcNow.AddDays(7),
}, identity);
return Ok();
これまでのところ、ログインリクエストでクッキーが受信されました。しかし、私は新しい要求をすると、要求は空ですか?私はstandartログインとテーブルなどを使用したくない。私はちょうど偽のログインにいくつかの主張し、次の要求でそれを読む..私は行方不明ですか?