# HG changeset patch # User robcast # Date 1352831363 -3600 # Node ID d47513632da5f43ace097edd99272d7deb91df81 # Parent c1e7821d3c680a2eeefc5518653ba0a2aff1aaa5 additional annotationSafeTokenUrl for https url, used with passwords. we don't always use https for issues with self-signed certs. diff -r c1e7821d3c68 -r d47513632da5 webapp/src/main/webapp/jquery/digilib-ann.html --- a/webapp/src/main/webapp/jquery/digilib-ann.html Tue Nov 13 17:35:32 2012 +0100 +++ b/webapp/src/main/webapp/jquery/digilib-ann.html Tue Nov 13 19:29:23 2012 +0100 @@ -43,6 +43,8 @@ 'annotationsReadOnly' : false, // URL of authentication token server 'annotationTokenUrl' : 'http://libcoll.mpiwg-berlin.mpg.de/libviewa/template/token/getLoginToken', + // URL of safe authentication token server + 'annotationSafeTokenUrl' : 'https://libcoll.mpiwg-berlin.mpg.de/libviewa/template/token/getLoginToken', //'annotationTokenUrl' : 'http://localhost:8080/test/docuviewa/template/token/getLoginToken', // list of Annotator plugins 'annotatorPlugins' : ['Auth', 'Permissions', 'Store', 'Markdown', 'DigilibIntegrator'] diff -r c1e7821d3c68 -r d47513632da5 webapp/src/main/webapp/jquery/jquery.digilib.annotator.js --- a/webapp/src/main/webapp/jquery/jquery.digilib.annotator.js Tue Nov 13 17:35:32 2012 +0100 +++ b/webapp/src/main/webapp/jquery/jquery.digilib.annotator.js Tue Nov 13 19:29:23 2012 +0100 @@ -49,6 +49,8 @@ 'annotationsReadOnly' : false, // URL of authentication token server e.g. 'http://libcoll.mpiwg-berlin.mpg.de/libviewa/template/token' 'annotationTokenUrl' : null, + // URL of safe authentication token server e.g. 'https://libcoll.mpiwg-berlin.mpg.de/libviewa/template/token' + 'annotationSafeTokenUrl' : null, // annotation user name 'annotationUser' : 'anonymous', // list of Annotator plugins @@ -188,10 +190,20 @@ password = window.prompt("Please authenticate: Password", ''); // set params for Auth plugin auth.options.requestData.password = password; + // try to use the safe url for the password + if (data.settings.annotationSafeTokenUrl != null) { + auth.options.tokenUrl = data.settings.annotationSafeTokenUrl; + } else { + console.warn("Sending token password over standard-URL!"); + } } else { // use anonymous user user = 'anonymous'; delete auth.options.requestData.password; + if (data.settings.annotationSafeTokenUrl != null) { + // reset url to unsafe + auth.options.tokenUrl = data.settings.annotationTokenUrl; + } } } // set user in digilib