Secure development

Preserving user identity across application service boundaries

Secure implementation: code, settings, gate arranged to illustrate preserving user identity across application service boundaries.

Preserving user identity across application service boundaries connects a security requirement to the behaviour of a real feature. The relevant controls need to remain effective across custom code, integrations and the production configuration. Understanding user identity across application service boundaries helps establish which security property the feature needs and where that property is actually enforced.

What does this involve?

A framework provides useful security mechanisms only when the application uses them consistently and deploys them with appropriate settings. Custom handlers, plugins and alternate execution paths can bypass protections that the development team assumes are automatic.

Identity propagation carries authenticated user context between services. Choose a representation that each recipient can validate and that limits where credentials can be used; OAuth security guidance recommends restricting access tokens to their intended resources and actions. See Authentication Patterns for authenticating the original request and Authorisation Patterns for enforcing access decisions.

Separate the identity of the calling service from the user on whose behalf it acts. Authenticate service connections using the controls in Microservices Security; possession of user context alone does not establish the caller's service identity.

Why it matters

Consider a realistic failure: a downstream service acts with an application's broad identity instead of the initiating user's authorised scope.

A configuration or integration mistake can affect many routes at once. The important question is which application data and operations become reachable, rather than whether a framework option merely differs from its default.

Implementation guidance should be applied to a real feature and its deployment. Framework defaults, custom handlers and integrated services all influence whether the intended protection remains effective.

How penetration testers check for it

Trace the relevant feature from its entry point to the data or operation it protects, including custom code and alternate paths.

  • Review supported runtime versions and release settings.
  • Trace identity, input and output through real application paths.
  • Inspect custom integrations and security overrides.
  • Test important negative cases alongside ordinary functionality.

How to fix it

Use the appropriate maintained mechanisms and verify the result in the actual production configuration.

  • Accept identity assertions only from configured issuers authorised to make those assertions. For JSON Web Tokens (JWTs), validate the signature, allowed algorithm, issuer, audience, token type, and validity period according to the applicable token profile. RFC 8725 explains why signature verification alone is insufficient.
  • For opaque access tokens, use the issuer's supported validation mechanism. A token's representation does not determine whether it grants access to a particular operation.
  • Reject missing or invalid context. Each receiving service must still authorize the requested action and resource. A valid signature establishes the issuer and integrity of an assertion, not permission for every request.
  • Avoid unnecessary custom replacements for trusted mechanisms.
  • Retain regression checks for the application's actual trust boundaries.

A secure framework cannot determine every business permission or data ownership rule. Those requirements still need clear application design and enforcement.

Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.

Read about our methodology or contact pentested.com to discuss secure development and code review.

See your first test report this week.

Book a 30 minute demo. We will verify one of your targets with you and run a test against it, so you can judge the results on your own systems.

Book a demo