-
Notifications
You must be signed in to change notification settings - Fork 218
Web API Template
Jean-Marc Prieur edited this page Apr 9, 2021
·
33 revisions
- You can create applications with the project templates provided by Microsoft Identity Web. This is explained in this article
- Then you can configure your applications using msidentity-app-sync which is a dotnet global tool that creates/updates Azure AD or Azure AD B2C apps and updates your code configuration.
You have two ways of installing the templates:
- either from NuGet
- or build them from the repository
You can download the Microsoft.Identity.Web.ProjectTemplates-1.8.2 NuGet package from NuGet.org. The following command will install the templates from NuGet.org (or anything referenced as .NET sources, for instance in NuGet.config)
dotnet new -i Microsoft.Identity.Web.ProjectTemplates::1.8.2
Alternatively if you want to build it yourself clone the Microsoft.Identity.Web repo, and then
dotnet pack /p:ClientSemVer=1.8.2
cd ProjectTemplates
cd bin
cd Debug
dotnet new -i Microsoft.Identity.Web.ProjectTemplates.1.4.0.nupkg
Microsoft identity platform web API
mkdir webapi
cd webapi
dotnet new webapi2 --auth SingleOrg
Microsoft identity platform web API calling Microsoft Graph
mkdir webapi-graph
cd webapi-graph
dotnet new webapi2 --auth SingleOrg --calls-graph
Microsoft identity platform web API calling a downstream API
mkdir webapi-calls-api
cd webapi-calls-api
dotnet new webapi2 --auth SingleOrg --called-api-url "https://localhost:12345" --called-api-scopes "api://{someguid}/access_as_user"
AzureAD B2C B2C
mkdir webapi-b2c
cd webapi-b2c
dotnet new webapi2 --auth IndividualB2C
gRPC Templates
-
dotnet new worker2 --auth SingleOrg
for AAD protected services -
dotnet new worker2 --auth IndividualB2C
for Azure AD B2C protected services dotnet new worker2 --auth SingleOrg --calls-graph
dotnet new worker2 --auth SingleOrg --called-api-url URL --called-api-scopes SCOPES
Azure Functions Templates
-
dotnet new func2 --auth SingleOrg
for AAD protected services -
dotnet new func2 --auth IndividualB2C
for Azure AD B2C protected services dotnet new func2 --auth SingleOrg --calls-graph
dotnet new func2 --auth SingleOrg --called-api-url URL --called-api-scopes SCOPES
cd ProjectTemplates
dotnet new -u Microsoft.Identity.Web.ProjectTemplates
- Home
- Why use Microsoft Identity Web?
- Web apps
- Web APIs
- Using certificates
- Minimal support for .NET FW Classic
- Logging
- Azure AD B2C limitations
- Samples
- Web apps
- Web app samples
- Web app template
- Call an API from a web app
- Managing incremental consent and conditional access
- Web app troubleshooting
- Deploy to App Services Linux containers or with proxies
- SameSite cookies
- Hybrid SPA
- Web APIs
- Web API samples
- Web API template
- Call an API from a web API
- Token Decryption
- Web API troubleshooting
- web API protected by ACLs instead of app roles
- gRPC apps
- Azure Functions
- Long running processes in web APIs
- Authorization policies
- Generic API
- Customization
- Logging
- Calling graph with specific scopes/tenant
- Multiple Authentication Schemes
- Utility classes
- Setting FIC+MSI
- Mixing web app and web API
- Deploying to Azure App Services
- Azure AD B2C issuer claim support
- Performance
- specify Microsoft Graph scopes and app-permissions
- Integrate with Azure App Services authentication
- Ajax calls and incremental consent and conditional access
- Back channel proxys
- Client capabilities