{"id":26763,"date":"2013-12-17T05:14:59","date_gmt":"2013-12-17T05:14:59","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/json-api-auth\/"},"modified":"2025-07-29T11:41:53","modified_gmt":"2025-07-29T11:41:53","slug":"json-api-auth","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/json-api-auth\/","author":71405,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"3.0.0","stable_tag":"3.0.0","tested":"6.8.5","requires":"3.0.1","requires_php":"5.3","requires_plugins":null,"header_name":"JSON API Auth","header_author":"Ali Qureshi","header_description":"","assets_banners_color":"91bacd","last_updated":"2025-07-29 11:41:53","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/www.parorrey.com","header_plugin_uri":"http:\/\/www.parorrey.com\/solutions\/json-api-auth\/","header_author_uri":"http:\/\/www.parorrey.com","rating":4.7,"author_block_rating":0,"active_installs":800,"downloads":79128,"num_ratings":11,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.1":{"tag":"0.1","author":"parorrey","date":"2013-12-17 05:17:38"},"1.0":{"tag":"1.0","author":"parorrey","date":"2014-01-27 09:56:29"},"1.1":{"tag":"1.1","author":"parorrey","date":"2014-07-23 06:22:32"},"1.2":{"tag":"1.2","author":"parorrey","date":"2014-07-24 07:07:05"},"1.3":{"tag":"1.3","author":"parorrey","date":"2014-08-11 13:21:45"},"1.4":{"tag":"1.4","author":"parorrey","date":"2014-12-23 11:36:12"},"1.5":{"tag":"1.5","author":"parorrey","date":"2014-12-28 09:32:16"},"1.5.1":{"tag":"1.5.1","author":"parorrey","date":"2014-12-29 08:50:55"},"1.6":{"tag":"1.6","author":"parorrey","date":"2015-01-22 16:25:48"},"1.7":{"tag":"1.7","author":"parorrey","date":"2015-04-23 15:44:47"},"1.8":{"tag":"1.8","author":"parorrey","date":"2016-01-06 10:53:10"},"1.9":{"tag":"1.9","author":"parorrey","date":"2017-11-26 13:40:13"},"1.9.1":{"tag":"1.9.1","author":"parorrey","date":"2018-10-29 17:11:16"},"1.9.2":{"tag":"1.9.2","author":"parorrey","date":"2018-10-30 08:29:18"},"1.9.3":{"tag":"1.9.3","author":"parorrey","date":"2018-10-30 08:34:53"},"1.9.4":{"tag":"1.9.4","author":"parorrey","date":"2018-10-30 09:38:17"},"2.0.0":{"tag":"2.0.0","author":"parorrey","date":"2018-12-11 13:33:56"},"2.1.0":{"tag":"2.1.0","author":"parorrey","date":"2019-08-13 11:16:01"},"2.2.0":{"tag":"2.2.0","author":"parorrey","date":"2019-08-13 12:42:47"},"2.3.0":{"tag":"2.3.0","author":"parorrey","date":"2019-08-24 15:10:28"},"2.4.0":{"tag":"2.4.0","author":"parorrey","date":"2019-12-18 15:44:03"},"2.5.0":{"tag":"2.5.0","author":"parorrey","date":"2020-11-24 11:43:09"},"2.6.0":{"tag":"2.6.0","author":"parorrey","date":"2021-03-05 17:07:20"},"2.7.0":{"tag":"2.7.0","author":"parorrey","date":"2021-07-27 21:17:23"},"2.7.1":{"tag":"2.7.1","author":"parorrey","date":"2022-02-01 17:42:04"},"2.8.0":{"tag":"2.8.0","author":"parorrey","date":"2022-08-12 19:35:09"},"2.9.0":{"tag":"2.9.0","author":"parorrey","date":"2023-03-13 14:44:35"},"2.9.1":{"tag":"2.9.1","author":"parorrey","date":"2023-11-09 11:46:41"},"3.0.0":{"tag":"3.0.0","author":"parorrey","date":"2025-07-29 11:41:53"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":"1","4":"1","5":"9"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":1965697,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":1965697,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":1965712,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":1965712,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1","1.0","1.1","1.2","1.3","1.4","1.5","1.5.1","1.6","1.7","1.8","1.9","1.9.1","1.9.2","1.9.3","1.9.4","2.0.0","2.1.0","2.2.0","2.3.0","2.4.0","2.5.0","2.6.0","2.7.0","2.7.1","2.8.0","2.9.0","2.9.1","3.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":1965646,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":1965646,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":1965646,"resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"Call to generate_auth_cookie endpoint using Postman","2":"Call to get_currentuserinfo endpoint using Postman","3":"Call to validate_auth_cookie endpoint using Postman"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1556,38652,32184,38653],"plugin_category":[],"plugin_contributors":[80992],"plugin_business_model":[],"class_list":["post-26763","plugin","type-plugin","status-publish","hentry","plugin_tags-api","plugin_tags-authenticate-user","plugin_tags-json-api","plugin_tags-wordpress-user-authentication","plugin_contributors-parorrey","plugin_committers-parorrey"],"banners":{"banner":"https:\/\/ps.w.org\/json-api-auth\/assets\/banner-772x250.png?rev=1965712","banner_2x":"https:\/\/ps.w.org\/json-api-auth\/assets\/banner-1544x500.png?rev=1965712","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/json-api-auth\/assets\/icon-128x128.png?rev=1965697","icon_2x":"https:\/\/ps.w.org\/json-api-auth\/assets\/icon-256x256.png?rev=1965697","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/json-api-auth\/assets\/screenshot-1.png?rev=1965646","caption":"Call to generate_auth_cookie endpoint using Postman"},{"src":"https:\/\/ps.w.org\/json-api-auth\/assets\/screenshot-2.png?rev=1965646","caption":"Call to get_currentuserinfo endpoint using Postman"},{"src":"https:\/\/ps.w.org\/json-api-auth\/assets\/screenshot-3.png?rev=1965646","caption":"Call to validate_auth_cookie endpoint using Postman"}],"raw_content":"<!--section=description-->\n<p>JSON API Auth extends the JSON API Plugin to allow RESTful user authentication.<\/p>\n\n<p>JSON API Plugin, that is required, was closed on August 7, 2019 from WordPress repository. You can download <a href=\"https:\/\/github.com\/PI-Media\/json-api\">JSON API Plugin<\/a> from https:\/\/github.com\/PI-Media\/json-api until it is republished and available on WordPress.<\/p>\n\n<p>Features include:<\/p>\n\n<ul>\n<li><p>Generate Auth Cookie for user authentication<\/p><\/li>\n<li><p>Validate Auth Cookie<\/p><\/li>\n<li><p>Get Current User Info<\/p><\/li>\n<\/ul>\n\n<p>For documentation: See 'Other Notes' tab above for usage examples.<\/p>\n\n<p>Credits: http:\/\/www.parorrey.com\/solutions\/json-api-auth\/<\/p>\n\n<!--section=installation-->\n<p>First you have to install the JSON API for WordPress Plugin (http:\/\/wordpress.org\/extend\/plugins\/json-api\/installation\/). or You can download <a href=\"https:\/\/github.com\/PI-Media\/json-api\">JSON API Plugin<\/a> from https:\/\/github.com\/PI-Media\/json-api<\/p>\n\n<p>To install JSON API Auth just follow these steps:<\/p>\n\n<ul>\n<li><p>upload the folder \"json-api-auth\" to your WordPress plugin folder (\/wp-content\/plugins)<\/p><\/li>\n<li><p>activate the plugin through the 'Plugins' menu in WordPress or by using the link provided by the plugin installer<\/p><\/li>\n<li><p>activate the controller through the JSON API menu found in the WordPress admin center (Settings -&gt; JSON API)<\/p><\/li>\n<\/ul>\n\n<!--section=faq-->\n<p>Thanks to 'mattberg' who wrote the auth controller (https:\/\/github.com\/mattberg\/wp-json-api-auth) initially. I have added few methods and authored it as a WordPress plugin so that it could easily be searched and installed vis WordPress.<\/p>\n\n<ul>\n<li><p>There are following methods available: validate_auth_cookie, generate_auth_cookie, clear_auth_cookie, get_currentuserinfo<\/p><\/li>\n<li><p>nonce can be created by calling http:\/\/localhost\/api\/get_nonce\/?controller=auth&amp;method=generate_auth_cookie<\/p><\/li>\n<li><p>You can then use 'nonce' value to generate cookie. http:\/\/localhost\/api\/auth\/generate_auth_cookie\/?nonce=f4320f4a67&amp;username=Catherine&amp;password=password-here<\/p><\/li>\n<li><p>Use cookie like this with your other controller calls: http:\/\/localhost\/api\/contoller-name\/method-name\/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd<\/p><\/li>\n<\/ul>\n\n<p>For instance, you have a new controller 'events' and want to allow users to post new 'event' using 'add_event' method.\nThis is how you will call the end point with cookie and post the event with user info:<\/p>\n\n<p>http:\/\/localhost\/api\/events\/add_event\/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd<\/p>\n\n<p>If you want sample code how it can be done, check 'JSON API User' plugin https:\/\/wordpress.org\/plugins\/json-api-user\/. This Auth plugin is part of JSON API User plugin.<\/p>\n<dl>\n<dt id='method%3A%20validate_auth_cookie'><h3>Method: validate_auth_cookie<\/h3><\/dt>\n<dd><p>It needs 'cookie' var.<\/p>\n\n<p>http:\/\/localhost\/api\/auth\/validate_auth_cookie\/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd<\/p><\/dd>\n<dt id='method%3A%20generate_auth_cookie'><h3>Method: generate_auth_cookie<\/h3><\/dt>\n<dd><p>It needs <code>username<\/code>, <code>password<\/code> vars. <code>seconds<\/code> is optional.<\/p>\n\n<p>Then generate cookie: http:\/\/localhost\/api\/auth\/generate_auth_cookie\/?username=john&amp;password=PASSWORD-HERE<\/p>\n\n<p>Optional 'seconds' var. It provided, generated cookie will be valid for that many seconds, otherwise default is for 14 days.<\/p>\n\n<p>generate cookie for 1 minute: http:\/\/localhost\/api\/auth\/generate_auth_cookie\/?username=john&amp;password=PASSWORD-HERE&amp;seconds=60<\/p>\n\n<p>60 means 1 minute.<\/p><\/dd>\n<dt id='method%3A%20get_currentuserinfo'><h3>Method: get_currentuserinfo<\/h3><\/dt>\n<dd><p>It needs 'cookie' var.<\/p>\n\n<p>http:\/\/localhost\/api\/auth\/get_currentuserinfo\/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>3.0.0<\/h4>\n\n<ul>\n<li>Updated for WordPress version 6.8<\/li>\n<\/ul>\n\n<h4>2.9.1<\/h4>\n\n<ul>\n<li>Fixed a bug for generate_auth_cookie, get_currentuserinfo endpoints for avatar<\/li>\n<li>Updated for WordPress version 6.4.1<\/li>\n<\/ul>\n\n<h4>2.9.0<\/h4>\n\n<ul>\n<li>Updated for WordPress version 6.1.1<\/li>\n<\/ul>\n\n<h4>2.8.0<\/h4>\n\n<ul>\n<li>Updated for WordPress version 6.0.1<\/li>\n<\/ul>\n\n<h4>2.7.1<\/h4>\n\n<ul>\n<li>Updated for WordPress version 5.9<\/li>\n<\/ul>\n\n<h4>2.7.0<\/h4>\n\n<ul>\n<li>Updated for wordpress version 5.8<\/li>\n<\/ul>\n\n<h4>2.6.0<\/h4>\n\n<ul>\n<li>Updated for wordpress version 5.7<\/li>\n<\/ul>\n\n<h4>2.5.0<\/h4>\n\n<ul>\n<li>Updated for wordpress version 5.5.3<\/li>\n<\/ul>\n\n<h4>2.4.0<\/h4>\n\n<ul>\n<li>Fixed bug in the generate_auth_cookie endpoint.<\/li>\n<\/ul>\n\n<h4>2.3.0<\/h4>\n\n<ul>\n<li>Updated for JSON API Plugin diretory check error and updated action links.<\/li>\n<\/ul>\n\n<h4>2.2.0<\/h4>\n\n<ul>\n<li>Updated for GitHub and settings action links.<\/li>\n<\/ul>\n\n<h4>2.1.0<\/h4>\n\n<ul>\n<li>Updated for WordPress version &amp; added JSON API plugin GitHub link due its closing down on WordPress repository.<\/li>\n<\/ul>\n\n<h4>2.0.0<\/h4>\n\n<ul>\n<li>Updated for wordpress version<\/li>\n<\/ul>","raw_excerpt":"Extends the JSON API Plugin for RESTful user authentication","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/26763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=26763"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/parorrey"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=26763"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=26763"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=26763"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=26763"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=26763"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=26763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}