Basic auth

.htaccess, or hypertext access, is a default directory level configuration file that allows you to create some basic security for directories in a web server.

Enable basic auth via htaccess

To enable htaccess:

  1. Use your local shell to create the auth file that holds the username and password.

    htpasswd -c auth <username>
  2. Create a secret out of the auth file. For example, below, the secret basic-auth is created.

    kubectl -n <namespace> create secret generic basic-auth --from-file=auth --dry-run=client -o yaml | kubectl apply -f -
  3. Set the following ingress annotations in your Magnolia PaaS values.yml file.

      enabled: true
      annotations: "nginx" 512m "letsencrypt-prod" basic (1) basic-auth (2) "Please login" (3) |
          more_set_headers "X-Robots-Tag: noindex, nofollow"; {{ .Env.DEPLOYMENT }}-magnolia-error-page-svc "503"
        - host: {{ .Env.DEPLOYMENT }}
              - path: /
                instance: public
              - path: /author
                instance: author
    1 This sets the basic auth-type. Nothing to do here. Leave it as is.
    2 This is the name of the secret that you created Step 2 above.
    3 This is the message that will be displayed to those users authenticating in the auth dialog.