Best Practices for Securing Your APIs

API security as a strategy, not an afterthought: encryption, UUIDs, auth versus authorization, OAuth, OpenID Connect, and why hiding docs is not a control.

This presentation covers best practices for securing your APIs, including everything from encryption, to UUIDs, the differences between authentication and authorization, OAuth and OpenID Connect, and a host of other information around SSL, TLS, and more ways you can secure your APIs from those pesky would-be hackers.

Much has been said around securing APIs and fortunately people do try to implement some of these practices. Unfortunately, most do not implement multiple legged security thereby relying solely on a single measure or two simplistic and easy-to-defeat mechanisms to secure their APIs. Alas, some even rely on not publishing the documentation for their APIs as a measure of “security”. These methods are simply not acceptable and it’s important to approach security by believing that “there are indeed smarter hackers than you out there and that your information is always at risk.”

It is critical that you pay careful attention to security not as an afterthought, but as a well-formed strategy as you build your interfaces. Security should be engrained in every resource, every action, and truly everything you do as you build and design APIs.

One concrete control from that list is using UUIDs in your APIs. The design side of the same argument is in API modeling and design.

Read next.

Why you should use UUIDs in your APIs. For the hypermedia version of the same problem, API modeling and design.

Frequently asked questions

What does the talk cover?

Encryption, UUIDs, the difference between authentication and authorization, OAuth, OpenID Connect, SSL, TLS, and why a single weak control is not enough.

Why is hiding API docs not security?

Some teams treat unpublished documentation as a measure of security. The post says that is not acceptable. Assume there are smarter attackers, and that the information is always at risk.

When should API security start?

Not as an afterthought. Security should be part of every resource and every action as the API is designed.

Disagree or have a war story? Reply on X