Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5621 มุมมอง

I want a controller that receives a http post with  Name + Value data from SomeRandomServer.  This data is later written to a model.

IE An event occurs, SomeRandomServer sends a POST saying "event has occurred" and a field in a model is written to with "event has occurred".


How do I ensure that the data has actually came from SomeRandomServer and not an impersonator sending similar data? Normally with HTTP routes you can set the auth to user, but in this case the data is not coming from a user, but another api. So how would security be enforced? Can I restrict access to the route by some other means?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

how about you white-list the IP address of whatever server it is running on.

and/or create user for that model, make that api login and post.

to restrict others close it all other HTTP request ie. GET DELETE PUT so regular users won't see it. or give a redirect. only handle POST

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ค. 17
2703
0
มี.ค. 17
3081
0
มิ.ย. 25
2311
To show all stages in Kanban view แก้ไขแล้ว
3
ธ.ค. 23
21588
3
เม.ย. 23
34393