From 3193e5a9d83f6da45dd015da5d2bb60975e9fef7 Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Mon, 14 Jul 2025 16:30:07 +0100 Subject: [PATCH 1/3] TD-5752: Issue showing 'Your password has been changed' when logged out from the moodle screen --- .../LearningHub.Nhs.Auth/Controllers/HomeController.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Auth/LearningHub.Nhs.Auth/Controllers/HomeController.cs b/Auth/LearningHub.Nhs.Auth/Controllers/HomeController.cs index aa0937f..9d1ae11 100644 --- a/Auth/LearningHub.Nhs.Auth/Controllers/HomeController.cs +++ b/Auth/LearningHub.Nhs.Auth/Controllers/HomeController.cs @@ -83,18 +83,18 @@ public async Task Error() /// /// IsPasswordUpdateMethod. /// - /// The Logout. + /// The PasswordUpdate. /// The . [HttpGet] - public IActionResult SetIsPasswordUpdate(bool isLogout) + public IActionResult SetIsPasswordUpdate(bool isPasswordUpdate) { - if (isLogout) + if (isPasswordUpdate) { - this.webSettings.IsPasswordUpdate = false; + this.webSettings.IsPasswordUpdate = true; } else { - this.webSettings.IsPasswordUpdate = true; + this.webSettings.IsPasswordUpdate = false; } var redirectUri = $"{this.webSettings.LearningHubWebClient}Home/UserLogout"; From de78ea15cea4666cfefa1f9d1448c57bae64ac90 Mon Sep 17 00:00:00 2001 From: Colin Beeby Date: Wed, 16 Jul 2025 14:52:53 +0100 Subject: [PATCH 2/3] Added moodlemooc stanza to appsettings.json --- Auth/LearningHub.Nhs.Auth/appsettings.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Auth/LearningHub.Nhs.Auth/appsettings.json b/Auth/LearningHub.Nhs.Auth/appsettings.json index 533cb08..8f45884 100644 --- a/Auth/LearningHub.Nhs.Auth/appsettings.json +++ b/Auth/LearningHub.Nhs.Auth/appsettings.json @@ -220,6 +220,23 @@ "RequireConsent": false, "RequirePkce": false, "AllowOfflineAccess": true + }, + "moodlemooc": { + "BaseUrl": "", + "ClientName": "", + "ClientSecret": "", + "AllowedGrantTypes": [ "authorization_code" ], + "RedirectUris": [ "/auth/oidc/" ], + "PostLogoutUris": [ "/login/logout.php" ], + "AllowedScopes": [ "openid", "profile", "learninghubapi", "userapi", "roles", "learningcredentialsapi" ], + "BackChannelLogoutSessionRequired": true, + "BackChannelLogoutUri": "/login/logout.php", + "FrontChannelLogoutSessionRequired": true, + "FrontChannelLogoutUri": "/login/logout.php", + "UpdateAccessTokenClaimsOnRefresh": true, + "RequireConsent": false, + "RequirePkce": false, + "AllowOfflineAccess": true } }, "IdsClients": { From 24d65226518bc8b6b7893452da25c87e1fdd631d Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Wed, 23 Jul 2025 11:17:33 +0100 Subject: [PATCH 3/3] TD-5752: # Need to revert the code # Code to test the logout issue from Moodle --- Auth/LearningHub.Nhs.Auth/Controllers/AccountController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Auth/LearningHub.Nhs.Auth/Controllers/AccountController.cs b/Auth/LearningHub.Nhs.Auth/Controllers/AccountController.cs index 123fe1a..3018203 100644 --- a/Auth/LearningHub.Nhs.Auth/Controllers/AccountController.cs +++ b/Auth/LearningHub.Nhs.Auth/Controllers/AccountController.cs @@ -277,7 +277,7 @@ public async Task Logout(LogoutInputModel model) { UserId = userId, UserHistoryTypeId = (int)UserHistoryType.Logout, - Detail = @"User logged out", + Detail = @"User logged out" + this.webSettings.IsPasswordUpdate + " " + vm.TriggerExternalSignout, }; await this.UserService.StoreUserHistoryAsync(userHistory);