concept authorization in category swagger

appears as: uthorization, authorization, Authorization
Designing APIs with Swagger and OpenAPI

This is an excerpt from Manning's book Designing APIs with Swagger and OpenAPI.

We’re going to be looking at authentication and authorization, two close friends in APIs that are often a little misunderstood. Authentication is about proving you are, who you say, you are — which could be through a username and password. While authorization is about being allowed to access to special resources or actions that are normally private. Like getting user details or creating a new review.

APIs almost always include a form of authorization (and of course a type of authentication), so naturally describing them is important. In today’s world we have multiple standards dealing with authorization, each with different tradeoffs and strengths, and we should communicate to our consumers which of these standards we use.

Personally, one of the biggest hurdles to using an API, is getting authorization to work. I’ve found myself wading through documentation just to be able to use the API!

Looking at the following diagram we can learn more about the POST /reviews operation and how it handles Authorization…

Figure 7.3. Diagram of authorization in POST /reviews
ch07 creating user flow