Maulik Dave
Maulik Dave

Reputation: 185

Azure AD Application can have SPA or Web App or we can have both?

Azure AD Application can have SPA or Web App or we can have both? i have create app in azure ad and that have both web and api and both have local host url.

  1. so web application redirect uri :localhost:/5020 added platform web

  2. web api redirect uri :localhost:/5030 added this will web api platform

but it giving me error with react msal.js "Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type"

Upvotes: 0

Views: 1910

Answers (1)

kavya Saraboju
kavya Saraboju

Reputation: 10831

  1. SPA app is actually written in JavaScript which control the UI elements to sign in users and acquire tokens or even call the web apis directly from the browser using the javascript. Such applications must be registered under SPA while registering in azure ad app registration.
  2. Where as web apps also do render pages from HTML and javascript ,but calling web API's is done on backend. So they must be registered under web app platform.

So please change the App registration -> Authentication->platform type to SPA if it only uses Java script (ex: angular, react etc) instead of Web. Or change it to web otherwise. enter image description here

Also after correcting that, please make sure you are not using client credential flow for your SPA App i.e.; (using client secret).Use authorization code flow instead in that case.

Upvotes: 0

Related Questions