gpt4 book ai didi

java - SugarCRM over REST 登录无效

转载 作者:行者123 更新时间:2023-11-30 09:17:36 26 4
gpt4 key购买 nike

我的 java 应用程序生成:

{"application":"lukasync","user_auth":{"user_name":"admin","password":"03535a5ae1b5bff4401a7283c4570d8c"}}

发送:

http://<My_Site>/service/v4_1/rest.php?method=login&input_type=json&response_type=json&rest_data={"application":"lukasync","user_auth":{"user_name":"admin","password":"03535a5ae1b5bff4401a7283c4570d8c"}}

但是它得到的答案是:

{"name":"Invalid Login","number":10,"description":"Login attempt failed please check the username and password"}

预期的答案是包含 session ID 的 JSON 字符串。

我已经检查过用户名和哈希值是否与数据库中的匹配。我还尝试对 JSON 进行 URL 编码,但结果相同。

这是 SugarCRM 版本 6.5.15(内部版本 1083)

我是否犯了一些基本的实现错误?

更新:显然,SugarCRM 需要根据 sugarcrm.com/support/bugs.html?caseID=34925#issue_34925 对 JSON 进行排序,他们似乎认为这也是正确的方法。所以 user_auth 需要是 JSON 字符串中的第一个对象。

我听说他们已经为 SugarCRM 7 修复了它,但要到明年(2014 年)年中左右才会发布。

最佳答案

尝试使用这个 JSON 结构。它应该有效。

{
"user_auth": {
"user_name": "admin",
"password": "03535a5ae1b5bff4401a7283c4570d8c",
"version": "1"
},
"application_name": "RestCall",
"name_value_list": []
}

新的 URL 将是:http://crm-shiruslabs.dontesta.it:8888/sugarcrm_dev_WebServices/service/v4_1/rest.php?method=login&input_type=JSON&response_type=JSON&rest_data={"user_auth": {"user_name":"admin","password":"03535a5ae1b5bff4401a7283c4570d8c","version":"1"},"application_name":"RestCall","name_value_list":[]}

enter image description here

关于java - SugarCRM over REST 登录无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18863849/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com