ms-identity-docs-code-dotnet icon indicating copy to clipboard operation
ms-identity-docs-code-dotnet copied to clipboard

Demonstrate how to get token in sample

Open ardalis opened this issue 1 year ago • 1 comments

In this tutorial: https://github.com/Azure-Samples/ms-identity-docs-code-dotnet/blob/main/web-api/README.md

It skips over how to get a token in this section: https://github.com/Azure-Samples/ms-identity-docs-code-dotnet/blob/main/web-api/README.md#3-send-an-authenticated-request-to-the-web-api

Please add this detail or link to another tutorial that includes this information.

ardalis avatar Oct 17 '24 18:10 ardalis

The documentation for the MSAL library covers this. Have a look at https://learn.microsoft.com/en-us/entra/identity-platform/scenario-spa-app-registration#redirect-uri-msaljs-20-with-auth-code-flow

Or, I've got a working version with both an Angular front end and a WebApi backend here https://github.com/Brubning/Angular-MsIdentity

That's running against a developer instance of Entra ID. Change the environments.ts in the Angular application, and the appsettings.json in the WebAPI application to use your own tenantid, clientid and scopes.

Brubning avatar Mar 24 '25 08:03 Brubning