Azure App Registration causing the following error: cross-origin token redemption is permitted only for the 'Single-Page Application' client type.

Owen Coyle 1 Reputation point
2021-03-15T18:35:16.177+00:00

Hello!
I am currently setting up azure to work with Alteryx, so i can connect straight to OneDrive via their tools. This is done through the following documentation (https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-One-Drive/ta-p/299125)
Through following this exactly I received the following error:
77836-onedrive1.png

I struggled to find anything about this online, apart from this:
https://msft.it/6011VKSyT
Which i followed to turn it into a Single Page Application, but received the following:
77906-onedrive2.png

The only other thing i found was: msft.it/6013VKSyV
To which I received the following error:

77907-onedrive3.png

As the Alteryx Documentation asks for the replyURL type to be web, i suspect this isn't the issue. Any help on this one would be massively appreciated!

Thanks,
Owen

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,774 questions
{count} votes

8 answers

Sort by: Most helpful
  1. Martin Simard 21 Reputation points
    2021-04-30T18:39:39.913+00:00

    There are two cases for token redemption (using authorization_code mode): from Web Application and from Single-Page Application (PKCE).

    When using a SPA, Azure Identiy requires that the token redemption comes from a browser (not a web server). The request for the code exchange must contain the 'Origin' header. If not, you get the error: "Tokens issued for the 'Single-Page Application' client-type may only be redeemed via cross-origin requests"

    I have a small NodeJS app that I use to test all oAuth authorization modes, and I got the error reported in this thread because I use the same redeem function for WebApp and SPA.

    I removed the 'Origin' header, and the error is gone.

    If you have a Web Application, be sure that there is no 'Origin" header sent to the server when exchanging a code for a token.

    Not sure if it's a bug or feature tho!

    4 people found this answer helpful.

  2. CiesielskiRoman-3406 6 Reputation points
    2021-04-27T09:36:36.153+00:00

    I have the same error:
    AADSTS9002326: Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type.\r\nTrace ID: 7fa66d7b-1aa9-434d-a5eb-208b6f71a400\r\nCorrelation ID: a9eeac52-10f0-484b-a8dc-2ede67198945\r\nTimestamp: 2021-04-27 09:24:29Z

    My case: I am creating outlook adding with on_behalf_of authorization. When I try exchange outlook token to get token for MS Graph I have error. App is configured As SPA and Web.

    Any idea about solution?

    1 person found this answer helpful.
    0 comments No comments

  3. Mike Kaply 6 Reputation points
    2021-07-08T22:20:45.967+00:00

    In my testing, this was definitely related to an Origin header.

    I was using fetch from Javascript and it was adding "Origin": "null" which the Microsoft endpoint didn't like.

    I switched to using XHR and there was no Origin header, it worked.

    I think this is a Microsoft bug. It should ignore Origin null header.

    1 person found this answer helpful.
    0 comments No comments

  4. James Hamil 22,186 Reputation points Microsoft Employee
    2021-03-17T21:36:17.177+00:00

    Hi @Owen Coyle , As per this doc Tool Mastery | One Drive - Alteryx Community this app "Alteryx" needs to configured as a web app. That's what I can understand at least from the screenshots in that doc. Updating it to SPA doesn't make sense. The SO article I shared also speaks the same thing that it needs a web app and not SPA as the app platform. Please use Web as the app platform type and you still get the AADSTS9002326 error, then this case would need troubleshooting and will have to look deeper based on the correlationID and timestamp.

    If the Reply URL mistmatch is the error, then you can follow the steps mentioned here: https://learn.microsoft.com/en-us/answers/questions/270056/aadsts50011-the-reply-url-specified-in-the-request-17.html

    Please let me know if this helps! If so, please mark this answer as "Verified" so other users may reference it.

    Thank you,
    James

    0 comments No comments

  5. Surve, Siddhant [JJCUS NON-J&J] 1 Reputation point
    2021-04-19T19:04:29.663+00:00

    Hey @James Hamil I'm facing a similar issue, and I have configured the application via Azure as Web for the app platform type and still getting the AADSTS9002326 error

    Would it be helpful if I could share the Correlation ID and timestamp for troubleshooting. Any leads on the solution is highly appreciated. Thank you

    Please help !

    0 comments No comments