Auditing trust in external identity provider authentication
Authentication assurance includes the entire identity lifecycle, not only the primary login prompt. Understanding trust in external identity provider authentication 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.
Identity Providers (IdPs) provide federated identity for users. Users will often have more than one identity with multiple IdPs, such as an enterprise identity using Azure AD, Okta, Ping Identity, or Google, or consumer identity using Facebook, Twitter, Google, or WeChat, to name just a few common alternatives. This list is not an endorsement of these companies or services, but simply an encouragement for developers to consider the reality that many users have many established identities. Organisations should consider integrating with existing user identities, as per the risk profile of the IdP's strength of identity proofing. For example, it is unlikely a government organisation would accept a social media identity as a login for sensitive systems, as it is easy to create fake or throwaway identities, whereas a mobile game company may well need to integrate with major social media platforms to grow their active player base.
Secure use of external identity providers requires careful configuration and verification to prevent identity spoofing or forged assertions. This section provides requirements to address these risks.
Why it matters
Consider a realistic failure: a strong sign-in journey is bypassed through a weaker enrolment, recovery or alternative authentication path.
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.
A code audit connects a stated requirement to the implementation responsible for enforcing it. Source review and targeted behavioural checks should explain the same boundary and any relevant exceptions.
How penetration testers check for it
Review the specific control expectations below against the code, deployment and observable application behaviour.
- Verify that, if the application supports multiple identity providers (IdPs), the user's identity cannot be spoofed via another supported identity provider (eg. by using the same user identifier). The standard mitigation would be for the application to register and identify the user using a combination of the IdP ID (serving as a namespace) and the user's ID in the IdP.
- Confirm that the presence and integrity of digital signatures on authentication assertions are always validated, rejecting any assertions that are unsigned or have invalid signatures.
- Confirm that SAML assertions are uniquely processed and used only once within the validity period to prevent replay attacks.
- Verify that, if an application uses a separate Identity Provider (IdP) and expects specific authentication strength, methods, or recentness for specific functions, the application verifies this using the information returned by the IdP.
- 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
Implement the required boundary in the component that actually performs the sensitive operation and retain focused regression coverage.
- Apply consistent verification at trusted boundaries.
- Protect enrolment, replacement and recovery as carefully as login.
- 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.
Related issues
- Auditing OpenID provider identity and authentication assertions
- Reviewing federated re-authentication and identity freshness
- MCP server authentication, scopes and delegated user identity
Read about our methodology or contact pentested.com to discuss the security of your application code.