A minimal sample which shows how to use @azure/ms-rest-browserauth
in a browser application.
- Register a single page application in the Microsoft identity platform
- Configure the app registration with a redirect URI to specify where the Microsoft identity platform should redirect the client along with any security tokens.
- Follow the instructions at Redirect URI: MSAL.js 1.0 with implicit flow to set the redirect URI to http://localhost:3000
- Please note that
@azure/ms-rest-browserauth
does not support MSAL.js 2.0
- In this sample, we list the subscriptions available in your Azure account. For this to work, you need to ensure that your application has the right permission for the
Azure Service Management
API. To do so, follow the below instructions:- In your app registration in the Azure portal, go to
API Permissions
- Click on
Add a permission
- Select
Azure Service Management
- Check the box for
user_impersonation
permission
- In your app registration in the Azure portal, go to
- Keep in mind that the account administrator may need to grant admin consent for the Default Directory.
- For more information: Grant admin consent in App registrations.
- Replace the placeholder values in index.html with your own clientId and tenant
- Run
npm install
,npm start
, and navigate to localhost:3000