# HG changeset patch # User Sebastien Jodogne # Date 1781864874 -7200 # Node ID 95cb8629add452f8d56c582d071613cfac0b9c70 # Parent 0e695d856b0cb8b38ee7df281ce0a6646fffe4db# Parent 5a15b3b0075322fabc78f2387daa4dd9391d43b0 merge diff -r 0e695d856b0c -r 95cb8629add4 .hgignore --- a/.hgignore Fri Jun 19 12:26:55 2026 +0200 +++ b/.hgignore Fri Jun 19 12:27:54 2026 +0200 @@ -8,3 +8,4 @@ i/ s/ w32/ +.vscode/ \ No newline at end of file diff -r 0e695d856b0c -r 95cb8629add4 NEWS --- a/NEWS Fri Jun 19 12:26:55 2026 +0200 +++ b/NEWS Fri Jun 19 12:27:54 2026 +0200 @@ -5,6 +5,8 @@ * Disabled "Expect: 100-continue" HTTP header during LTI registration, which is not always properly handled by certain LTI deployments (e.g., if HAProxy is put in front of Moodle) +* New configuration "EnableVerboseLogs" to display more information, amongst other, + during LTI configuration. * REST API: Job ID is reported when starting the DICOM-ization, and upload ID is part of the DICOM-ization status diff -r 0e695d856b0c -r 95cb8629add4 Sources/EducationConfiguration.cpp --- a/Sources/EducationConfiguration.cpp Fri Jun 19 12:26:55 2026 +0200 +++ b/Sources/EducationConfiguration.cpp Fri Jun 19 12:27:54 2026 +0200 @@ -56,6 +56,7 @@ hasPluginVolView_(false), hasPluginWholeSlideImaging_(false), hasPluginOhif_(false), + isVerboseLogsEnabled_(false), sequenceProjectIds_(0) { } @@ -730,3 +731,14 @@ return NULL; } + + +void EducationConfiguration::SetVerboseLogsEnabled(bool enable) +{ + isVerboseLogsEnabled_ = enable; +} + +bool EducationConfiguration::IsVerboseLogsEnabled() const +{ + return isVerboseLogsEnabled_; +} diff -r 0e695d856b0c -r 95cb8629add4 Sources/EducationConfiguration.h --- a/Sources/EducationConfiguration.h Fri Jun 19 12:26:55 2026 +0200 +++ b/Sources/EducationConfiguration.h Fri Jun 19 12:27:54 2026 +0200 @@ -67,6 +67,7 @@ bool hasPluginVolView_; bool hasPluginWholeSlideImaging_; bool hasPluginOhif_; + bool isVerboseLogsEnabled_; unsigned int sequenceProjectIds_; @@ -191,4 +192,8 @@ AuthenticatedUser* DoHttpHeaderAuthentication(uint32_t headersCount, const char* const* headersKeys, const char* const* headersValues); + + void SetVerboseLogsEnabled(bool enable); + + bool IsVerboseLogsEnabled() const; }; diff -r 0e695d856b0c -r 95cb8629add4 Sources/LTI/LTIRoutes.cpp --- a/Sources/LTI/LTIRoutes.cpp Fri Jun 19 12:26:55 2026 +0200 +++ b/Sources/LTI/LTIRoutes.cpp Fri Jun 19 12:27:54 2026 +0200 @@ -183,9 +183,20 @@ std::map form; HttpToolbox::ParseFormUrlEncoded(form, request->body, request->bodySize); + if (EducationConfiguration::GetInstance().IsVerboseLogsEnabled()) + { + LOG(INFO) << "ServeLaunch payload: " << std::string(reinterpret_cast(request->body), static_cast(request->bodySize)); + } + CheckState(form, request); JWT jwt(HttpToolbox::ReadMandatoryString(form, "id_token")); + + if (EducationConfiguration::GetInstance().IsVerboseLogsEnabled()) + { + LOG(INFO) << "Verifying JWT: " << HttpToolbox::ReadMandatoryString(form, "id_token"); + } + platformKeysRegistry_->VerifyJWT(jwt, EducationConfiguration::GetInstance().GetLtiPlatformKeysUrl(), 60 /* must be short-lived */); std::map custom; diff -r 0e695d856b0c -r 95cb8629add4 Sources/Plugin.cpp --- a/Sources/Plugin.cpp Fri Jun 19 12:26:55 2026 +0200 +++ b/Sources/Plugin.cpp Fri Jun 19 12:27:54 2026 +0200 @@ -645,6 +645,7 @@ OrthancPluginRegisterHttpAuthentication(context, HttpAuthentication); OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback); + EducationConfiguration::GetInstance().SetVerboseLogsEnabled(configEducation.GetBooleanValue("EnableVerboseLogs", false)); std::string s; if (configEducation.LookupStringValue(s, "AuthenticationHttpHeader"))