Skip to content

Htpasswd authorization

Authorizes a user request via credentials stored in htpasswd format.

Properties

type

Authorization Type = "htpasswd"

Has to be set to htpasswd to enable the htpasswd authorization.

file

File Path = "<os specific>"

A file where each line contains an entry in htpasswd format.

The default value varies depending on the platform Bifröst runs on:

  • Linux: /etc/engity/bifroest/htpasswd
  • Window: C:\ProgramData\Engity\Bifroest\htpasswd

Examples

/etc/engity/bifroest/htpasswd
1
2
foo:$apr1$zapgfl56$eXIHR/wBYFypkUEXWdCZN/
bar:$apr1$wqkvo7c2$dqi5g.hK67jLMY4SJzrjq.

entries

string

This is similar to file, but does contain the htpasswd entries directly inside the configuration.

Examples

1
2
3
4
5
authorization:
  type: htpasswd
  entries: |
    foo:$apr1$zapgfl56$eXIHR/wBYFypkUEXWdCZN/
    bar:$apr1$wqkvo7c2$dqi5g.hK67jLMY4SJzrjq.

Format

htpasswd is a format created for Apache HTTP Server to enable an easy way to configure Basic Authentication for web servers. Nowadays, it is used in more web server projects than just the Apache HTTP Server and also in other project types like Bifröst. The reason: There is a huge toolset available to create those files.

Tools

  1. Apache HTTP Server command line tool which can be easily installed on many systems such as:
    • Ubuntu:
      1
      sudo apt-get install apache2-utils -y
      
    • Fedora/RedHat:
      1
      sudo apt install apache2-utils -y
      
  2. Helm for Kubernetes function
  3. Ansible module
  4. Terraform/OpenTofu plugin
  5. ...

Context

This authorization will produce a context of type Authorization Htpasswd.

Examples

  1. Using dedicated file from default location:
    1
    type: htpasswd
    
  2. Using dedicated file from custom location:
    1
    2
    type: htpasswd
    file: /etc/foo/bar
    
  3. Using embedded entries:
    1
    2
    3
    4
    type: htpasswd
    entries: |
      foo:$apr1$zapgfl56$eXIHR/wBYFypkUEXWdCZN/
      bar:$apr1$wqkvo7c2$dqi5g.hK67jLMY4SJzrjq.
    

Compatibility

linux windows
/ /