In this step, you need to configure the Redirect URL of your application registration information and then add the Application ID to your JavaScript SPA application.
Configure the Redirect URL
field with the URL for your index.html page based on your web server, then click Update.
To obtain your redirect URL:
For Python, you can set the web server port via command line. This guided setup uses the port 8080 for reference but feel free to use any other port available. In any case, use the following instructions to set up a redirect URL in the application registration information:
Sethttp://localhost:8080/
as aRedirect URL
on the top of this page, or usehttp://localhost:[port]/
if you are using a custom TCP port (where [port] is the custom TCP port number), and then click 'Update'
- Create a file named
msalconfig.js
containing the application registration information. If you are using Visual Studio, select the project (project root folder), right-click and select:Add
>New Item
>JavaScript File
. Name itmsalconfig.js
- Add the following code to your
msalconfig.js
file:
var msalconfig = {
clientID: "[Enter the application Id here]",
redirectUri: location.origin
};