Troubleshooting Microsoft External ID custom authentication extensions

Sergio Passalacqua 20 Reputation points
2026-05-20T20:58:51.27+00:00

Hello

I have setup a new external id tenant. I have two customer authentication extensions

AttributeCollectionSubmit

TokenIssuanceStart

Each call different endpoint on the same api.

I setup external ID to federate to my production Entra ID. I then create a user flow, app registation, etc. I then run the user flow, I get to the new user signup page, fill out the fields but when I press next I then I get error

"Something went wrong. Contact your IT department if the problem persists."

Looking at the developer tools in edge, I see the error

{

"error": {

    "code": 6000,

    "correlationId": "f22236f8-4145-41a6-90ab-0118e4ed2f20",

    "timestamp": "2026-05-20 20:28:02Z",

    "isFatal": true,

    "message": "AADSTS1100001"

}

}

I specifically set these endpoints being called by the custom auth extension to allow anonymous and override authentication because I am not able to see any evidence at all in application insights that the API is even called.

ex route

    [HttpPost]

    [AllowAnonymous]

    [OverrideAuthentication]

    [Route("create")]

    public async Task<IHttpActionResult> Create()

Note these apis are .NEt apis running in AKS in a separate tenant (my production tenant).

I have tested the API independently of azure external ID, using postman. Returns the appropriate payload.

Can someone help me understand what's going on? How do I troubleshoot this. I've hit a dead end and we have a major deliverable with a customer.

Microsoft Security | Microsoft Entra | Microsoft Entra External ID

1 answer

Sort by: Newest
  1. AI answer

    2026-05-20T20:59:14.35+00:00

    Use the sign-in logs and the custom extension error codes to understand what is failing and whether the REST API is being called at all.

    1. Check Microsoft Entra sign-in logs for the exact custom extension error
      1. In the external tenant, go to Microsoft Entra admin center → Entra IDEnterprise appsSign-in logs.
      2. Open the latest failed sign-in that corresponds to the correlation ID/time.
      3. Select the Authentication Events tab.
      4. In this tab, look for:
        • HTTP status for the custom extension call
        • Custom extension error code (1003xxx)
        • Execution duration and retry count This tells whether the extension was invoked and what error Entra ID saw.
    2. Map the error from logs to the custom extension error table In the Authentication Events details, find the errorCode in the 1003000–1003027 range and match it to the documented meanings:
      • 1003005 CustomExtensionTimedOut: API didn’t respond within the allowed timeout or token invalid.
      • 1003007/1003009 CustomExtensionNullClaimsResponse / CustomExtensionEmptyResponse: body missing or null.
      • 1003006 CustomExtensionInvalidResponseContentType: content-type not application/json.
      • 1003002/1003003/1003008/1003010/1003012: response schema or action type invalid.
      • 1003014/1003015/1003020: configuration issues with identifierUris, domain name, or target URL.
      • 1003021: missing CustomAuthenticationExtensions.Receive.Payload permission.
      • 1003027: connection error to the API.
      Use the exact code from the sign-in log to narrow down whether this is:
      • A configuration problem (resourceId, targetUrl, permissions, URL format), or
      • A runtime problem (timeout, invalid response, content type, etc.).
    3. Verify custom extension configuration (resourceId/targetUrl) Based on the error codes reference:
      • Ensure the targetUrl and resourceId share the same fully qualified domain name (avoid 1003015 CustomExtensionDomainNameDoesNotMatch).
      • Ensure the resourceId appId corresponds to an existing service principal in the external tenant (avoid 1003016/1003017/1003019).
      • Ensure the targetUrl is a valid https URL (avoid 1003020 CustomExtensionIncorrectTargetUrlFormat).
      • Ensure the Microsoft Graph service principal is present and enabled (avoid 1003022).
      • Ensure the endpoint is not blocked (avoid 1003023).
    4. Verify permissions for the custom extension resource app
      • In the external tenant, open the app registration used as the resourceId for the custom extension.
      • Confirm that admin consent has been granted for the Microsoft Graph CustomAuthenticationExtensions.Receive.Payload app role (application permission) to the service principal that represents the custom extension client (avoid 1003021 CustomExtensionPermissionNotGrantedToServicePrincipal).
    5. Call the REST API directly with a proper Entra access token Because the API is in another tenant and you currently allow anonymous, confirm that the extension can reach it and that it behaves correctly when called as Entra expects:
      1. In the external tenant, open the Azure Functions authentication events API (or equivalent) app registration used for the custom extension.
      2. Create a client secret if not already present.
      3. From Expose an API, copy the Application ID URI (for example api://contoso.azurewebsites.net/aaaabbbb-0000-cccc-1111-dddd2222eeee).
      4. In an API testing tool, request a token:
        • POST to https://login.microsoftonline.com/{tenantID}/oauth2/v2.0/token.
        • Body (form-data):
          • grant_type: client_credentials
          • client_id: client ID of the application
          • client_secret: its client secret
          • scope: {Application ID URI}/.default
      5. Decode the access_token (for example with https://jwt.ms) and verify:
        • iss matches the issuer configured in the API.
        • aud matches the client ID configured in the API.
      6. Use this token as a Bearer token and call the same endpoints (create, etc.) that the custom extensions use, with the same request body shape expected by the extension type.
      If the API fails when called with this token or with the Entra extension payload, fix:
      • Authentication/authorization logic in the API (even if currently overridden).
      • Response content-type (application/json).
      • Response schema (must match the custom extension type’s schema).
    6. Confirm the API is reachable and not timing out If the sign-in logs show 1003005 CustomExtensionTimedOut or 1003027 CustomExtensionConnectionError:
      • Check network connectivity from Entra to the AKS-hosted API (public DNS, firewall, IP restrictions, TLS cert validity).
      • Ensure the API responds within the two-second timeout window. If there are downstream calls, add logging for their durations and consider caching tokens and using a “warm” hosting plan as recommended.
    7. Enable and use detailed logging on the API side The platform hosting the API (for example, Azure Functions or other API platform) should log:
      • All incoming requests (method, path, correlation IDs if passed, timestamps).
      • Response status codes and durations.
      • Any exceptions when parsing the Entra extension payload.
      If no requests appear at all during a sign-in attempt, the problem is in custom extension configuration or Entra’s ability to reach the endpoint (use sign-in logs and error codes to pinpoint). If requests appear but sign-in still fails, align the response format with the extension’s expected schema.
    8. Performance and reliability checks If performance-related errors appear (timeouts, throttling):
      • Cache any downstream access tokens.
      • Log and optimize calls to downstream services.
      • Host the API on a plan that keeps it warm (for example, Premium or Dedicated for Azure Functions).
      • Use automated integration tests or API testing tools to validate performance against the two-second limit.

    By combining the Authentication Events details in sign-in logs with the custom extension error codes and a direct, token-based call to the API, it becomes clear whether the issue is configuration (resourceId/targetUrl/permissions), connectivity, timeout, or response schema/content-type.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.