{"action":"created","issue":{"url":"https://api.github.com/repos/WP-API/WP-API/issues/1924","labels_url":"https://api.github.com/repos/WP-API/WP-API/issues/1924/labels{/name}","comments_url":"https://api.github.com/repos/WP-API/WP-API/issues/1924/comments","events_url":"https://api.github.com/repos/WP-API/WP-API/issues/1924/events","html_url":"https://github.com/WP-API/WP-API/issues/1924","id":124338713,"number":1924,"title":"Temporarly disable authentication","user":{"login":"bobdenardd","id":13862640,"avatar_url":"https://avatars.githubusercontent.com/u/13862640?v=3","gravatar_id":"","url":"https://api.github.com/users/bobdenardd","html_url":"https://github.com/bobdenardd","followers_url":"https://api.github.com/users/bobdenardd/followers","following_url":"https://api.github.com/users/bobdenardd/following{/other_user}","gists_url":"https://api.github.com/users/bobdenardd/gists{/gist_id}","starred_url":"https://api.github.com/users/bobdenardd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobdenardd/subscriptions","organizations_url":"https://api.github.com/users/bobdenardd/orgs","repos_url":"https://api.github.com/users/bobdenardd/repos","events_url":"https://api.github.com/users/bobdenardd/events{/privacy}","received_events_url":"https://api.github.com/users/bobdenardd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/WP-API/WP-API/labels/Support","name":"Support","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-30T11:52:45Z","updated_at":"2015-12-30T16:50:34Z","closed_at":"2015-12-30T16:50:34Z","body":"Hello everybody. I was wondering if there was an easy way to temporarly disable all authentication in order to create posts using the rest api without having to authenticate. I fullsy do understand the security concerns, this is only for testing purposes on a local environment.\r\nI tried using the basic authentication for days, but still didn't get it to work, and now just want something simple, like lines to comment out in the plugin code, just to be able to test some posting features.\r\nThanks in advance"},"comment":{"url":"https://api.github.com/repos/WP-API/WP-API/issues/comments/168032758","html_url":"https://github.com/WP-API/WP-API/issues/1924#issuecomment-168032758","issue_url":"https://api.github.com/repos/WP-API/WP-API/issues/1924","id":168032758,"user":{"login":"danielbachhuber","id":36432,"avatar_url":"https://avatars.githubusercontent.com/u/36432?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbachhuber","html_url":"https://github.com/danielbachhuber","followers_url":"https://api.github.com/users/danielbachhuber/followers","following_url":"https://api.github.com/users/danielbachhuber/following{/other_user}","gists_url":"https://api.github.com/users/danielbachhuber/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbachhuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbachhuber/subscriptions","organizations_url":"https://api.github.com/users/danielbachhuber/orgs","repos_url":"https://api.github.com/users/danielbachhuber/repos","events_url":"https://api.github.com/users/danielbachhuber/events{/privacy}","received_events_url":"https://api.github.com/users/danielbachhuber/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T16:50:34Z","updated_at":"2015-12-30T16:50:34Z","body":"> I was wondering if there was an easy way to temporarly disable all authentication in order to create posts using the rest api without having to authenticate.\r\n\r\nYou could force a specific user to be logged in for each user:\r\n\r\n```\r\n/*\r\n * Automagically authorize every request\r\n * INSECURE! DANGER! ONLY USE IN LOCAL ENVIRONMENT.\r\n */\r\nadd_filter( 'rest_authentication_errors', function(){\r\n\twp_set_current_user( 1 ); // replace with the ID of a WP user with the authorization you want\r\n}, 101 );\r\n```"}}