简体   繁体   中英

how can I make sure that the origin of the request to my server is legit?

I am developing a web application where I have to make sure the provided origin of the request trough http headers is correct?

let's say I am expecting a request from example.com, the only way to check request origin(as domain) is trough provided request headers as far as I know, I know that I can control the access to the server trough "Allow-Access-Control-Headers:"example.com"" header but what is preventing example2.com putting a origin header that says the request is coming from example.com?

unfortunately you cant, as it can be faked easily. if you application requires top notch security then i suggest you look into AUTH tokens

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM