Tag: azure app service envrmnt

Azure应用服务 – 自定义身份validation – 不允许HTTP动词

我按照本教程在我的Xamarin.Forms应用程序中启用身份validation: https ://adrianhall.github.io/develop-mobile-apps-with-csharp-and-azure/chapter2/custom/ Postman的测试(如教程中所述)成功完成。 令牌返回。 当我从我的C#代码中调用它时… LoginAsync(“custom”, Newtonsoft.Json.Linq.JObject.FromObject(auth)); 我收到的错误如下: Method not allowed. HTTP Verb not allowed 我发现Azure SDK在调用LoginAsync时发送POST和GET请求。 所以我改变了这个…… [HttpPost, Route(“.auth/login/custom”)] public IHttpActionResult Post([FromBody]CPM.Arda.Mobile.Freelancer.Backend.DataObjects.Recruitment.Custom.PromoterAuthRequest promoterAuth) 对… [HttpPost, HttpGet, Route(“.auth/login/custom”)] public IHttpActionResult Post([FromBody]CPM.Arda.Mobile.Freelancer.Backend.DataObjects.Recruitment.Custom.PromoterAuthRequest promoterAuth) HTTP Verb错误消失但发生以下错误: Operation=ReflectedHttpActionDescriptor.ExecuteAsync, Exception=System.NullReferenceException: Object reference not set to an instance of an object. at CPM.Arda.Mobile.Freelancer.Backend.Controllers.Custom.CustomAuthController.Post(PromoterAuthRequest promoterAuth) at lambda_method(Closure , Object , […]