Part of our website is protected with .htaccess style password protection. When you try to access this area of the website the web browser pops up a dialog asking for your username and password.
I need to access this programatically (eg with an ajax call). How does the server tell me it needs a password and how do I supply it?
You can use your account management control panel to protect Web pages with a password. If you do this, anyone trying to view those pages will be asked to enter a user name and password using HTTP authentication. A password actually protects all the Web pages in a certain directory (folder).
Create a Password Protected Website With a Website BuilderIf you're building your website through a website builder like Wix or Weebly, you can easily password protect your website using the tools available to you.
Since Hugo is a static site generator, you can't do this directly. However, it can easily be done via the web server engine. So you need to choose a service that supports access to the web server configuration and allows - or has already installed - a plugin such as NGINX auth_request.
Basic HTTP authentication:
http://coderseye.com/2007/how-to-do-http-basic-auth-in-ajax.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With