liveBook · Manning

Identity

As explained in Software Security for Developers

User identity is the identity of the human or system entity that initiates a request chain.

User identity answers: who initiated this request chain? Usually that entity is a customer, employee, or partner, but it can also be an API consumer acting for itself. Identity matters because secure applications must make design choices about identity, authentication, and authorization rather than treat every request as anonymous. section 1.4 section 3.4

A request may carry more than one identity. The user identity identifies the original requester; service identity identifies each application making calls on that user’s behalf. An edge service might receive a customer request and call an internal order or billing service, creating a chain that must preserve both kinds of identity. section 3.4

The practical difficulty is propagation. Services may use different programming languages and protocols, such as HTTP, gRPC, and AMQP. There is no industry-standard way to propagate user identity across all such calls, so systems rely on internal patterns and conventions. section 3.4

When a request identity cannot be trusted

An internal billing service accepts a header such as X-Service-Name: order-service without verifying the sender. An attacker can copy the header, impersonate the order service, submit fake invoices, and expose billing data. The safer design distinguishes the claimed identity from authentication: identity says who the caller claims to be; authentication checks whether that claim is true. section 16.1 section 16.4

For user-facing login, OpenID Connect adds authentication to OAuth 2. Its ID token carries user identity information such as an email or name, while OAuth 2 addresses what the client may access. Tenant-specific claims can keep users separated in multitenant systems. section 13.5

How Software Security for Developers covers it

How deep it goes
Defines user identity, distinguishes it from service identity and authentication, and explains propagation limits across protocols.
Examples
Uses customers, employees, API consumers, service call chains, spoofed headers, ID tokens, and tenant-specific claims.
What you can do after
Evaluate request designs by separating the initiating user from calling services and checking whether identity claims are authenticated.
How it connects
Connects identity with authentication, authorization, service identity, OAuth 2, OpenID Connect, and multitenancy.

Also explained in

Compare how 8 books explain identity →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Security for Developers. The section links point to the parts of the book it draws on.