
Explore how Azure AD B2C, Microsoft's identity management solution, scales to millions of users and billions of authentications, and learn to configure and consume it in .NET applications and API.
Learn how Azure Active Directory B2C centralizes registration, login, and password management, enabling token-based authentication for web apps and APIs, including social logins, without storing passwords locally.
Discover how Azure Active Directory B2C offloads security to a central store, removing password handling in your apps. Enable single sign on with social media platforms and MFA across apps.
Explore azure active directory b2c, create a b2c tenant, register apps, use OpenID Connect in .NET, and authenticate .NET MVC app with sign in, sign out, and edit profile.
Demonstrate building an Azure AD B2C demo: create a tenant, register apps, enable sign in and sign up with Facebook SSO, and deploy to Azure.
Explore the GitHub repository for the Azure AD B2C 2025 update to review commits and sections, use it for debugging, and progress through required configuration updates while avoiding direct cloning.
Sign up for an azure account at portal.azure.com, choose free credit or pay as you go, provide billing details, and ensure an active subscription.
Search for B2C, create an Azure Active Directory B2C tenant with a unique initial domain name ending in dot microsoft.com, then review, and create with a resource group and location.
Switch to your Azure Active Directory B2C tenant via the gear icon in directories and subscription, then refresh to access the new B2C directory and more options.
Switch between directories to access Azure AD B2C resources, create and test resources in a default directory, and focus on the B2C domain as the course directory.
Register a new application in the Azure AD B2C tenant, set a redirect URI with sign in oidc, and select accounts in any identity provider with OpenID Connect permission.
Explore a comprehensive overview of an azure ad b2c app registration, including client and object IDs, redirect uris, certificates and secrets, branding, permissions, and endpoints.
Create a sign in and sign up user flow in Azure AD B2C, configure email sign up, optional MFA, and select user attributes, naming it susi.
Explore the SUSI Demo of Azure Active Directory B2C user flow, including identity providers, user attributes, claims, and token settings, plus customizable sign in and sign up layouts.
Create and test three Azure Active Directory B2C user flows—profile editing, sign-up, and password reset—for .NET apps, including verification codes, first name and surname attributes, and redirect URIs.
Install the Microsoft Identity Web and Web UI NuGet packages to enable authentication features in your app, and save changes. Consume the registered app and its user flows.
Configure the app to use the registered Azure B2C app by adding a B2C section in appsettings.json with instance, domain, client id, and policy names, then wire them to authentication.
Configure program.cs to wire azure ad b2c authentication in a dotnet app by adding authentication, OpenID Connect defaults, and Microsoft Identity Web App using appsettings.json sections.
Create a login partial view to show sign in or sign up when unauthenticated and logout when authenticated, wiring Azure AD B2C endpoints and edit profile link in Microsoft Identity.
Follow sign in action with Azure AD B2C in a .NET app, configure Program.cs for Microsoft identity UI, handle redirect URIs, and test sign in, profile edit, and sign out.
Enable razor pages to fix the infinite sign-out loop for Azure AD B2C by adding builder.Services.AddRazorPages, mapping razor pages in program.cs, and configuring static assets.
Configure the sign-out flow for Azure B2C by redirecting to the home page via the on sign out callback in Microsoft Identity Web.
Modify the Azure Active Directory B2C user flow template to ocean blue, then refresh to apply the update across sign-in and related flows.
Learn to customize authentication in .NET by replacing Add Microsoft Identity web app with manual OpenID Connect configuration, including cookies defaults, add cookie, and OpenID Connect options.
Configure OpenID Connect for Azure AD B2C by setting host, client id, sign-up/sign-in policy, and authorities, then implement token validation and new login flows.
Configure sign in and sign out endpoints in the home controller using OpenID Connect for Azure AD B2C. Manage redirect URLs, client secrets, and app settings for secure authentication.
Resolve sign in errors involving access token and ID token by adding scope with the client ID in Azure Active Directory B2C, enabling login and sign out.
Map claims returned from Azure AD B2C to the user identity name in a .NET app, display a personalized hello, and verify mapping during login.
Add a custom authentication scheme for edit profile and register an OpenID Connect option with a unique callback path. Update app settings and portal redirects to enable profile edits.
Rename the default OpenID Connect handler to a custom name, such as B2C underscore one underscore CAC for sign up and sign in, then verify sign in and edit profile.
Configure an authorized endpoint by requiring login and setting the default challenge scheme to a registered scheme, using OpenID Connect to redirect to login before accessing the privacy view.
Learn to process OpenID Connect events by inspecting the context and protocol message for errors and descriptions, and redirect to the home page when access denied occurs.
Implement Azure Active Directory B2C authentication for both web and API by creating a demo API with dotnet 9, enabling Swagger via Swashbuckle, and running both projects with IIS Express.
The web project calls the API endpoint with IHttpClientFactory and dependency injection, builds a GET request, and displays the response, noting the API has no authorization yet.
Register an api app in Azure AD B2C using existing tenant users, create a sample api with no redirect uri, then expose a uri and scope for full access.
Expose the sample demo API in your app registration by adding the API permission and granting admin consent, enabling your web app to access the API.
Configure the api project by adding the api scope, updating appsettings.json with b2c settings, and enabling jwt bearer authentication via Microsoft Identity Web API in Program.cs.
Learn how to authorize api calls in a .NET app with Azure AD B2C by configuring scopes, obtaining an access token, and sending it in the HTTP authorization header.
Add a role attribute to the azure ad b2c user flow, expose it as a dropdown in sign-up with customer or homeowner options, and pass the role as a claim.
Demonstrates role-based access control by configuring OpenID Connect token validation, extracting extension_role, and mapping it to a claims identity for customer and home owner users, with signup and testing.
Secure a weather forecast api with a full access scope in Azure AD B2C, and show how role and scope checks govern access and prevent null role errors.
Integrate Facebook login with Azure B2C by configuring a Facebook app, setting client ID and secret, redirect URI, and email permission, then enable and test sign-in flow for user data.
Migrate from manual identity setup to the built-in Microsoft identity web app in a .NET app, display user names from claims, handle roles and API access, including Facebook login.
Modify program.cs to pass the API scope and enable token acquisition for downstream API calls. Inject IToken acquisition and in-memory token caches, then get access token for user async.
Deploy the web app to Azure via Visual Studio or portal, create an Azure B2C web app service on a free plan, adjust region, publish, and update redirect URIs.
Deploy the api to Azure Active Directory B2C, configure a free hosting plan, enable swagger, publish the web app to the new api endpoint, and redeploy to test sign-in redirect.
Demonstrates signing in with Facebook across owner and customer accounts, testing API calls, and validating access flows. Shows deploying the application and web API to Azure and verifying functionality.
Learn to implement Azure Active Directory and B2C in .NET apps by building foundations, managing security, roles, external logins, and user flows, then integrating them in real-world projects.
Explore building four projects with Azure AD and Azure AD B2C, implementing sign-in/out, API access, and custom roles such as home owner or contractor.
Outline the prerequisites for this course, including dotnet core, entity framework, and basic CRUD concepts; no prior Azure knowledge is required as we start by creating an Azure account.
Explore how to integrate Azure, B2C, and Azure Active Directory with dotnet core applications, including basic customizations, user flows, and external logins.
Access all course resources in one place on Dotnet mastery, including the GitHub code link, downloadable course content and PowerPoint, and section-specific snippets for coding.
Begin with Azure Active Directory by creating an Azure portal account, modify permissions, and create users, then build a Dotnet core app and add authentication.
Explore how Azure Active Directory provides a global, secure cloud identity and access management service for internal resources, applications, and APIs, with device support, modern protocols, and built-in security features.
Sign in to portal.azure.com, create a new Azure Active Directory tenant with a unique initial domain, and switch to the new directory once creation completes.
Explore the basics of Azure Active Directory in the portal, including managing users, guest users, groups, roles, app registrations, and tenants for Dotnet Mastery and upcoming B2C setup.
Create a new user in the Azure Active Directory domain with optional names and an auto-generated password, then sign in to portal.azure.com to update the password.
Learn how to promote a user to Global administrator, switch between admin and non-admin states, and invite and manage guest users in Azure Active Directory.
Register a new Azure AD application, enable single-tenant access for all directory users, configure the web app redirect uri for OpenID Connect, and note the client, tenant, and object ids.
Register the application in Azure Active Directory B2C, configure redirect and sign-out endpoints, and use implicit flow with ID tokens to secure sign-in and access Microsoft Graph permissions.
Configure your .NET app to authenticate with Azure Active Directory by adding Microsoft authentication dot OpenID Connect and Microsoft Identity dot Web packages, enabling cookies and OpenID Connect in startup.
Learn how sign in and sign out work in an Azure Active Directory B2C .NET app, including configuring OpenID Connect, signing in with Microsoft accounts, and managing user claims.
Fix the redirect loop by explicitly supplying the redirect url in the sign-in method and authentication properties, and ensure only tenant accounts (not external live.com users) can access the app.
switch from id tokens to code flow for server-side applications using azure ad b2c, configure a client secret, and update openid connect settings to enable secure authentication.
Create an ASP.NET Core Web API, secure it with Azure AD by installing the JWT bearer token NuGet package, and apply authorize globally to protect endpoints.
Create and configure a new API application in Azure AD, exposing the API with an application ID URI and scopes, and enable admin and user consent for access tokens.
Configure the api startup to enable JWT bearer authentication using the authority and audience from your client app, add authentication middleware before authorization, and call the weather forecast endpoint.
Call an API from the main web project using the http client factory and dependency injection, obtaining an access token and sending a request with a jwt bearer authorization header.
Demonstrate authenticating a call to a custom API by configuring delegated permissions, adding the admin scope, debugging tokens, and adjusting issuer validation.
Populate the name and email from claims by setting the name claim type in startup, and note Azure AD limitations before moving to Azure AD B2C for business-to-consumer use.
Azure has lots to offer but when it comes to securing application one thing that stands out is Azure Active Directory B2C. It is one of the buzz words with azure that is often misunderstood or misconfigured. In this course we will learn the basics of Azure Active Directory B2C (AD B2C)
There are many courses online which will teach you basics of Azure and what Azure AD B2C is, but there are very few to none that comes close to actually implementing and consuming Azure AD B2C. That will be the main focus of this course.
When you’re finished with this course, you’ll have the skills and knowledge of Azure AD B2C needed to allow anybody to sign-in to your applications and then manage those users.
Throughout the course we will
Create B2C tenant and register applications
Consume Azure B2C in a .NET MVC application
User flows in azure B2C
Add B2C authentication using AddMicrosoftIdentityWebApp
Custom properties in user flows
Customize consuming B2C using OpenIdConnect in .NET
Secure API using azure B2C
Single Sign-On
Deploying applications to Azure
Common errors and edge cases
This course will take you through the basics and give you a solid foundation in Azure Active Directory B2C to implement authentication in your .NET Applications.