Skip to main content

AADSTS240004: Authorisation response did not contain a code

The authorisation response did not contain a code.

What to check​

  1. Read the underlying error in the response and confirm the request uses response_type=code where required.

Official reference​

Microsoft Learn: AADSTS error codes

Microsoft error lookup​

Message summary: The lookup includes the authorisation endpoint's underlying error when the response fails to return a code.

Fields in the message template: {errorInfo}.

Microsoft does not provide a separate remediation in the lookup.

Open AADSTS240004 in Microsoft’s lookup