Asp.net mvc 启用OpenId身份验证后,Web API 2操作参数变为null

Asp.net mvc 启用OpenId身份验证后,Web API 2操作参数变为null,asp.net-mvc,authentication,unity3d,oauth,owin,Asp.net Mvc,Authentication,Unity3d,Oauth,Owin,我在使用WWWForm接收Unity 3d项目请求的应用程序中工作: public IEnumerator UpdateServerStats() { this.gameSessionStats.SessionUpdateTime = System.DateTime.Now; while (true) { WWWForm frm = new WWWForm(); frm.AddField("GameSessionStatsId", Syst

我在使用WWWForm接收Unity 3d项目请求的应用程序中工作:

public IEnumerator UpdateServerStats()
{
    this.gameSessionStats.SessionUpdateTime = System.DateTime.Now;
    while (true)
    {
        WWWForm frm = new WWWForm();
        frm.AddField("GameSessionStatsId", System.Convert.ToString(this.gameSessionStats.GameSessionStatsId));
        frm.AddField("Platform", System.Convert.ToString(this.gameSessionStats.Platform));
        frm.AddField("GameKey", System.Convert.ToString( this.gameSessionStats.GameKey));
        frm.AddField("SessionId", System.Convert.ToString(this.gameSessionStats.SessionId));
        frm.AddField("SessionStartDateTime", System.Convert.ToString(this.gameSessionStats.SessionStartDateTime));
        frm.AddField("SessionUpdateTime", System.Convert.ToString(this.gameSessionStats.SessionUpdateTime));
        frm.AddField("UserName", System.Convert.ToString(this.gameSessionStats.UserName));
        string strPostUrl = string.Format("{0}/api/GameStats", RestFulServer);
        WWW clientWeb = new WWW(strPostUrl, frm.data);
        yield return clientWeb;
        if (clientWeb.error != null && clientWeb.error.Length > 0)
            Debug.Log(clientWeb.error);
        else
            Debug.Log(clientWeb.text);
        yield return new WaitForSeconds(5);
    }
}
然后我有一个WebAPI2动作

public HttpResponseMessage Post([FromBody]GameSessionStatsModel value)
    {
        PTIPortal.DA.Models.GameSessionStats newSessionStats = new DA.Models.GameSessionStats();
        newSessionStats.GameSessionStatsId = value.GameSessionStatsId;
        newSessionStats.Platform = value.Platform;
        newSessionStats.GameKey = value.GameKey;
        newSessionStats.SessionId = value.SessionId;
        newSessionStats.SessionStartDateTime = value.SessionStartDateTime;
        newSessionStats.SessionUpdateTime = value.SessionUpdateTime;
        newSessionStats.UserName = value.UserName;
        PTIPortal.DA.GameStatisticsDA gameStatsDA = new DA.GameStatisticsDA();
        string result = gameStatsDA.CreateOrUpdateStatistics(newSessionStats);
        HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, result);
        return response;
    }
一切正常,直到我在项目中启用开放Id身份验证, 即使我将[AllowAnonymous]设置为操作。 这是Startup.Auth.cs配置,如果我启用行app.UseOpenIdConnectAuthentication,参数为null,如果我对其进行注释,则参数接收正常

app.UseOpenIdConnectAuthentication(
            new OpenIdConnectAuthenticationOptions
            {
                ClientId = clientId,
                Authority = Authority,
                PostLogoutRedirectUri = postLogoutRedirectUri,

                Notifications = new OpenIdConnectAuthenticationNotifications()
                {
                    AuthenticationFailed = (context) =>
                        {
                            return Task.FromResult(0);
                        },
                    //
                    // If there is a code in the OpenID Connect response, redeem it for an access token and refresh token, and store those away.
                    //
                    AuthorizationCodeReceived = (context) =>
                    {
                        var code = context.Code;
                        ClientCredential credential = new ClientCredential(clientId, appKey);
                        string userObjectID = context.AuthenticationTicket.Identity.FindFirst(
                                "http://schemas.microsoft.com/identity/claims/objectidentifier").Value;
                        AuthenticationContext authContext = new AuthenticationContext(Authority, new NaiveSessionCache(userObjectID));
                        AuthenticationResult result = authContext.AcquireTokenByAuthorizationCode(
                            code, new Uri(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Path)), credential, graphResourceId);
                        AuthenticationHelper.token = result.AccessToken;
                        return Task.FromResult(0);
                    },
                    MessageReceived = (context) =>
                    {
                        return Task.FromResult(0);
                    },
                    RedirectToIdentityProvider = (context) =>
                    {
                        return Task.FromResult(0);
                    },
                    SecurityTokenReceived = (context) =>
                    {
                        return Task.FromResult(0);
                    },
                    SecurityTokenValidated = (context) =>
                    {
                        return Task.FromResult(0);
                    }

                }

            });
在使用WWWForm构建请求时,或者在服务器端的配置方面,我是否遗漏了什么

谢谢