How to change the authentication method for a specific route in PHP with MVC?
by cesarsj from LinuxQuestions.org on (#5CPRJ)
I'm not using Laravel or CakePHP but the structure is similar.
In mydomain/ there is a .htaccess that says that authentication is via LDAP:
Code:RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
SSLRequireSSL
AuthType basic
AuthBasicProvider ldapHowever, I want that specific service to have basic Apache authentication. This service is at mydomain.com/App/Views/services/googlechat.
This service worked with basic authentication before migrating to the MVC structure, only now it says that there is no apache user in the controller route. I think he is using LDAP authentication instead of Basic Apache, and that is why he is not finding, even in the service directory, to have another .htaccess with:
Code:RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ googlechat.php?url=$1 [QSA,L]
AuthType Basic
AuthName "SERVICES"
AuthBasicProvider file
AuthUserFile /etc/httpd/passwd.apache
<RequireAll>
Require valid-user
</RequireAll>How could I solve this?


In mydomain/ there is a .htaccess that says that authentication is via LDAP:
Code:RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
SSLRequireSSL
AuthType basic
AuthBasicProvider ldapHowever, I want that specific service to have basic Apache authentication. This service is at mydomain.com/App/Views/services/googlechat.
This service worked with basic authentication before migrating to the MVC structure, only now it says that there is no apache user in the controller route. I think he is using LDAP authentication instead of Basic Apache, and that is why he is not finding, even in the service directory, to have another .htaccess with:
Code:RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ googlechat.php?url=$1 [QSA,L]
AuthType Basic
AuthName "SERVICES"
AuthBasicProvider file
AuthUserFile /etc/httpd/passwd.apache
<RequireAll>
Require valid-user
</RequireAll>How could I solve this?