3. Security and Validation

basicAuthentication

Version

Blocks requests which do not have the correct RFC 1945 basic authentication credentials (HTTP header "Authentication: Basic ....").

Example Configuration

api:
port: 2000
flow:
- basicAuthentication:
users:
- username: user
password: user123
- username: admin
password: admin456
target:
url: https://api.predic8.de
api:
   port: 2000
   flow:
     - basicAuthentication:
         users:
           - username: user
             password: user123
           - username: admin
             password: admin456
   target:
     url: https://api.predic8.de

Syntax

basicAuthentication:
'$ref': <string>
cachingUserDataProvider: {}
customStatementJdbcUserDataProvider: {}
htpasswdFileProvider: {}
jdbcUserDataProvider: {}
ldapUserDataProvider: {}
removeAuthorizationHeader: <boolean>
staticUserDataProvider: {}
unifyingUserDataProvider:
- <userDataProviders>
users:
- <staticUserDataProvider-user>
basicAuthentication:
  '$ref': <string>
  cachingUserDataProvider: {}
  customStatementJdbcUserDataProvider: {}
  htpasswdFileProvider: {}
  jdbcUserDataProvider: {}
  ldapUserDataProvider: {}
  removeAuthorizationHeader: <boolean>
  staticUserDataProvider: {}
  unifyingUserDataProvider:
    - <userDataProviders>
  users:
    - <staticUserDataProvider-user>

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
removeAuthorizationHeaderfalsetrueRemoves the Authorization header after successful authentication.

Default is true to prevent credentials from being forwarded to backends. Set to false if both gateway and backend need to validate credentials.

-

Child Structure

ElementCardinalityDescription
cachingUserDataProvider0..1Caching User Data provider caches previous successful logins in order to make authentication faster
customStatementJdbcUserDataProvider0..1
htpasswdFileProvider0..1A user data provider utilizing htpasswd-style files.
jdbcUserDataProvider0..1
ldapUserDataProvider0..1A user data provider querying an LDAP server to authorize users and retrieve attributes.
staticUserDataProvider0..1A user data provider listing all user data in-place in the config file.
userDataProviders0..*
staticUserDataProvider-user0..*A list of username/password combinations to accept.

Can be used in