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.
Related
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.
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.
I have a node.js express application and I want to authenticate users using .htaccess (part of the requirement). I have added the initial .htaccess code however, it is not working.
Here is a snapshot of my code directory structure:
Code Directory Structure
Here is the code snippet of my .htaccess file:
AuthType Basic
AuthName "Please Enter Password"
AuthBasicProvider file pam
AuthUserFile ./.htpasswd
AuthGroupFile ./.groups
Require group admins
I have two other files .htpassword and .groups that includes the password and groups.
Any help would be appreciated!
.htaccess is Apache specific.
If you want to use a library to do authentication, check basic-auth.
An example can be found in this article here: https://www.taniarascia.com/basic-authentication-for-an-express-node-app-htpasswd/
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.
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.