This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
Azure AD B2C- read options from appsettings.json not load properly #1528
Closed
Description
Hi,
I develop service fabric app:
This line of code do not load all options from appsettings.json properly:
Returned error: CallbackPath must be defined...
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(sharedOptions =>
{
sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
//.AddAzureAd(options => Configuration.Bind("AzureAd", options)) - THIS DO NOT WORKING
// THIS CODE WORKING:
.AddAzureAd(options =>
{
options.Instance = "https://login.microsoftonline.com/common";
options.ClientId = "ClientId ";
options.CallbackPath = "/signin-oidc"; //HERE IS CallbackPath DEFINED
})
.AddCookie();
services.AddMvc();
}
appsettings.json:
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/common",
"ClientId": "ClientId",
"CallbackPath": "/signin-oidc"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}