I have improved the logout handling slightly. I first improved the logging to be able to trace what is going on. Then I extended the information that is sent to the listener of the logout notification.
First of all, when a custom logger is set in the clients code like this:
authenticationBuilder.AddSaml2(authenticationScheme, options =>
{
options.SPOptions = new SPOptions
{
...
Logger = (ILoggerAdapter)logger
};
};
That logger got replaced by the default logger, so I introduced a check in for a custom logger before the default logger is set. That happens in the PostConfigureSaml2Options.cs
I added some verbose logging in LogOutCommand.cs.
The information sent in the options.Notifications.LogoutCommandResultCreated was very limited, only Location was set, so I added some details about the context of the logout to the Content member. I also adjusted the Unit Test to account for this change.
These are multiple changes in one PR and cannot be merged.
The PostConfigure bug fix looks correct, please submit in a separate PR.
Logging can always be improved, but the messages should be a bit more verbose to be readable without looking at the source code.
No, the Content field is not a place to put stuff. It is meant to be written as body content to the response and we do not want that with the received data.
I have improved the logout handling slightly. I first improved the logging to be able to trace what is going on. Then I extended the information that is sent to the listener of the logout notification.
First of all, when a custom logger is set in the clients code like this:
authenticationBuilder.AddSaml2(authenticationScheme, options => { options.SPOptions = new SPOptions { ... Logger = (ILoggerAdapter)logger }; }; That logger got replaced by the default logger, so I introduced a check in for a custom logger before the default logger is set. That happens in the
PostConfigureSaml2Options.cs
I added some verbose logging in
LogOutCommand.cs
.The information sent in the
options.Notifications.LogoutCommandResultCreated
was very limited, onlyLocation
was set, so I added some details about the context of the logout to theContent
member. I also adjusted the Unit Test to account for this change.