Article 5CPRJ How to change the authentication method for a specific route in PHP with MVC?

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?latest?d=yIl2AUoC8zA latest?i=i4EX08sSSD0:9CSPcnQtIdI:F7zBnMy latest?i=i4EX08sSSD0:9CSPcnQtIdI:V_sGLiP latest?d=qj6IDK7rITs latest?i=i4EX08sSSD0:9CSPcnQtIdI:gIN9vFwi4EX08sSSD0
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments