[annotator-dev] User authentication issues

Khan A. A.Khan at soton.ac.uk
Thu Jan 16 12:43:04 UTC 2014


Hi Nick/All,

I have been struggling with user authentication since last few days but couldn't work it out as yet. Here is my code

<script type="text/javascript">
jQuery(function ($) {

    var content = $('#content').annotator();

    content.annotator('addPlugin', 'Auth', {
  tokenUrl: 'http://annotateit.org/api/token'
});
var currentURL = window.location.href;
var uri=currentURL;

  content.annotator('addPlugin', 'Tags');
  content.annotator('addPlugin', 'Filter');

/*this code ensures that all annotations are available on http://annotateit.org/api. Without this, the annotations are stored locally- please see below*/


content.annotator ('setupPlugins', {}, {
Permissions:false,
AnnotationPermissions: {}

});

 /*this is when I want to store annotations locally. Don't want (as yet) to issue token on my own server but will do on production level

    content.annotator('addPlugin', 'Store', {
      // The endpoint of the store on your server.
      prefix: 'http://localhost:5000<http://localhost:5000/>',

      // Attach the uri of the current page to all annotations to allow search.
      annotationData: {
        'uri': uri
      },

      loadFromSearch: {
    'limit': 30,

      },

    });

    */


    });



I have created an account on http://annotateit.org and the above stores all annotations under my username "myUserName". I have a website on which I want some students and academics to annotate some content under their unique userid. I have read documentations and have tried various options like:




.annotator('addPlugin', 'Auth', {
userId: 'Unique_user_id',
consumerKey: 'f9e8c6172ece438b9fde9e39b7333036',
accountId: 'my_accountID',
authToken: 'eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJjb25zdW1lcktleSI6ICJhbm5vdGF0ZWl0IiwgImlzc3VlZEF0IjogIjIwMTQtMDEtMTZUMTI6NDA6MTMrMDA6MDAiLCAidHRsIjogODY0MDAsICJ1c2VySWQiOiAic3luY2hyb255In0.D8VSuU-vP8IGTyjNr1ZsGkKvrpblo1sLP7VMoQey7Ok
'//generated this by executing http://annotateit.org/api/token (while logged in).
});

All I need is to enable my users access my website http://www.mywebsite.com and annotate content on web pages under their userid so that I can show them their annotations when they are logged in on my website to encourage them to continue annotating content in the future.


Your help will be much appreciated.

Many thanks

Arshad




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140116/a36e8ef3/attachment-0003.html>


More information about the annotator-dev mailing list