Azure Ad B2c Asp Net Core Save

A sample demonstrating how you can configure your ASP.NET Core 5.0 applications to take advantage of Azure AD B2C to perform such tasks as authenticating users, protecting Web APIs, redeeming authorization code, calling a protected Web API.

Project README

azure-ad-b2c-asp-net-core

A sample demonstrating how you can configure your ASP.NET Core 7.0 applications to take advantage of Azure AD B2C, Microsoft Identity Web and MSAL to perform such tasks as:

  • Authenticate users
  • Protect Web APIs
  • Redeem authorization code
  • Call a protected Web API
  • Implement self-service password reset
  • Implement profile editing

Please find more information in this walk-through post: Create user flows

This post describes how it used to be during .NET Core 2.0 days: Setting up your ASP.NET Core 2.0 apps and services for Azure AD B2C

Most of the configurations and workarounds are handled by official packages now (for example, AADB2C90091 response on cancelling profile editing). However, it may give you more insights on why things are done in a certian way.

Configuration

Web App

"Authentication": {
    "AzureAdB2C": {
      "Instance": "https://{your-tenant-name}.b2clogin.com",
      "Domain": "<your-tenant-name>.onmicrosoft.com",
      "ClientId": "<client id>",
      "CallbackPath": "/signin-oidc",
      "SignedOutCallbackPath": "/signout/B2C_1_SignUpAndSignIn",
      "SignUpSignInPolicyId": "B2C_1_SignUpAndSignIn",
      "ResetPasswordPolicyId": "B2C_1_PasswordReset",
      "EditProfilePolicyId": "B2C_1_ProfileEdit",
      // To call an API
      "ClientSecret": "[client secret]"
    }
  },
  "TestService": {
    "BaseUrl": "https://localhost:5001",
    "Scopes": "e.g. https://{your-tenant-name}.onmicrosoft.com/testapi/read_values"
  }

TestService

"Authentication": {
    "AzureAdB2C": {
      "Instance": "https://{your-tenant-name}.b2clogin.com",
      "Domain": "<your-tenant-name>.onmicrosoft.com",
      "ClientId": "<client id>",
      "SignUpSignInPolicyId": "B2C_1_SignUpAndSignIn"
    }
  }
Open Source Agenda is not affiliated with "Azure Ad B2c Asp Net Core" Project. README Source: dzimchuk/azure-ad-b2c-asp-net-core
Stars
33
Open Issues
2
Last Commit
11 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating