DEV Community

Auth By Example
Auth By Example

Posted on

Service identity is not user permission

mTLS or a service JWT proves which workload called your API. That is authentication of the caller, not authorization of what it may do.

A backend service that successfully presents its certificate can still be wrong to read Alice's invoice, delete Tenant B's project, or act as an end user it does not represent. Authenticate the service, then separately authorize the subject, resource, and action — ideally with the end-user (or tenant) context the service is acting for, not just "this pod is trusted."

If your only check is "valid service identity," you have authenticated a caller and skipped authorization.

Top comments (0)