OidcAadB2C 2.0.0

dotnet add package OidcAadB2C --version 2.0.0
NuGet\Install-Package OidcAadB2C -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OidcAadB2C" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OidcAadB2C --version 2.0.0
#r "nuget: OidcAadB2C, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OidcAadB2C as a Cake Addin
#addin nuget:?package=OidcAadB2C&version=2.0.0

// Install OidcAadB2C as a Cake Tool
#tool nuget:?package=OidcAadB2C&version=2.0.0

For use in projects needing Azure Active Directory and Azure B2C directory services.

Startup.cs

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();

        services.AddAuthentication(sharedOptions =>
	        {
		        sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
		        sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
	        })
	        .AddAzureAdB2C(options => Configuration.Bind("Authentication:AzureAdB2C", options))
	        .AddCookie(); // your bindings


		services.AddMvc();

        // Adds a default in-memory implementation of IDistributedCache.
		// Required for the B2C authentication
        services.AddDistributedMemoryCache();
        services.AddSession(options =>
        {
	        options.IdleTimeout = TimeSpan.FromHours(1);
	        options.Cookie.HttpOnly = true;
        });
    }

appsettings.json

{ "Authentication": { "AzureAdB2C": { "ClientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "ClientSecret": "----------------------", "Tenant": "yourb2c.onmicrosoft.com", "SignUpSignInPolicyId": "B2C_1A_SignUpOrSignInWithAAD", "EditProfilePolicyId": "B2C_1_DemoProfileEdits", "ResetPasswordPolicyId": "B2C_1_DemoNameHere", "RedirectUri": "http://localhost:5000/signin-oidc", "ApiUrl": "https://fabrikamb2chello.azurewebsites.net/hello", "ApiScopes": "https://fabrikamb2c.onmicrosoft.com/demoapi/demo.read" } }, ... rest of the settings

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 2,035 1/23/2018

Open ID Connect, Azure Active Directory B2C module to allow MVC apps to use Azure AD B2C connections. The MVC application requires the Startup.cs file have settings inserted to use this module. Use the starter template for this project type and then add your application specific settings to the appsettings.json file.