Secure development

Choosing authentication patterns for application architectures

Trust boundaries: network, document, gate arranged to illustrate choosing authentication patterns for application architectures.

Choosing authentication patterns for application architectures 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 authentication patterns for application architectures helps establish which security property the feature needs and where that property is actually enforced.

What does this involve?

Authentication establishes who is making a request and the strength and freshness of that evidence. Enrolment, recovery, alternate channels and changes to authenticators are part of the same boundary. An impressive login screen provides little assurance if another path grants equivalent access with weaker checks.

The patterns apply to external actors (end users and client applications outside the system) and to internal actors (services, other workloads, and the nodes they run on), although the mechanisms and trust assumptions differ. Most systems authenticate in two phases:

This pattern addresses key limitations of Service-Level Embedded Authentication: fragmented identity management, duplicated credential stores, and lack of SSO. The service no longer verifies credentials directly. Instead, an external Identity Provider (IdP) authenticates the subject and issues authentication proofs; the service verifies these itself and extracts identity attributes for request processing.

Why it matters

Consider a realistic failure: a new service accepts an identity assertion without a clear decision about its issuer, audience or lifetime.

Account access can lead to disclosure, unwanted changes or misuse of a trusted identity. The consequence depends on the account's permissions and the actions available after authentication, rather than the appearance of the login mechanism.

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.

  • Map normal, alternate and recovery authentication journeys.
  • Compare verification across supported identities and application states.
  • Check expiry, reuse and the binding of challenges to their intended action.
  • Follow successful authentication into the operation that trusts it.

How to fix it

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

  • Edge-Level: authentication is centralized in a shared component at the system boundary.
  • Network-Layer (Node-Level): peers are authenticated cryptographically at the network layer, transparently to applications.
  • Authentication proof verification checks the reusable artifact issued after primary authentication (a session cookie, token, or assertion at the application layer; a TLS session key or IPsec Security Association at lower layers) so that primary authentication is not repeated on every request. NIST SP 800-63B describes this as session management based on a session secret.
  • Simplicity: Each service is self-contained and needs no external authentication infrastructure.
  • Require appropriate fresh evidence for sensitive changes.
  • Record important authentication events without retaining secrets.

Authentication and authorisation answer different questions. Establishing identity does not grant unrestricted permission to records or privileged functions.

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