For testing, you can register an application that supports user authentication using device code flow.
-
Open a browser and navigate to the Microsoft Entra admin center and login using a Work or School Account.
-
Select Applications in the left-hand navigation bar, then select App registrations.
-
Select New registration. Enter a name for your application, for example,
Budget Tracker Testing. -
Set Supported account types to Accounts in this organizational directory only.
-
Leave Redirect URI empty.
-
Select Register. On the application's Overview page, copy the value of the Application (client) ID and Directory (tenant) ID.
-
Select Authentication under Manage. Locate the Advanced settings section and change the Allow public client flows toggle to Yes, then choose Save.
-
Open BudgetTracker.http in Visual Studio Code.
-
Replace all instances of
API_CLIENT_IDwith the Application (client) ID you generated in the previous steps. -
Replace all instances of
TENANT_IDwith the Application (client) ID you generated in the previous steps. -
If you do not have the REST Client Visual Studio Code extension installed, install it before proceeding to the next step.
-
Locate the GetBudgets request in BudgetTracker.http. Select the Send Request link to send this request in order to initialize authentication.
-
In the dialog, select Sign in to open your browser to the sign in page.
-
At the Enter code prompt, paste the code and select Next. Follow the prompts until you see a success message.
-
Return to Visual Studio Code and select Done in the dialog.
-
The API response is displayed in a new tab.
After you've initialized authentication with the GetBudgets request, you can test the other requests in the file.
