From 503b8e8a4cdc12a6bbf223b2cb304a75f50cdf8b Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 12 Nov 2016 15:30:26 -0500 Subject: [PATCH] Call the MessageUnbound notification on logout too (#580) --- Kentor.AuthServices.Tests/WebSSO/LogoutCommandTests.cs | 7 +++++++ .../Configuration/KentorAuthServicesNotifications.cs | 2 +- Kentor.AuthServices/WebSSO/LogOutCommand.cs | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Kentor.AuthServices.Tests/WebSSO/LogoutCommandTests.cs b/Kentor.AuthServices.Tests/WebSSO/LogoutCommandTests.cs index 57a17b355..ee1bc8a19 100644 --- a/Kentor.AuthServices.Tests/WebSSO/LogoutCommandTests.cs +++ b/Kentor.AuthServices.Tests/WebSSO/LogoutCommandTests.cs @@ -238,11 +238,18 @@ public void LogoutCommand_Run_HandlesLogoutResponse() { notifiedCommandResult = cr; }; + var responseUnboundCalled = false; + options.Notifications.MessageUnbound = ur => + { + ur.Should().NotBeNull(); + responseUnboundCalled = true; + }; var actual = CommandFactory.GetCommand(CommandFactory.LogoutCommandName) .Run(request, options); actual.Should().BeSameAs(notifiedCommandResult); + responseUnboundCalled.Should().BeTrue("the ResponseUnbound notification should have been called."); var expected = new CommandResult { diff --git a/Kentor.AuthServices/Configuration/KentorAuthServicesNotifications.cs b/Kentor.AuthServices/Configuration/KentorAuthServicesNotifications.cs index 0819064f9..eb6d814b5 100644 --- a/Kentor.AuthServices/Configuration/KentorAuthServicesNotifications.cs +++ b/Kentor.AuthServices/Configuration/KentorAuthServicesNotifications.cs @@ -67,7 +67,7 @@ public KentorAuthServicesNotifications() public Func GetBinding { get; set; } /// - /// Notification called when the ACS command has extracted data from + /// Notification called when the command has extracted data from /// request (by using ) /// public Action MessageUnbound { get; set; } diff --git a/Kentor.AuthServices/WebSSO/LogOutCommand.cs b/Kentor.AuthServices/WebSSO/LogOutCommand.cs index 7a6fd968e..b55946109 100644 --- a/Kentor.AuthServices/WebSSO/LogOutCommand.cs +++ b/Kentor.AuthServices/WebSSO/LogOutCommand.cs @@ -70,6 +70,8 @@ public CommandResult Run(HttpRequestData request, IOptions options) if (binding != null) { var unbindResult = binding.Unbind(request, options); + options.Notifications.MessageUnbound(unbindResult); + VerifyMessageIsSigned(unbindResult, options); switch (unbindResult.Data.LocalName) {