{"action":"opened","issue":{"url":"https://api.github.com/repos/openannotation/annotator/issues/574","labels_url":"https://api.github.com/repos/openannotation/annotator/issues/574/labels{/name}","comments_url":"https://api.github.com/repos/openannotation/annotator/issues/574/comments","events_url":"https://api.github.com/repos/openannotation/annotator/issues/574/events","html_url":"https://github.com/openannotation/annotator/issues/574","id":115411246,"number":574,"title":"User property is not being sent with 2.0 master","user":{"login":"ianjevans","id":5760366,"avatar_url":"https://avatars.githubusercontent.com/u/5760366?v=3","gravatar_id":"","url":"https://api.github.com/users/ianjevans","html_url":"https://github.com/ianjevans","followers_url":"https://api.github.com/users/ianjevans/followers","following_url":"https://api.github.com/users/ianjevans/following{/other_user}","gists_url":"https://api.github.com/users/ianjevans/gists{/gist_id}","starred_url":"https://api.github.com/users/ianjevans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianjevans/subscriptions","organizations_url":"https://api.github.com/users/ianjevans/orgs","repos_url":"https://api.github.com/users/ianjevans/repos","events_url":"https://api.github.com/users/ianjevans/events{/privacy}","received_events_url":"https://api.github.com/users/ianjevans/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-06T00:57:36Z","updated_at":"2015-11-06T00:57:36Z","closed_at":null,"body":"I'm testing 2.0 master with our internal docs review system, and it appears that the identity module is not properly setting the user property of the annotation when creating it.\r\n\r\nHere is our setup:\r\n\r\n```\r\nfunction addAnnotations() {\r\n\r\n    var username = readCookie(\"dsdocs.review.username\");\r\n        if ((!username)||(username=='null')) {\r\n        username = prompt(\"Enter your email address to comment on the docs: \", \"\");\r\n        createCookie(\"dsdocs.review.username\", username, 365);\r\n    }\r\n\r\n    console.log('username is ' + username);\r\n\r\n    var pageUri = function () {\r\n        return {\r\n            beforeAnnotationCreated: function (ann) {\r\n                ann.uri = window.location.href;\r\n            }\r\n        };\r\n    };\r\n\r\n    var app = new annotator.App();\r\n    app.include(annotator.ui.main, {element: document.article});\r\n    app.include(annotator.storage.http, {prefix: '/api'});\r\n    app.include(pageUri);\r\n    app.include(annotator.identity.simple);\r\n\r\n    app.start()\r\n        .then(function () {\r\n            app.ident.identity = username;\r\n            app.annotations.load({uri: window.location.href});\r\n    });\r\n}\r\n```\r\nNote that I'm logging the username to the browser's console.\r\n\r\nThe store is based on annotator-store, and is a Flask app. Here's the POST method, where I'm logging the user from the request.\r\n\r\n```\r\n@app.route('/annotations', methods=['POST'])\r\ndef create():\r\n    if request.get_json() is not None:\r\n        cursor = get_db()\r\n        try:\r\n            annotation = Annotation(request.get_json())\r\n        except KeyError:\r\n            return jsonify('Not all fields included.', status=400)\r\n\r\n        app.logger.info('user is %s', annotation.user)\r\n        annotation.save(cursor)\r\n\r\n        return jsonify(annotation.dict()), 201\r\n    else:\r\n        return jsonify('No JSON annotation sent', status=400)\r\n```\r\nAnnotations are being created, but the user property is always None. E.g.\r\n\r\n```\r\n  {\r\n    \"resolved\": false, \r\n    \"updated\": 1446768162093, \r\n    \"created\": 1446768162093, \r\n    \"text\": \"Why is the username not being stored?\", \r\n    \"tags\": [], \r\n    \"uri\": \"http://notus/en/tutorials/kerberos/kerberos/settingUp.html\", \r\n    \"schema_version\": \"1.0\", \r\n    \"ranges\": [\r\n      {\r\n        \"start\": \"/div[1]/div[2]/div[2]/article[1]/h1[1]\", \r\n        \"end\": \"/div[1]/div[2]/div[2]/article[1]/h1[1]\", \r\n        \"startOffset\": 8, \r\n        \"endOffset\": 27\r\n      }\r\n    ], \r\n    \"user\": \"None\", \r\n    \"quote\": \"up your environment\", \r\n    \"id\": \"cb5ad0b0-92a0-478c-805b-4820bbc0d247\", \r\n    \"permissions\": {\r\n      \"read\": [], \r\n      \"admin\": [], \r\n      \"update\": [], \r\n      \"delete\": []\r\n    }\r\n  }\r\n```\r\nDespite the console showing that username is being properly set:\r\n\r\n```\r\nusername is ievans@datastax.com\r\n```"}}