How to authenticate client-to-service and service-to-service solutions
Whether our application is designed with a monolithic pattern or a microservices pattern, in most cases, it will be necessary to consume a service as a client (a user logging in to a web application) or as a service (a microservice called to another microservice or a self-managed service).
For both cases, it is necessary to understand concepts such as authentication, authorization, identity and access management (IAM), and service account (among others), and we will review these concepts in this section.
IAM
Using basic created roles, it is possible to quickly select the necessary permissions to execute certain activities in each of the services. The task of associating one or more members (such as user accounts) with a single role is called binding, and a collection of those bindings is called a policy.
The basic existing roles are Owner (roles/owner), Editor (roles/editor), and Viewer (roles/viewer...