Hello everyone I am new to annotator.js, so probably this is a pretty naive question.
I want to use annotate.it as a backend for my annotations. I have created an account for it and dynamically create tokens using the jjwt library with the following code, where CONSUMER_KEY is the annotateit key for my account, CONSUMER_SECRET is the corr. secret and CONSUMER_TTL is set to 86400 (one day). String getToken() { // Use time for expiration TimeZone tz = TimeZone.getTimeZone("UTC"); DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); df.setTimeZone(tz); String nowAsISO = df.format(new Date()); Claims claims = Jwts.claims().setId(UUID.randomUUID().toString()) // uuid .setIssuer("http://www.ics.forth.gr/isl/LifeWatchAnnotation") .setAudience("http://www.annotateit.org"); claims.put("consumerKey", CONSUMER_KEY);// consumer key claims.put("userId", "myid"); // account Id for annotateit claims.put("issuedAt", nowAsISO); // time as ISO8601 claims.put("ttl", CONSUMER_TTL); // expire in seconds (one day) // Now create the token String token = Jwts.builder() .setClaims(claims) // Add the necessary claims for annotateit .signWith(SignatureAlgorithm.HS256, CONSUMER_SECRET).compact(); return token; } So up to here I think my token is valid as I have checked in http://jwt.io/ But unfortunately, when I add the store plugin in my js code, that uses the aforementioned token through the Auth plugin, I get the following error API request failed: '0' in annotator-full.min.js (line 17) Do you have any idea about what might be wrong? Thank you and best regards Panagiotis
_______________________________________________ annotator-dev mailing list annotator-dev@lists.okfn.org https://lists.okfn.org/mailman/listinfo/annotator-dev Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev