Wordpress plugins
JSON API Auth

JSON API Auth

Version : 1.8
Tested up to : 4.4.11
Number of download : 14574
Author : Ali Qureshi

Screenshots

JSON API Auth
JSON API Auth
JSON API Auth
JSON API Auth

JSON API Auth extends the JSON API Plugin to allow RESTful user authentication. Features include: Generate Auth Cookie for user authentication Validate Auth Cookie Get Current User Info For documentation: See ‘Other Notes’ tab above for usage examples. Credits: http://www.parorrey.com/solutions/json-api-auth/ Documentation 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. There are following methods available: validate_auth_cookie, generate_auth_cookie, clear_auth_cookie, get_currentuserinfo nonce can be created by calling http://localhost/api/get_nonce/?controller=auth&method=generate_auth_cookie You can then use ‘nonce’ value to generate cookie. http://localhost/api/auth/generate_auth_cookie/?nonce=f4320f4a67&username=Catherine&password=password-here Use cookie like this with your other controller calls: http://localhost/api/contoller-name/method-name/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd For instance, you have a new controller ‘events’ and want to allow users to post new ‘event’ using ‘add_event’ method. This is how you will call the end point with cookie and post the event with user info: http://localhost/api/events/add_event/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd 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. Method: validate_auth_cookie It needs ‘cookie’ var. http://localhost/api/auth/validate_auth_cookie/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd Method: generate_auth_cookie It needs username, password vars. seconds is optional. Then generate cookie: http://localhost/api/auth/generate_auth_cookie/?username=john&password=PASSWORD-HERE Optional ‘seconds’ var. It provided, generated cookie will be valid for that many seconds, otherwise default is for 14 days. generate cookie for 1 minute: http://localhost/api/auth/generate_auth_cookie/?username=john&password=PASSWORD-HERE&seconds=60 60 means 1 minute. Method: get_currentuserinfo It needs ‘cookie’ var. http://localhost/api/auth/get_currentuserinfo/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd

Download now