Managing external identities to enable secure access for partners, customers, and other non-employees
The documented fields intended for client handling are error and, when present, suberror.
From the Native Authentication API reference:
-
erroris described as an error code string that can be used to classify types of errors and react to errors. -
suberroris described as an error code string that can be used to further classify types of errors. -
error_codesis described as a list of Microsoft Entra-specific error codes that can help diagnose errors.
Based on that:
-
error_codesis not the recommended field for client-side distinction of Native Authentication error conditions. The documentation explicitly positions it as diagnostic data, whileerrorandsuberrorare the fields described for classification and reaction. -
error_codesis defined as a list, but the provided documentation does not state when multiple values are returned or give any Native Authentication examples with more than one value. - There is no documented interpretation model in the provided material for multiple
error_codesvalues. No ordering semantics or precedence rules are described. - The stable fields documented for identifying specific Native Authentication error conditions are:
-
errorfor the primary category -
suberrorfor finer-grained classification when included
-
Examples from the documentation support this pattern:
- Sign-up and sign-in flows list supported
errorvalues such asinvalid_request,invalid_grant,invalid_client,expired_token, and others. - Several flows state that when
errorisinvalid_grant, Microsoft Entra includessuberrorto indicate the exact cause. - In SSPR,
invalid_grantcan be refined bysuberrorsuch asinvalid_oob_value.
A practical interpretation from the documented contract is:
- Use
errorfirst to branch by broad failure type. - Use
suberrorwhen present to distinguish specific causes within that failure type. - Treat
error_codes,trace_id,correlation_id, andtimestampas diagnostics and support/troubleshooting data rather than application control signals.
The provided documentation does not contain a documented recommendation beyond that.