.htpasswd under IIS - does it work? - iis

I'm trying to password protect a directory on a server that's running IIS.
I've put the following in the .htaccess file in that directory -
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /path/.htpasswd
AuthGroupFile /dev/null
require valid-user
I've tried a whole bunch of different paths and although it's asking for a username and password it won't take it. I've tried using the path provided by _SERVER["PATH_TRANSLATED"] but that's no help either.
Is this a problem with my path, or does IIS just not support .htpasswd?

Helicon Ape (http://www.helicontech.com/ape naturally supports .htpasswd file with all these authentication options you’ve mentioned. The software also implements a bunch of other Apache-like features. As regarding authentication, you may also be interesting in these articles: http://helicontech.blogspot.com/search/label/mod_auth
Thank you.

IIS does not support .htpasswd or .htaccess.

Natively IIS does not support the htpasswd.
You can get IISPassword for IIS from here if you really want to use
similar files under IIS.

Related

Prompt login/password with .htaccess on Azure Container

I'm looking for implementing an .htaccess on Azure Container, but I don't think this is the proper way to implement a request access on Azure Container, because this is maybe different from Apache?
I want to add this .htaccess for specifics files on container root. Here is my .htaccess file:
<FilesMatch "^(index|standalone|standalone-async|spa).html$">
AuthName "Dialog prompt"
AuthType Basic
AuthUserFile /.htpasswd
Require valid-user
</FilesMatch>
Am I on the good way? And is this the best way to implement a dialog prompt on Azure Container?
Regards.
this is maybe different from Apache?
Yes, it is and if you are using the Windows App Service with the php stack, it uses the IIS not the Apache and the .htaccess is only for Apache. So that's why asked you the web stack.
If you are using a Windows App Service, try to use the web.config from .htaccess by putting all the applicable rules.
If you are using a php on a Linux App Service, make sure to re-check the major version like in the given below reference.
It is important that where we are placing this .htaccess file.
The target file that begins with index or whateverpage & it ends with .html
<FilesMatch "^(index|whateverpage)\.html$">
AuthName "Dialog prompt"
AuthType Basic
AuthUserFile /.htpasswd
Require valid-user
</FilesMatch>
References:
Azure Web App Doesn’t Read HTAccess File,
Use of .htaccess file.

.htaccess directory protection not working in nginx

I try to protect my dev web project a bit and add directory protection. ("Verzeichnisschutz" in german).
This is my .htaccess file (project/.htaccess)
AuthType Basic
AuthName "Please enter the valid auth details"
AuthUserFile .htpasswd
Require valid-user
This is my .htpasswd file (project/.htpasswd)
test:$apr1$3RWv80vU$MJFZn3DHhrB8yPNO6/TDV.
But I can still enter the website without having to enter any credentials.
I tried different browsers and inspector/private mode.
What is wrong?
Now I know why it does not work.
It is because my project runs on a nginx server and .htaccess does only work with apache.

http authentication via htacces does not work on ubuntu

need a help with .htacces file to make http authentication.
I made .htacces and .htpasswd files due to tutorial on some web page, but it doesn't work.
.htacces file is very simple
AuthType Basic
AuthName "xxx"
AuthUserFile my/directory/path/
Require valid-user
Path is right, I checked it. Does anyone know what can be wrong please? Maybe there's something on ubuntu I should change or something.Thanks

HTTP Basic Auth Upon Image View (.htaccess)

I saw this and I'd love to know how to recreate it. Unfortunately, I don't know .htaccess.
Upon viewing an image, there was an HTTP Basic Auth style dialog that asked to enter some sort of authentication (albeit nothing actually submitted anywhere).
I'm sorry for the skid question, but I'd really love some insight as to how this can be done using .htaccess or .htpasswd.
Thanks.
In your apache site conf, add something like:
Alias /image /path/to/img
<Directory "/path/to/img">
AuthType Basic
AuthName "LoginImage"
AuthUserFile /path/to/.htpasswd
Require valid-user
</Directory>
Then, create the .htpasswd file with:
htpasswd -c .htpasswd someusername
and you'll be prompted to create a password.

Works .htaccess with Meteor?

Is it possible to use .htaccess and .htpasswd with a meteor application?
And can I use it, if I deploy my app on xyz.meteor.com?
I've tried it on xyz.meteor.com, but it didn't work:
AuthUserFile /meteor/.htpasswd
AuthGroupFile /dev/null
AuthName "Password"
AuthType Basic
<Limit GET>
require valid-user
</Limit>
.htaccess isn't designed to work with Meteor & it would basically ignore it.
If you want to password protect a directory you might be better of using Apache or using an npm module that would give the HTTP routes with a password for a directory or route:
At the moment such a package doesn't exist on atmosphere but you could build one using an npm module:
A couple of examples of npm modules which should be capable of doing this
https://npmjs.org/package/kerouac-htaccess
https://npmjs.org/package/polpetta
https://npmjs.org/package/http-auth
Another option is using meteor-roles and let only admins see all pages of the system.
Everyone else see only the login screen.

Resources