# HG changeset patch
# User Alain Mazy <am@osimis.io>
# Date 1682503532 -7200
# Node ID dff72e397f9024af1987909726a17ab896c6f9c6
# Parent  90582b3bf0cf2c7146852b002f05597830f35d41
fix standard configuration 'orthanc-explorer-2' for TokenGetArguments

diff -r 90582b3bf0cf -r dff72e397f90 NEWS
--- a/NEWS	Sat Apr 15 08:00:23 2023 +0200
+++ b/NEWS	Wed Apr 26 12:05:32 2023 +0200
@@ -1,3 +1,9 @@
+Pending changes in the mainline
+===============================
+
+* Fix standard configuration "orthanc-explorer-2": consider the "token"
+  Get arguments
+
 2023-04-15 - v 0.5.1
 ====================
 
diff -r 90582b3bf0cf -r dff72e397f90 Plugin/DefaultConfiguration.json
--- a/Plugin/DefaultConfiguration.json	Sat Apr 15 08:00:23 2023 +0200
+++ b/Plugin/DefaultConfiguration.json	Wed Apr 26 12:05:32 2023 +0200
@@ -51,7 +51,7 @@
         // You may define other permissions yourself as long as they match the permissions
         // provided in the user-profile route implemented by the auth-service.
         // You may test your regex in https://regex101.com/ by selecting .NET (C#) and removing the leading ^ and trailing $
-        // The default configuration is suitable for Orthanc-Explorer-2 (see TBD sample)
+        // The default configuration is suitable for Orthanc-Explorer-2 (see https://github.com/orthanc-team/orthanc-auth-service)
         "Permissions" : [
             ["post", "^/auth/tokens/decode$", ""],
             ["post", "^/tools/lookup$", ""], // currently used to authorize downloads in Stone (to map the StudyInstanceUID into an OrthancID.  Not ideal -> we should define a new API that has the resource ID in the path to be able to check it at resource level) but, on another hand, you do not get any Patient information from this route
diff -r 90582b3bf0cf -r dff72e397f90 Plugin/Plugin.cpp
--- a/Plugin/Plugin.cpp	Sat Apr 15 08:00:23 2023 +0200
+++ b/Plugin/Plugin.cpp	Wed Apr 26 12:05:32 2023 +0200
@@ -760,7 +760,7 @@
             uncheckedResources_.insert("/osimis-viewer/config.js");
 
             tokens_.insert(OrthancPlugins::Token(OrthancPlugins::TokenType_HttpHeader, "token"));
-            tokens_.insert(OrthancPlugins::Token(OrthancPlugins::TokenType_GetArgument, "token"));  // for download links
+            tokens_.insert(OrthancPlugins::Token(OrthancPlugins::TokenType_GetArgument, "token"));  // for download links in Webviewer
           }
 
           if (standardConfigurations.find("stone-webviewer") != standardConfigurations.end())
@@ -782,6 +782,7 @@
 
             tokens_.insert(OrthancPlugins::Token(OrthancPlugins::TokenType_HttpHeader, "Authorization"));  // for basic-auth
             tokens_.insert(OrthancPlugins::Token(OrthancPlugins::TokenType_HttpHeader, "token"));          // for keycloak
+            tokens_.insert(OrthancPlugins::Token(OrthancPlugins::TokenType_GetArgument, "token"));         // for download links in OE2
           }
 
         }