Skip to content
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
@miroslavsiska

Description

@miroslavsiska

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"
    }
  }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions