Tech Talk Hub

Design, Build High Performance Applications

Azure AD B2C: Call an ASP.NET Web API from an ASP.NET Web App

This sample contains a solution file that contains two projects: HOATest.Web and HOATEST.API.

  • HOATest.Web is a “BookStore” ASP.NET MVC web application where the users books in a online store. These CRUD operations are performed by a backend web API. The web app displays the information returned from the ASP.NET Web API.
  • HOATest.API is the backend ASP.NET API that manages and stores each user’s book store list.

The sample covers the following:

  • Calling an OpenID Connect identity provider (Azure AD B2C)
  • Acquiring a token from Azure AD B2C using MSAL

How To Run This Sample

There are two ways to run this sample:

  1. Using the demo environment – The sample is already configured to use a demo environment and can be run by downloading this repository and running the app on your machine. Follow the steps listed below in the section Using the demo environment
  2. Using your own Azure AD B2C tenant – Once you have the sample running locally using the demo tenant, you can configure the sample to use your own Azure AD B2C tenant instead. Follow the steps listed below in the section Using your own Azure AD B2C tenant

Using the demo environment

This sample demonstrates how you can sign in or sign up for an account at “HOA Web App” (the demo environment for this sample) using a ASP.NET MVC Web Application.

Once singed in, you can create and edit your todo items.

Step 1: Clone or download this repository

From your shell or command line:

git clone https://github.com/masoodwasim/HOATestSample-AzureADB2C.git

masoodwasim

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top
www.000webhost.com