PluginProbe
JSON API Auth / 2.2.0
JSON API Auth v2.2.0
3.1.2 3.1.1 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 3.1.0 trunk 0.1 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 All 33 releases
json-api-auth / readme.txt

readme.txt in JSON API Auth 2.2.0, at readme.txt

196 lines 5.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1
2 === JSON API Auth ===
3
4 Donate link: http://www.parorrey.com
5 Tags: json api, api, authenticate user, WordPress user authentication
6 Contributors: parorrey
7 Stable tag: 2.2.0
8 Requires at least: 3.0.1
9 Tested up to: 5.2.2
10 Requires PHP: 5.3
11 License: GPLv2 or later
12
13 License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
15 Extends the JSON API Plugin for RESTful user authentication
16
17 == Description ==
18
19 JSON API Auth extends the JSON API Plugin to allow RESTful user authentication.
20
21 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.
22
23 Features include:
24
25 * Generate Auth Cookie for user authentication
26
27 * Validate Auth Cookie
28
29 * Get Current User Info
30
31 For documentation: See 'Other Notes' tab above for usage examples.
32
33 Credits: http://www.parorrey.com/solutions/json-api-auth/
34
35 == Installation ==
36
37 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
38
39 To install JSON API Auth just follow these steps:
40
41 * upload the folder "json-api-auth" to your WordPress plugin folder (/wp-content/plugins)
42
43 * activate the plugin through the 'Plugins' menu in WordPress or by using the link provided by the plugin installer
44
45 * activate the controller through the JSON API menu found in the WordPress admin center (Settings -> JSON API)
46
47 == Screenshots ==
48
49 1. Call to generate_auth_cookie endpoint using Postman
50 2. Call to get_currentuserinfo endpoint using Postman
51 3. Call to validate_auth_cookie endpoint using Postman
52
53 == Changelog ==
54
55 = 2.2.0 =
56
57 * Updated for GitHub and settings action links.
58
59 = 2.1.0 =
60
61 * Updated for WordPress version & added JSON API plugin GitHub link due its closing down on WordPress repository.
62
63 = 2.0.0 =
64
65 * Updated for wordpress version
66
67 = 1.9.4 =
68
69 * Updated logo and header.
70
71 = 1.9.3 =
72
73 * Added minimum php version requirement.
74
75 = 1.9.2 =
76
77 * Added icons, screenshots, & fixed plugin header.
78
79 = 1.9.1 =
80
81 * Updated for WordPress 4.9.8 version.
82
83 = 1.9 =
84
85 * Updated for WordPress 4.9 version.
86
87
88 = 1.8 =
89
90 * Updated for WordPress 4.4 version. Made it secure by adding SSL check and adding POST method support, thanks to 'xiffy' for sharing code.
91
92 = 1.7 =
93
94 * updated for wordpress 4.1.2 version
95
96 = 1.6 =
97
98 * generate_auth_cookie does not require nonce any more to generate cookie.
99 * generate_auth_cookie now also returns 'cookie_name'.
100
101 = 1.5.1 =
102
103 * Fixed the JSON API Plugin link with protocol
104 * Updated notes for documentation.
105
106
107 = 1.5 =
108
109 * Added the function to authenticate, allow the user (with edit rights) to use JSON API core controllers as well. Thanks `necro_txilok` for the suggestion.
110 * Removed `clear_auth_cookie` for not doing what it intends to do, instead `generate_auth_cookie` has been modified to allow setting up auth cookie for any required duration. Just provide the `seconds` var with `nonce`, `username` and `password` to get required cookie. Default time is 14 days.
111 * Fixed typos in documentation.
112
113 = 1.4 =
114
115 * update for WordPress 4.1
116
117 = 1.3 =
118
119 * Removed bug for generating cookie
120
121
122 = 1.2 =
123
124 * Updated plugin description, documentation and few urls
125
126 = 1.1 =
127
128 * Added clear_auth_cookie() for removing auth cookie.
129
130 * Added documentation for the available end points
131
132
133 = 1.0 =
134
135 * Added the user avatar info for generate_auth_cookie() and get_currentuserinfo()
136
137
138 * Updated the FAQs
139
140 = 0.1 =
141
142 * Initial release.
143
144
145
146 == Upgrade Notice ==
147
148 = 0.1 =
149
150 * Initial release.
151
152
153 == Frequently Asked Questions ==
154
155 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.
156
157 * There are following methods available: validate_auth_cookie, generate_auth_cookie, clear_auth_cookie, get_currentuserinfo
158
159 * nonce can be created by calling http://localhost/api/get_nonce/?controller=auth&method=generate_auth_cookie
160
161 * You can then use 'nonce' value to generate cookie. http://localhost/api/auth/generate_auth_cookie/?nonce=f4320f4a67&username=Catherine&password=password-here
162
163 * Use cookie like this with your other controller calls: http://localhost/api/contoller-name/method-name/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd
164
165 For instance, you have a new controller 'events' and want to allow users to post new 'event' using 'add_event' method.
166 This is how you will call the end point with cookie and post the event with user info:
167
168 http://localhost/api/events/add_event/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd
169
170 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.
171
172 = Method: validate_auth_cookie =
173
174 It needs 'cookie' var.
175
176 http://localhost/api/auth/validate_auth_cookie/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd
177
178
179 = Method: generate_auth_cookie =
180
181 It needs `username`, `password` vars. `seconds` is optional.
182
183 Then generate cookie: http://localhost/api/auth/generate_auth_cookie/?username=john&password=PASSWORD-HERE
184
185 Optional 'seconds' var. It provided, generated cookie will be valid for that many seconds, otherwise default is for 14 days.
186
187 generate cookie for 1 minute: http://localhost/api/auth/generate_auth_cookie/?username=john&password=PASSWORD-HERE&seconds=60
188
189 60 means 1 minute.
190
191
192 = Method: get_currentuserinfo =
193
194 It needs 'cookie' var.
195
196 http://localhost/api/auth/get_currentuserinfo/?cookie=Catherine|1392018917|3ad7b9f1c5c2cccb569c8a82119ca4fd