#13472 closed defect (cantfix)
with LDAP Plugin unable to authenticate using XMLRPC
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Component: | TracLdapAuthPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.2 |
Description
HI,
We are trying to get details of tickets from trac through xmlrpc / json. we are not able to use https://example.com/test/login/rpc or jsonrpc
anonymous user works just fine..
normal ldap auth is working fine.
TRAC 1.2.3 python 2.7.5 CentOS 7.4 TracLdapAuth 1.2.2
Attachments (1)
Change History (16)
comment:2 Changed 6 years ago by
Did you try?: XmlRpcPlugin#ProblemswhenAccountManagerPluginisenabled
comment:3 follow-up: 7 Changed 6 years ago by
Severity: | major → critical |
---|
yes
[account_manager] environ_auth_overwrite = false [components] trac.web.auth.LoginModule = disabled
are already exist in trac.ini.
comment:4 Changed 6 years ago by
Owner: | Nikolaos Papagrigoriou deleted |
---|
comment:5 Changed 6 years ago by
Priority: | high → normal |
---|---|
Severity: | critical → normal |
comment:7 Changed 6 years ago by
Replying to anonymous:
yes
[account_manager] environ_auth_overwrite = false
The section should be [account-manager]
, not [account_manager]
.
However, the environ_auth_overwrite
option just sets the username via form authentication to environ['REMOTE_USER']
. I think the option cannot solve the issue when XMLRPC request without form authentication.
I guess HttpAuthPlugin is needed to solve it.
Anyway, please post entire of [account-manager]
and [components]
sections in trac.ini.
comment:9 follow-up: 10 Changed 6 years ago by
- Try to install HttpAuthPlugin and enable
httpauth.*
in components section.
[components] httpauth.* = enabled
- Confirm that
/login/jsonrpc
responds401 Unauthorized
status line:$ curl -sv -o /dev/null http://your-host/path-to-env/login/jsonrpc > ... > < HTTP/1.1 401 Unauthorized < .... < Date: Wed, 26 Sep 2018 10:02:37 GMT < WWW-Authenticate: Basic realm="auth" < ...
- Try to call
system.getAPIVersion()
via JSON-RPC using curl.$ curl -s -u YOUR-USERNAME \ -H 'Content-Type: application/json' \ --data '{"params":[], "method":"system.getAPIVersion", "id":42}' \ http://your-host/path-to-env/login/jsonrpc Enter host password for user 'YOUR-USERNAME': {"id": 42, "result": [1, 1, 7], "error": null}
comment:11 Changed 6 years ago by
when executed this after setting httpauth.* = enable
and executing
$ curl -s -u YOUR-USERNAME \ -H 'Content-Type: application/json' \ --data '{"params":[], "method":"system.getAPIVersion", "id":42}' \ http://your-host/path-to-env/login/jsonrpc {"id": 42, "result": [1, 1, 8], "error": null}
this is the result
comment:13 Changed 6 years ago by
Okay. It seems that your JSONRPC with authenticated user works fine.
If you want to use https://example.com/test/login/rpc
instead of https://example.com/test/login/jsonrpc
, add /login/rpc
to [httpauth] paths
to require HTTP authentication:
[httpauth] paths = /login/rpc,/xmlrpc,/login/xmlrpc,/jsonrpc,/login/jsonrpc
comment:15 Changed 6 years ago by
Resolution: | → cantfix |
---|---|
Status: | new → closed |
Thanks for the feedback. Closing cantfix since that's a configuration issue.
Error is:
{"error": {"message": "Authentication information not available", "code": -32603, "name": "JSONRPCError"}, "result": null, "id": null}
.