.htpasswd

javascript authenticate with htpasswd and fetch json

天大地大妈咪最大 提交于 2021-01-27 19:05:11
问题 I have an API that generates json, problem is its password protected url, using Apache htpasswd. how can I authenticate and retrieve the json from javascript, since all methods I have tried give me access deined (I've been using http://username:passwd@urldotcom/path/to/stuff) Thanks 回答1: I figured out how to do it. var something = jQuery.ajax({ type: "GET", url: url, username: "user", password: "password" }); url is a variable I declared earlier of format http:///path/to/json 来源: https:/

How can client side JavaScript send a user id/password to an Apache server so that a folder protected by .htpasswd is unlocked?

◇◆丶佛笑我妖孽 提交于 2021-01-07 02:35:37
问题 I would like to give access to files in a folder to users that login to a web app that I made. The users login by entering an ID and a password that is checked against a database that is accessible using an API. Once they are authenticated they can use the web app but I would also like to give them access to files in a folder on the web server. The web server is running Apache and is separate from the API server. I would rather not build a server side password authentication app but instead

How can client side JavaScript send a user id/password to an Apache server so that a folder protected by .htpasswd is unlocked?

限于喜欢 提交于 2021-01-07 02:35:27
问题 I would like to give access to files in a folder to users that login to a web app that I made. The users login by entering an ID and a password that is checked against a database that is accessible using an API. Once they are authenticated they can use the web app but I would also like to give them access to files in a folder on the web server. The web server is running Apache and is separate from the API server. I would rather not build a server side password authentication app but instead

password protect a single file using .htaccess

感情迁移 提交于 2020-08-18 06:44:29
问题 I have tried to password protect a single file using .htaccess. But when accessing the file the browser just redirects to the home page of the website. I have my .htpasswd on my webroot. My .htaccess file is given below <FilesMatch "result.php"> AuthName "Member Only" AuthType Basic AuthUserFile /home/username/.htpasswd require valid-user </FilesMatch> I want to protect the file result.php. I have replaced username with my exact cpanel username. Someone please help 回答1: <FilesMatch "results

How to use a RELATIVE path with AuthUserFile in htaccess?

故事扮演 提交于 2020-06-09 08:06:11
问题 I have a .htaccess that uses basic authentication. It seems the path to the .htpasswd file isn't relative to the htaccess file, but instead to the server config. So even though I have the .htaccess and .htpasswd files in the same directory, this doesn't work: AuthType Basic AuthName "Private Login" AuthUserFile .htpasswd Require valid-user However, it does work if I change the AuthUserFile to use the absolute path: AuthType Basic AuthName "Private Login" AuthUserFile "/home/user/public_html

403 forbidden - Nginx - using correct credentials

╄→гoц情女王★ 提交于 2020-03-17 10:51:28
问题 I am trying to password protect a directory on my Nginx powered site that contains things like phpMyAdmin, MemcacheMyAdmin, and more admin utilities. This directory is placed in the root of my site at: domain.com/control/ The absolute path on my server is at: /home/deployer/sites/domain.com/control/ I created a .htpasswd file in the directory by using this command: htpasswd -c /home/deployer/sites/domain.com/control/.htpasswd admin The file is present, owned by "root" user and is 0644

Open htaccess password protectected page with no prompts

倖福魔咒の 提交于 2020-02-03 12:18:19
问题 I have a directory on a website that is password protected via htaccess. I want to be able to open this web page through my application without having the user enter the password but rather do it programatically. For instance, is there a way I can embed the login information in the URL? Such as http://www.mypage.com/page.html?htaccesspassword=asdasdas thanks! 回答1: scheme://username:password@host/path 回答2: Although I think that authentication through the URL, as described by Ignacio Vazquez

Redirect all traffic to holding page unless logged in using .htaccess

十年热恋 提交于 2020-01-05 07:43:52
问题 I currently have a landing page setup on my domain.com which already receives traffic. It will shortly be replaced with an online store. I need to upload this store to my live server in order to get it approved by the Merchant Facility Providers (MFP), and they require it to be accessible from it's final live location on domain.com in order to get approvals. I can't have users access this site until it has met approvals. To accomplish this I wish to redirect all domain.com traffic to domain

nginx basic authentication on all pages except a specific URL and it's follow

霸气de小男生 提交于 2020-01-02 07:14:40
问题 Am implementing basic authentication on my Ubuntu server. I want to except url and all it follows. example, the url i want to except is sample.com/sample/ and all of it follows like sample.com/sample/1, sample.com/sample/2, sample.com/sample/samdsFFGRwd12, sample.com/sample/FHFEdsa1g65 How to make this possible? 回答1: To exclude URL from the basic authentication of nginx, need to add in your nginx conf something like: location /sample/ { auth_basic off; } 来源: https://stackoverflow.com

Using apache config and htaccess to dynamically set config vars for dev and production

不打扰是莪最后的温柔 提交于 2020-01-01 03:03:05
问题 Short Summary I need to be able to set an environment variable in the Apache site config that defines if the site is dev, beta or production. The htaccess file in the web root will define config variables for the website (database credentials, domain, etc) based on the entry in the Apache configuration ALSO I need to use one of the variables defined in the web roots htaccess in another htaccess located in another directory. Site Configuration Apache config (dev/beta) I would like to set an