{"action":"created","issue":{"url":"https://api.github.com/repos/mongodb/morphia/issues/73","labels_url":"https://api.github.com/repos/mongodb/morphia/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/mongodb/morphia/issues/73/comments","events_url":"https://api.github.com/repos/mongodb/morphia/issues/73/events","html_url":"https://github.com/mongodb/morphia/issues/73","id":13660921,"number":73,"title":"Add authentication [moved]","user":{"login":"jyemin","id":1111546,"avatar_url":"https://avatars.githubusercontent.com/u/1111546?v=3","gravatar_id":"","url":"https://api.github.com/users/jyemin","html_url":"https://github.com/jyemin","followers_url":"https://api.github.com/users/jyemin/followers","following_url":"https://api.github.com/users/jyemin/following{/other_user}","gists_url":"https://api.github.com/users/jyemin/gists{/gist_id}","starred_url":"https://api.github.com/users/jyemin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyemin/subscriptions","organizations_url":"https://api.github.com/users/jyemin/orgs","repos_url":"https://api.github.com/users/jyemin/repos","events_url":"https://api.github.com/users/jyemin/events{/privacy}","received_events_url":"https://api.github.com/users/jyemin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-04-25T20:51:41Z","updated_at":"2015-07-17T15:10:28Z","closed_at":"2013-04-25T20:51:42Z","body":"This is [Issue 73](http://code.google.com/p/morphia/issues/detail?id=73) moved from a Google Code project.\nAdded by 2010-06-28T14:11:12.000Z by [darin%pl...@gtempaccount.com](http://code.google.com/u/106929007945936052056/).\nPlease review that bug for more context and additional comments, but update this bug.\n Closed (Fixed).\n\nOriginal labels: Type-Enhancement, Priority-Low, Milestone-Release0.94\n\n### Original description\n\n    Add authentication to DataStoreImpl\n"},"comment":{"url":"https://api.github.com/repos/mongodb/morphia/issues/comments/122306731","html_url":"https://github.com/mongodb/morphia/issues/73#issuecomment-122306731","issue_url":"https://api.github.com/repos/mongodb/morphia/issues/73","id":122306731,"user":{"login":"duozhilin","id":13086368,"avatar_url":"https://avatars.githubusercontent.com/u/13086368?v=3","gravatar_id":"","url":"https://api.github.com/users/duozhilin","html_url":"https://github.com/duozhilin","followers_url":"https://api.github.com/users/duozhilin/followers","following_url":"https://api.github.com/users/duozhilin/following{/other_user}","gists_url":"https://api.github.com/users/duozhilin/gists{/gist_id}","starred_url":"https://api.github.com/users/duozhilin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duozhilin/subscriptions","organizations_url":"https://api.github.com/users/duozhilin/orgs","repos_url":"https://api.github.com/users/duozhilin/repos","events_url":"https://api.github.com/users/duozhilin/events{/privacy}","received_events_url":"https://api.github.com/users/duozhilin/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T15:10:28Z","updated_at":"2015-07-17T15:10:28Z","body":"maybe you could use the following code:\r\n\r\n        Morphia morphia = new Morphia();\r\n        ServerAddress addr = new ServerAddress(\"host\", 27017);\r\n        List<MongoCredential> credentialsList = new ArrayList<MongoCredential>();\r\n        MongoCredential credentia = MongoCredential.createCredential(\r\n\t        \"username\", \"dbname\", \"password\".toCharArray());\r\n        credentialsList.add(credentia);\r\n        MongoClient client = new MongoClient(addr, credentialsList);\r\n        datastore = morphia.createDatastore(client, \"dbname\");"}}