Social Connection with Microsoft Error "Proof Key for Code Exchange is required for cross-origin authorization code redemption"

Overview

A new Social connection with Microsoft was set up, but when trying to test the logins, the following error is seen: 
 

{
  "error": "access_denied",
  "error_description": "Proof Key for Code Exchange is required for cross-origin authorization code redemption."
}

 

This article describes the cause of this error and how to get past it.

Applies To

  • Microsoft
  • Social Connection
  • Proof Key Code Exchange

Cause

This error occurs because the redirect URI configured on the Azure side was set using the Single Page Application setting. It is possible for Azure to treat Auth0 as an SPA with the current setup and to require the PKCE exchange.


Auth0 uses the standard Authorization Code flow with Azure for these social connections, so these redirect URIs need to be setup as Web redirect URIs, and not under Single Page Applications.

 

Adding the tenant's /login/callback URL to the Web redirect URIs should allow the flow to complete.

Solution

  1. Add a new platform:
    1.jpeg
  2. Select Web and add the tenant's callback URI: "https://{AUTH0_DOMAIN}/login/callback".

Something similar to the below should be seen once this is set:

2.jpeg 


Recommended content

No recommended content found...