id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release
10826,Authorization errors when authenticating via XmlRpc,rjollos,hasienda,I'm seeing the following error when trying to execute commands with !XmlRpc.\r\n\r\n{{{\r\n2013-01-24 15:01:29_529 Trac[web_ui] DEBUG: RPC incoming request of content type 'text/xml' dispatched to <tracrpc.xml_rpc.XmlRpcProtocol object at 0x1f6f7290>\r\n2013-01-24 15:01:29_529 Trac[web_ui] DEBUG: RPC(XML-RPC) call by 'anonymous'\r\n2013-01-24 15:01:29_530 Trac[xml_rpc] DEBUG: RPC(xml) call by 'anonymous'_ method 'ticket.milestone.getAll' with args: ()\r\n2013-01-24 15:01:29_531 Trac[authz_policy] DEBUG: Checking XML_RPC on\r\n2013-01-24 15:01:29_532 Trac[perm] DEBUG: No policy allowed anonymous performing XML_RPC on None\r\n2013-01-24 15:01:29_533 Trac[web_ui] ERROR: RPC(XML-RPC) Error\r\nTraceback (most recent call last):\r\n  File "build/bdist.linux-x86_64/egg/tracrpc/web_ui.py"_ line 149_ in _rpc_process\r\n    req.perm.require('XML_RPC') # Need at least XML_RPC\r\n  File "/usr/local/python26_trac12/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/perm.py"_ line 576_ in require\r\n    raise PermissionError(action_ resource_ self.env)\r\nPermissionError\r\n}}}\r\n\r\nFurther up in the logs I see:\r\n{{{\r\n2013-01-24 15:01:29_472 Trac[web_ui] DEBUG: LoginModule._remote_user: Authentication attempted for 'None'\r\n2013-01-24 15:01:29_473 Trac[web_ui] WARNING: LoginModule.authenticate: 'REMOTE_USER' was set to 'jenkins'\r\n2013-01-24 15:01:29_473 Trac[web_ui] DEBUG: LoginModule.authenticate: Set 'REMOTE_USER' = 'None'\r\n}}}\r\n\r\nThe issue seems to be with this bit of code in `web_ui`'s `LoginModule.authenticate` method:\r\n{{{\r\n#!python\r\nif not 'REMOTE_USER' in req.environ or self.environ_auth_overwrite:\r\n    if 'REMOTE_USER' in req.environ:\r\n        # Complain about another component setting environment\r\n        # variable for authenticated user.\r\n        self.env.log.warn("LoginModule.authenticate: "\r\n                          "'REMOTE_USER' was set to '%s'"\r\n                          % req.environ['REMOTE_USER'])\r\n        self.env.log.debug("LoginModule.authenticate: Set "\r\n                           "'REMOTE_USER' = '%s'" % user)\r\n        req.environ['REMOTE_USER'] = user\r\n}}},defect,new,normal,AccountManagerPlugin,normal,,authentication,osimons,0.12
