Sustainsys / Saml2

Saml2 Authentication services for ASP.NET
Other
959 stars 602 forks source link

SPOptions.Logger null reference exception #1161

Closed Wolfthorne closed 2 years ago

Wolfthorne commented 4 years ago

Information needed

Sustainsys.Saml2 - 2.4.0 Should run without null reference exceptions. Either require SPOptions Logger or null check because it causes null reference exceptions

Issue #731 seems very similar but I am using the web config to create my SPOptions.

Additional info

.Net Framework 4.7.2 Aspnet MVC 5.2.7

I was able to solve the issue by null checking where logger is used. If this is required it should error before.

AndersAbel commented 4 years ago

SPOptions should default to a NullLoggerAdapter, which removes the need to have null checks everywhere. What package are you using? HttpModule? Owin? AspNetCore2?

Wolfthorne commented 4 years ago

I am using the Owin package. I am also using the config option when I do not pass SPOptions.

On Mon, Mar 16, 2020 at 1:49 PM Anders Abel notifications@github.com wrote:

SPOptions should default to a NullLoggerAdapter, which removes the need to have null checks everywhere. What package are you using? HttpModule? Owin? AspNetCore2?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Sustainsys/Saml2/issues/1161#issuecomment-599675386, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLPURX3T6OZJBW6TLL4HMLRHZRBBANCNFSM4K2KIKDQ .

AndersAbel commented 4 years ago

The Owin module relies on app.CreateLogger<T>() to build a default logger. I don't understand how there can be a null ref in that case.

Can you please share a stack trace?