Hi,
to make it clear: This is, as far as i know, not a f3-specific question but maybe you can give me a few hints how to solve this.
I'm creating a Site with f3 and want to protected some routes by Kerberos for Authentication and LDAP(MS AD) for Authorization.
I know that Apache is able to handle both so i thought i can do this Auth*-stuff completly in Apache and keep f3 free from it.
So a User should first be authenticated via Kerberos and then the System should check if the User is in a given group.
My Apache-conf looks like this (simplified):
<VirtualHost *:80>
ServerName server.example.com
DocumentRoot /var/www/html/project/public
<Directory /var/www/html/project/public>
Options -Indexes +FollowSymLinks +Includes
AllowOverride All
require all granted
</Directory>
<Location /index.php>
AuthName "Restricted Access"
AuthType Kerberos
Krb5Keytab /etc/krb5.keytab
KrbAuthRealms EXAMPLE.COM
KrbServiceName HTTP
AuthLDAPURL "ldap://xxx.xxx.xxx.xxx:3268/DC=example,DC=com?userPrincipalName"
AuthLDAPBindDN "user...@example.com"
AuthLDAPBindPassword "password"
AuthLDAPSubGroupClass group
require ldap-group CN=Users,DC=example,DC=com
</Location>
</VirtualHost>The .htaccess is the default one
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L,QSA]
This all works as far as i use it at the moment, but i'm not able to check for any f3-route (for example <Location /secure> does not work).
As far as i understand, mod_rewrite happens before Apache checks for the Location and thats why i can't use it.
So it's a all-or-nothing solution and i can't make parts of f3 public available or the other way, secure only some routes of f3.
The only solution i came up to is to move the Authorization into f3. Or am i missing something here and there is a more elegant solution for this?