Sunday, July 20, 2014

owncloud: Authentication error

This issue has been bothering me from version 5. After some investigation, it turned out the owncloud's authentication was "compromised" by other services running on the same web server (nginx) using the same fastcgi processor.

After a deeper look on this issue, I've found the main cause. In my case it has been caused by transmission's authentication setting two environment variables in PHP after login:
  • PHP_AUTH_USER (containing user name)
  • PHP_AUTH_PW (containing user password for transmission)
These variables are clearly used also for owncloud's user authentication, so when they were set with different credentials, Authentication error was inevitable. I had to disable transmission's authentication method "rpc-authentication-required": false,
and enable alternative authentication via ngx_http_auth_basic_module.


Following code prints all web servers' environment variables:
<?php
    print '<pre>' . htmlspecialchars(print_r(get_defined_vars(), true)) . '</pre>';
    print '<pre>' . htmlspecialchars(print_r($_SERVER, true)) . '</pre>';
?>

No comments:

Post a Comment