Skip to content

Instantly share code, notes, and snippets.

@cdennig

cdennig/apsettings.json

Last active Sep 6, 2017
Embed
What would you like to do?
B2C config
{
"AzureAdB2C": {
"Instance": "https://login.microsoftonline.com/tfp/",
"ClientId": "8b2b1e43-a2f7-4538-afbf-9b7ac293ea1f",
"Domain": "aureliab2c.onmicrosoft.com",
"SignUpSignInPolicyId": "B2C_1_signupin"
},
"Logging": {
"IncludeScopes": false,
"Debug": {
"LogLevel": {
"Default": "Warning"
}
},
"Console": {
"LogLevel": {
"Default": "Warning"
}
}
}
}
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(sharedOptions =>
{
sharedOptions.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddAzureAdB2CBearer(options => Configuration.Bind("AzureAdB2C", options));
services.AddMvc();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseCors(builder =>
{
builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod();
});
app.UseAuthentication();
app.UseMvc();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment