Angular2 ASP.NET Core AntiForgeryToken

后端 未结 4 2020
礼貌的吻别
礼貌的吻别 2020-12-13 16:19

I have an Angular2 app. It is running within ASP.NET 5 (Core).
It makes Http calls to the controller which is working fine.

Bu

4条回答
  •  猫巷女王i
    2020-12-13 17:15

    I think you need to make custom AntiForgeryValidationToken attribute that supports sending token via header instead of form values. Then add token to header of every request from your Angular2 app to your api. Example here How do you set global custom headers in Angular2?

提交回复
热议问题