lundi 16 novembre 2020

Send URL requests between basic authentication and openidc

I want to redirect incoming URL requests between Basic authentication and openidc.

Basically wget requests needs to be pointed to Basic authentication and user request needs to be pointed to openidc.

Both work independently fine, but when used with if statement, apache reload itself is failing. Stuck badly as verified it multiple times.

<VirtualHost *:80>

ServerName www.domain.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/Domain

<if "%{HTTP_USER_AGENT} =~ /wget">

     <Directory /var/www/Domain/wget-curl>
                    AuthType Basic
                    AuthName "Wiki Basic Credentials"
                    AuthBasicProvider file
                    AuthUserFile /etc/apache2/.htpasswd
                    Require valid-user
                </Directory>
</if>

<Else>

            <Directory /var/www/Domain/openidc>
                    Options +FollowSymLinks +Indexes
            IndexOptions FancyIndexing HTMLTable
                    AuthType openid-connect
                    Require valid-user
        AllowOverride all
        </Directory>

</Else>

</VirtualHost>

Aucun commentaire:

Enregistrer un commentaire