News for hackers. Stuff that matters.
Re:Ask HN: What's the recommended method of adding authentic... by pc86 on Tuesday January 16, 2018 @10:18AM (#16158728)
> Does it keep a copy somewhere and check against it on every request?

Yes. The last time I did this we checked the X-Token header on every request, if it didn't exist or there were multiple we replied 401. If only one was there we checked a DB table of active tokens, if it wasn't there or had expired we replied 401. If it was there but wasn't associated with a role that had access to the requested resource, we replied 403. If it was not expired and had access we continued with the request.

As soon as you get away from "check authentication on every request" your attack vectors increase. As a bad actor, I no longer need to bypass your authentication, I just need to bypass whatever system you have in place to decide whether or not to authenticate me. That's generally going to be easier.

Re:Ask HN: What's the recommended method of adding authentic... by mring33621 on Tuesday January 16, 2018 @11:01AM (#16159110)
I was planning to use custom headers over HTTPS for a similar thing, but then I read that some firewalls will strip custom headers, even over HTTPS. Can anyone with experience comment? Thanks.
Re:Ask HN: What's the recommended method of adding authentic... by matwood on Tuesday January 16, 2018 @12:58PM (#16160291)
Just use a Bearer token in the Authorization header from the OAuth spec: https://tools.ietf.org/html/rfc6750#section-2.1