Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 6. Accept API key authentication ... using a custom HTTP header (such as Api-Key).

Wouldn't a bearer token [1] make more sense? Defined for use by OAuth2, but I don't see why it couldn't be the general mechanism for... bearer tokens.

> 11. Return created resources upon POST

Especially important if your database+caching layers use eventual consistency.

[1] https://datatracker.ietf.org/doc/html/rfc6750



Authentication and Authorization are two subtly different things. In this case, you may want an API key (Authentication) to be required to ensure things like rate limiting is enforced, but then want proof that the call is operating on a user, or is a machine-to-machine interaction which OAuth2 Bearer tokens work nicely for (Authorization)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: