diff Applications/StoneWebViewer/WebApplication/app.js @ 1761:28755e42c007

Fix issue #197 (Support for passing credentials with all HTTP requests)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 10 May 2021 11:51:53 +0200
parents 9ac2a65d4172
children 634ff8993f6a
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/app.js	Tue May 04 11:02:24 2021 +0200
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Mon May 10 11:51:53 2021 +0200
@@ -1050,6 +1050,13 @@
   if ('DicomCacheSize' in app.globalConfiguration) {
     stone.SetDicomCacheSize(app.globalConfiguration.DicomCacheSize);
   }
+
+  // Bearer token is new in Stone Web viewer 2.0
+  var token = getParameterFromUrl('token');
+  if (token !== undefined)
+  {
+    stone.AddHttpHeader('Authorization', 'Bearer ' + token);
+  }
   
   console.warn('Stone properly initialized');