0

I am utterly confused about which platform configurations to use under Azure AD app's Authentication blade.

There are 2 platform configurations I am confused about:

  • "Web"
  • "Single-page application"

The app I have registered is a React JS app, which in my mind, is both a Web app AND a SPA. This "rabbit hole" get's deeper as I'm trying to configure redirect URIs so i can use MSAL.js to authenticate and authorize within the app.

Essentially, it comes down to this (for my http://localhost:5000 development environment):

If I specify my URI under Web, then I get error:

AADSTS9002326: Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type.

And from what ive been reading, Web platform is the way to go (not SPA).

Can somebody shed any light onto this convoluted area? Which platform configuration should I be using for a ReactJS app?

Thank you.

AlvinfromDiaspar
  • 6,611
  • 13
  • 75
  • 140

1 Answers1

0

• React js is mostly used to develop SPA (single page application) as it is a web application or website that interacts with the web browser by dynamically rewriting the current web page with new data from the web server, instead of the default method of the browser loading entire new pages. This means that the URL of your website will not change completely (page will not reload), instead it will keep getting content and rewriting the DOM with it instead of loading a new page. The goal is faster transitions that make the website feel more like a native app.

• When building you react-app, you can see that there is only one App.js from where your entire web-app is loaded in fragments and components. This behaviour of rendering components and pages on a single page and changing the DOM (is a single page behaviour and hence the name), instead of loading a new page with new content, this makes it feel like a single application.

• So, when you are using react js as a building code platform, I would suggest you use SPA as the platform in Azure AD app registration. That does not mean you cannot use react js to create an app on a remote web server and deploy it, you can but for hosting react js coded application script and running it as a worker process and provide a desirable output you need script execution backend runtime like ‘ngrok’ and ‘node.js’ to supplement the execution and provide compatibility with the web server environment.

Please refer below links for more information: -

Why is React Js called as Single Page Application

https://learn.microsoft.com/en-us/answers/questions/315313/azure-app-registration-causing-the-following-error.html

Kartik Bhiwapurkar
  • 4,550
  • 2
  • 4
  • 9