Skip to content

Instantly share code, notes, and snippets.

@christiannagel
Created July 12, 2018 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiannagel/56b00913351ecbceba906666dd4d9b42 to your computer and use it in GitHub Desktop.
Save christiannagel/56b00913351ecbceba906666dd4d9b42 to your computer and use it in GitHub Desktop.
ASP.NET Core Container Configuration for Azure AD B2C
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddAuthentication(AzureADB2CDefaults.AuthenticationScheme)
.AddAzureADB2C(options => Configuration.Bind("AzureAdB2C", options));
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment