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
Describe the bug
Sto provando a caricare un certificato da una configurazione custom nella classe CustomSpidEvents.cs come suggerito nella documentazione, quindi non fornisco nessuna sezione Certificate nell'appsettings. Il problema è che nella classe OptionsHelper.cs viene eseguito il seguente codice:
IConfigurationSection section3 = section1.GetSection("Certificate");
if (section3 != null)
{
string str = section3.GetValue<string>("Source");
if (str.Equals("Store", StringComparison.OrdinalIgnoreCase))
{
.......
}
Ma section3 non può essere null in quanto GetSection non torna mai null come indicato nella documentazione Microsoft
This method will never return null. If no matching sub-section is found with the specified key, an empty
Il metodo GetValue<string> invece torna null e quindi sul metodo Equals viene sollevata una NullReferenceException:
System.NullReferenceException: Object reference not set to an instance of an object.
at SPID.AspNetCore.Authentication.Helpers.OptionsHelper.CreateFromConfiguration(IConfiguration configuration)
at SPID.AspNetCore.Authentication.Models.SpidOptions.LoadFromConfiguration(IConfiguration configuration)
The text was updated successfully, but these errors were encountered:
Describe the bug
Sto provando a caricare un certificato da una configurazione custom nella classe
CustomSpidEvents.cs
come suggerito nella documentazione, quindi non fornisco nessuna sezione Certificate nell'appsettings. Il problema è che nella classeOptionsHelper.cs
viene eseguito il seguente codice:Ma section3 non può essere
null
in quantoGetSection
non torna mainull
come indicato nella documentazione MicrosoftIl metodo
GetValue<string>
invece torna null e quindi sul metodoEquals
viene sollevata unaNullReferenceException
:The text was updated successfully, but these errors were encountered: