Back to front pageView on Hacker News (opens in a new tab)Ask HN: What's the recommended method of adding authentication to a REST API?397 pointsby somtum (on Hacker News)8 years agoComments (249) 36 threadsShow all commentsShowing thread 27 of 36[-]niwde8 years ago1 reply#Use Access-control-allow-origin and set it to only allow calls from a specific address.[-]ssudaraka8 years ago2 replies#Can someone fake the origin?fimdomeio8 years ago#This is controlled on browser level and most (all?) browsers implement this. Origin can be faked by just using anything that can make a http request, like curl. It exists to protect users not the server.askthrowaway8 years ago#from browser ? No. from non-browser clients like curl ? Yes. And your server will never be able to tell if it is fake or not
Ask HN: What's the recommended method of adding authentication to a REST API?397 pointsby somtum (on Hacker News)8 years ago
niwde8 years ago1 reply#Use Access-control-allow-origin and set it to only allow calls from a specific address.
fimdomeio8 years ago#This is controlled on browser level and most (all?) browsers implement this. Origin can be faked by just using anything that can make a http request, like curl. It exists to protect users not the server.
askthrowaway8 years ago#from browser ? No. from non-browser clients like curl ? Yes. And your server will never be able to tell if it is fake or not
Comments (249) 36 threads
Show all comments
Showing thread 27 of 36