Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't sign in #65

Closed
miradozk opened this issue Apr 26, 2018 · 10 comments
Closed

Can't sign in #65

miradozk opened this issue Apr 26, 2018 · 10 comments

Comments

@miradozk
Copy link

Hello,
I can't connect to my app on remote server. It works on local but not on remote server :

$application->add(new HttpBasicAuthentication([
    'realm' => 'Piso',
    'secure' => true,
    'relaxed' => ['localhost'],
    'users' => [
        'root' => '$2y$10$TJor1LmWl5Vi9Ljrqp5Fr.S5TdIUbleIei9.Ndo0gT1IO0/ELwKyK',
        'test' => 'azerty'
    ]
]));

I use "tuupola/slim-basic-auth": "^3.0" .

Thank you

@tuupola
Copy link
Owner

tuupola commented Apr 26, 2018

What does "not working on remote server" mean? Password does not work? Do you get an error, if yes what is the error message?

@miradozk
Copy link
Author

Password doesn't work. No message error but the browser always asks username and password.

@tuupola
Copy link
Owner

tuupola commented Apr 27, 2018

Are you are testing with user test using password azerty or with user root and some other password?

@miradozk
Copy link
Author

test and azerty as clear password and root with htpasswd -nbBC 10 root [my secret password] . It works perfectly on my localhost with apache but not on my remote server (ovh hosting)

@tuupola
Copy link
Owner

tuupola commented Apr 27, 2018

Look at possible error logs. Look at the differences between your dev and live environment. Remove the middleware totally and see if live environment still asks for password. My bet is that there is something else such as an .htaccess file asking for the password.

@miradozk
Copy link
Author

I remove the middleware and it works (not protected) .

My .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

@tuupola
Copy link
Owner

tuupola commented Apr 27, 2018

Look at logs, look for differences such as PHP version or Apache vs Nging between live and dev. Ie the usual debugging stuff. Something is apparently different in your live environment.

@tuupola
Copy link
Owner

tuupola commented Apr 27, 2018

If you are using FastCGI this might help:

https://github.com/tuupola/slim-basic-auth#usage-with-fastcgi

@miradozk
Copy link
Author

@tuupola
Copy link
Owner

tuupola commented Apr 27, 2018

Great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants