On Monday, August 26, 2013 6:16:45 PM UTC+2, olemis wrote:
>
> What other plugins have you deployed ? There are a number of 
> interactions that can make this fails , especially if you are using 
> AccountManagerPlugin together with server (e.g. apache2) digest auth 
> handlers then check this out 
>
>
> http://trac-hacks.org/wiki/XmlRpcPlugin#ProblemswhenAccountManagerPluginisenabled
>  
>

I have the AccountManagerPlugin installed, sorry that I didn't mention it. 
I did follow the advice and added environ_auth_overwrite = false 
under [account-manager]. I had the following additional plugins installed 
but I now removed them all. The response is still the same.

AdvancedTicketWorkflowPlugin-0.11dev-py2.6.egg
Bitten-0.6-py2.6.egg
FootNoteMacro-1.03-py2.6.egg
keywordreplace-0.0.1-py2.6.egg
PDFRedirector-0.3-py2.6.egg
trac_MultiRepoSearchPlugin-0.6-py2.6.egg
TracDragDrop-0.12.0.10-py2.6.egg
TracSQLHelper-0.2.2-py2.6.egg
TracTags-0.7dev-py2.6.egg

> $ curl --data '<?xml 
> > 
> version="1.0"?><methodCall><methodName>wiki.getPage</methodName><params><param><value><string>SandBox</string></value></param></params></methodCall>'
>  
>
> > 
> > --header 'Content-Type: text/xml' --digest --user "$user:$password" 
> > --dump-header - 'http://localhost:8080/login/xmlrpc' 
> [...] 
> > 
> > It seems that the XmlRpcPlugin will return a 200 OK status code even if 
> > authentication is required. 
>
> Actually what (I think that) is happening there is that user 
> authentication succeeded but Trac did not not detect the REMOTE_USER , 
> thus falling back to anonymous login . 
>

I changed the request to use a user "admin", to which I gave TRAC_ADMIN and 
on top of that XML_RPC permissions. Looking at the output on the console, 
it really looks like the authentication is not picked up by Trac:

11:59:33 Trac[main] DEBUG: Dispatching <RequestWithSession "POST '/xmlrpc'">
11:59:33 Trac[web_ui] DEBUG: RPC incoming request of content type 
'text/xml' dispatched to <tracrpc.xml_rpc.XmlRpcProtocol object at 
0x1075dc790>
11:59:33 Trac[web_ui] DEBUG: RPC(XML-RPC) call by 'anonymous'
11:59:33 Trac[xml_rpc] DEBUG: RPC(xml) parse error: no element found: line 
1, column 0
11:59:33 Trac[main] DEBUG: Negotiated locale: None -> en_US
11:59:33 Trac[web_ui] ERROR: RPC(XML-RPC) Error
Traceback (most recent call last):
  File "build/bdist.macosx-10.8-intel/egg/tracrpc/web_ui.py", line 143, in 
_rpc_process
    rpcreq = req.rpc = protocol.parse_rpc_request(req, content_type)
  File "build/bdist.macosx-10.8-intel/egg/tracrpc/xml_rpc.py", line 97, in 
parse_rpc_request
    raise ProtocolException(xmlrpclib.Fault(-32700, to_unicode(e)))
ProtocolException: <Fault -32700: u'no element found: line 1, column 0'>
11:59:33 Trac[main] DEBUG: Dispatching <RequestWithSession "POST '/xmlrpc'">
11:59:33 Trac[web_ui] DEBUG: RPC incoming request of content type 
'text/xml' dispatched to <tracrpc.xml_rpc.XmlRpcProtocol object at 
0x1075dc790>
11:59:33 Trac[web_ui] DEBUG: RPC(XML-RPC) call by 'anonymous'
11:59:33 Trac[xml_rpc] DEBUG: RPC(xml) call by 'anonymous', method 
'wiki.getPage' with args: ('SandBox',)
11:59:33 Trac[perm] DEBUG: No policy allowed anonymous performing XML_RPC 
on None
11:59:33 Trac[web_ui] ERROR: RPC(XML-RPC) Error
Traceback (most recent call last):
  File "build/bdist.macosx-10.8-intel/egg/tracrpc/web_ui.py", line 149, in 
_rpc_process
    req.perm.require('XML_RPC') # Need at least XML_RPC
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/perm.py",
 
line 579, in require
    raise PermissionError(action, resource, self.env)
PermissionError
11:59:33 Trac[main] DEBUG: Negotiated locale: None -> en_US
 

> > Shouldn't it send a different status code so 
> > curl known that it should send the authentication data to the server? 
>
> It should ... 
>
>   - What's the HTTP server ? 
>

Before your reply, I was using "tracd -s -p 8080 $env" locally. I now use 
lighttpd/1.4.32 with mod_fastcgi for the tests, which is what we also use 
on our server. The console output above is what I see when running lighttpd 
using "lighttpd -D -f lighttpd.conf". lighttpd is not configured to handle 
any of the authentication.
 

>   - Digest auth is enabled , what about anonymous access ? 
>

anonymous has all the *_VIEW permissions it has by default after trac-admin 
initenv, if you mean that.
 

>     * If there's anonymous access to /login/... is forbidden then you'll 
>       get expeted HTTP error status . 
>

When I access http://localhost:8080/login/xmlrpc in by browser after loggin 
out, I get an an error message telling me that I need XML_RCP permissions 
to access the page. The page is delivered using a status code of 403. But 
when I access the same URI using curl, curl sends a POST request and 
receives a response with a status code of 200.
 

>   - Have you tried using an invalid password or non-existent user ? 


I did, I get exactly the same response in both cases. But looking at the 
response headers of the first response, without a WWW-Authenticate header I 
don't think curl is able to send the authentication data to the server in 
the seconds request.

Thanks!
Michael

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to