[annotator-dev] annotator-store confusion

Ewald Zietsman ewald at siyavula.com
Mon Mar 26 14:33:55 UTC 2012


I've upgraded my store (unmodified, its the okfn-master) today and I've run
into some issues that is most likely due to my lack of understanding. I'm
running the standard run.py, which is a dummy store as far as I understand.

Now I've read the docs but I still don't follow the authentication process.
So here goes:

     1. Alice builds a website with documents which need annotating,

I'm using the demo.html file for this as I have done before.

     2. Alice registers DocLand with AnnotateIt, and receives a "consumer
key/secret" pair.
How do I do this? I used to be able to log in to the store via its URL
(localhost:5000) but now I just get "Annotator Store API" when I go there.
Do I still log in to the store like before (e.g. like I would on

    3. Alice's users (Bob is one of them) login to her DocLand, and receive
an authentication token, which is a cryptographic hash of (among other
things) their unique user ID at DocLand, and DocLand's "consumer secret".
I understand this part as having to write a little web service that creates
the token, possible even using the code given on this page:

    4.  and 5. seems like magic. I assume that is part of the annotator's
Auth plugin or something
        e.g. $(body).annotator().annotator('setupPlugins', {tokenUrl: '

where that /api/token url returns the aforementioned token. Also, I
probably need to set up my own store to handle the authentication that I
get from my site.

At the moment, I'm running the demo.html file that is included in the
annotator source, and I've added some plugins (categories, comments,
store). That worked fine until this morning. Now I cannot load annotations
from the store, instead I get the message: - - [26/Mar/2012 16:29:00] "GET /annotations HTTP/1.1" 500 -
Traceback (most recent call last):
line 1518, in __call__
    return self.wsgi_app(environ, start_response)
line 1506, in wsgi_app
    response = self.make_response(self.handle_exception(e))
line 1504, in wsgi_app
    response = self.full_dispatch_request()
line 1264, in full_dispatch_request
    rv = self.handle_user_exception(e)
line 1262, in full_dispatch_request
    rv = self.dispatch_request()
line 1248, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
line 42, in index
    consumer, user = g.auth.request_credentials(request)
AttributeError: 'MockAuthenticator' object has no attribute

I'm assuming that I can't run a dummy store and dummy page anymore and will
need to make a more realistic testing site that has real authentication. I
probably also need to configure my demo store to be more realistic and
handle the authentication requests, although I'm unsure how to do that. Is
there an example somewhere that I can look at to see how it works?

Any help will be greatly appreciated.

Ewald Zietsman

Technical Coor**dinator*
Website: www.siyavula.com
The Open Innovation Studio, 27 Buitenkant Street, Cape Town, 8001
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20120326/15b1956d/attachment-0001.html>

More information about the annotator-dev mailing list