itemir / apache_2fa

Apache two-factor (2FA) authentication with Google Authenticator based on Time-based One-Time Password (TOTP) or HMAC-based one-time password (HOTP) Algorithms.
BSD 2-Clause "Simplified" License
73 stars 31 forks source link

Unable to Complete #14

Open soubhikbasu opened 4 years ago

soubhikbasu commented 4 years ago

I have completed 1st step of authentication, but after successful authenticate google authenticate page will not come, straight redirect to protected directory. Not sure why?

Can you please help me out?

My Virtual Host file look like below

i am working in xampp on localhost in ubuntu

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/auth/
#RewriteCond %{HTTP_COOKIE} !^.*2FA_Auth=([a-zA-Z0-9]+)
RewriteRule ^(.*)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

RewriteCond %{REQUEST_URI} !^/auth/
#RewriteCond %{HTTP_COOKIE} ^.*2FA_Auth=([a-zA-Z0-9]+)
RewriteCond /opt/lampp/htdocs/2factor/apache_2fa/state/%1 !-f
RewriteRule ^(.*)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

ScriptAlias /auth/ /opt/lampp/htdocs/2factor/apache_2fa/

<Directory /opt/lampp/htdocs/2factor/apache_2fa> AuthType Digest AuthName "dev.apache2fa.com" AuthDigestDomain / AuthDigestProvider file AuthUserFile /opt/lampp/htdocs/2factor/apache_2fa/apache_credentials Require valid-user

    <Directory /opt/lampp/htdocs/Temp>
        AuthType Digest
        AuthName "dev.apache2fa.com"
        AuthDigestDomain /
        AuthDigestProvider file
        AuthUserFile /opt/lampp/htdocs/2factor/apache_2fa/apache_credentials
        Require valid-user
    </Directory>
itemir commented 4 years ago

That means your Apache configuration is not triggered. Make sure mod rewrite is enabled, Apache sees the configuration (reload the config if you didn’t) and the directories in the configuration cover the correct path/directories.

soubhikbasu commented 4 years ago
  1. mod rewrite is enabled already 2.after each of changes in vhost reload the apache
  2. the directory names are already mentioned in my last comment