This repository has been archived by the owner on May 3, 2024. It is now read-only.
Configuration script registers a web app; needs to register a SPA #30
Labels
bug
Something isn't working
Library
@azure/msal-browser@2.7.0
Important: Please fill in your exact version number above, e.g.
msal@2.1.3
.Framework
Description
The sample application ms-identity-javascript-2 works if the app is registered manually but the provided Configuration.ps1 script will cause the app to fail with a CORS error. This is because the script registers a web app and not a Single Page Application.
Error Message
When running the app with the incorrectly configured app registration, this error appears in the browser console:
Access to fetch at 'https://login.microsoftonline.com/common/oauth2/v2.0/token' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Security
Regression
Version:
MSAL Configuration
Reproduction steps
Use the sample following the instructions in the AppCreationScripts folder, and running the supplied Configure.ps1 script before executing the application. In this case, the application logs the user in but fails to provide an access token. No information is displayed on the web page and the error above appears in the browser console.
Expected behavior
The application should succeed and display information from the Microsoft graph
Browsers/Environment
The text was updated successfully, but these errors were encountered: