-
Hello, On version 1.26.0 we were able to configugure the MicrosoftIdentityOptions using the following setup: // in a common nuget package used internally
services
.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(
jbo => azureAdConfig.Bind(jbo),
mio => azureAdConfig.Bind(mio))
// in project that consumes the package above
services.Configure<MicrosoftIdentityOptions>(opt =>
{
opt.ClientId = builder.Configuration["Some_config_key_pointing_to_a_client_id"];
}); When running the same code on version 2.5.0 services.Configure(...) method is not executed at all. Do you know how we can fix this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@edionu97, in 2.x, you now need to specify the authentication scheme. 1.x was trying to guess, but sometimes was getting it wrong, and the ASP.NET Core team advised we don't try to guess. you would need to write, in your case: // in project that consumes the package above
services.Configure<MicrosoftIdentityOptions>(JwtBearerDefaults.AuthenticationScheme, opt =>
{
opt.ClientId = builder.Configuration["Some_config_key_pointing_to_a_client_id"];
}); See https://github.com/AzureAD/microsoft-identity-web/wiki/v2.0#breaking-changes-1 |
Beta Was this translation helpful? Give feedback.
@edionu97, in 2.x, you now need to specify the authentication scheme. 1.x was trying to guess, but sometimes was getting it wrong, and the ASP.NET Core team advised we don't try to guess.
you would need to write, in your case:
See https://github.com/AzureAD/microsoft-identity-web/wiki/v2.0#breaking-changes-1