简体   繁体   English

如何在wordpress中验证用户[通过android]

[英]How to authenticate a user in wordpress [via android]

I'm trying to figure out how to authenticate a user via android (java). 我试图弄清楚如何通过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. 该应用程序可以成功创建用户,但是我不确定是否找到了WordPress所拥有的XMLRPC API的任何(或至少不错的)文档,我尝试了JSON-API AUTH User插件,但无法弄清楚发布任何内容(可以在这里找到: https : //github.com/mattberg/wp-json-api-auth )我将很高兴获得有关如何使用XMLRPC API或git hub项目的帮助或您使用的任何其他方法发现工作了。

for your question please refer to do for the plugiin JSON-api_auth... http://wordpress.org/support/topic/looking-for-this-in-ages#post- 对于您的问题,请参考doi插件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 . 要对用户进行身份验证,您需要通常在用户将其凭据提供给用户想要登录的相应平台(与在浏览器中相同)后生成的身份验证cookie。 So to do so from android you need wordpress plug in that will help you with this task . 因此,从android这样做,您需要wordpress插件,它将帮助您完成此任务。 example plug in is Json Api User . 示例插件是Json Api User This plugin sits or is installed on top of JSON Api plug in . 该插件位于JSON Api插件上或安装在JSON Api插件上。 so to have JSON Api user installed you need to install first JSON Api plugin , then activate it . 因此,要安装JSON Api用户,您需要先安装JSON Api插件,然后将其激活。 After that install JSON Api User then activate it . 之后,安装JSON Api User,然后将其激活。 From there you can use the following link to generate authentication cookie from your android application . 从那里,您可以使用以下链接从android应用程序生成身份验证cookie。

www.your-domain.com/api/user/generate_auth_cookie/?insecure=cool&username=USER_NAME&password=PASSWORD . 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 . 如果提供的用户凭据有效,则用户将获得状态为“ ok”的结果,然后为cookie:“ SOME CHARACTERS” cookie_name:“ SOME CHARACTER”以及其他一些json键值对。 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 . 否则,如果所提供的凭据不正确,则状态密钥将具有“错误”值,并且您还将具有错误密钥及其相应值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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