简体   繁体   中英

How to authenticate a user in wordpress [via android]

I'm trying to figure out how to authenticate a user via android (java). The app can successfully create a user but I'm not sure I've found any (or at least decent) documentation for the XMLRPC API WordPress has, and I tried the JSON-API AUTH User plugin but I can't figure out how to post anything (can be found here: https://github.com/mattberg/wp-json-api-auth ) I'd appreciate either help on how to use the XMLRPC API or the git hub project or any other method you've found to work.

for your question please refer to do for the plugiin JSON-api_auth... http://wordpress.org/support/topic/looking-for-this-in-ages#post-

I hope this help..

To authenticate user , you need authentication cookie that is usually generated once the user has given his/ her credentials to the respective platform the user wants to login same as in the browser . So to do so from android you need wordpress plug in that will help you with this task . example plug in is Json Api User . This plugin sits or is installed on top of JSON Api plug in . so to have JSON Api user installed you need to install first JSON Api plugin , then activate it . After that install JSON Api User then activate it . From there you can use the following link to generate authentication cookie from your android application .

www.your-domain.com/api/user/generate_auth_cookie/?insecure=cool&username=USER_NAME&password=PASSWORD .

If the user credentials provided are valid , the user will have the the result with status : "ok" then cookie : "SOME CHARACTERS" cookie_name : "SOME CHARACTER" and some other json key-value pair . Else if the credentials provided is not true the status key will have a value of "error" and also you will have an error key with its respective value .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM