Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5603 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 17
2695
0
thg 3 17
3078
0
thg 6 25
2310
3
thg 12 23
21586
3
thg 4 23
34377