You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<MicrosoftIdentityOptions>,MicrosoftIdentityOptionsValidation>());
#if DOTNET_CORE_31
builder.AddOpenIdConnect(openIdConnectScheme, options =>{// TODO: replace by the work around that @Tratcher will providerIServiceProviderserviceProvider= builder.Services.BuildServiceProvider();
#else
builder.AddOpenIdConnect<IServiceProvider>(openIdConnectScheme,(options,serviceProvider)=>{
#endif
MicrosoftIdentityOptionsmicrosoftIdentityOptions= serviceProvider.GetRequiredService<IOptions<MicrosoftIdentityOptions>>().Value;
**Which Version of Microsoft Identity Web are you using ?
Microsoft Identity Web 0.1.5-preview
Where is the issue?
Other? - please describe;
Repro
Remove the weird pattern for newing up redundant copies of MicrosoftIdentityOptions
WebApiAuthenticationBuilderExtensions.cs#L85-L88
WebAppAuthenticationBuilderExtensions.cs#L74-L75
WebApiCallsWebApiAuthenticationBuilderExtensions.cs#L63-L66
WebAppCallsWebApiAuthenticationBuilderExtensions.cs#L101-L102
Expected behavior
See also #234 which leverages the same mechanism
Proposed design
configureMicrosoftIdentityOptions(microsoftIdentityOptions);
because it's called automatically as registered by : https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web/WebApiAuthenticationBuilderExtensions.cs#L72same thing for https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web/WebAppAuthenticationBuilderExtensions.cs#L110, but the lines involving the MicrosoftIdentityOptions should be moved inside the
builder.AddOpenIdConnect
callback. The code could be something like:in https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web/WebApiCallsWebApiAuthenticationBuilderExtensions.cs#L78 and https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web/WebAppCallsWebApiAuthenticationBuilderExtensions.cs#L124, do something similar as in the previous 2 files.
The text was updated successfully, but these errors were encountered: