Basic Authentication - HTTP(S)

The basic auth HTTP service connector exposes an HTTP proxy which will authenticate requests made to an arbitrary service requiring basic authentication.

Service Parameters

  • type
    Required
    This parameter indicates the authentication strategy used by the connector. For basic auth, the value of type should always be basic_auth.

  • match
    Required
    An array of regex patterns which match a request URI, either partially or fully. Requests which are matched by a regex in this array will be authenticated by this connector.

Credentials

  • username
    Required
    Username to authenticate with

  • password
    Required
    Password to authenticate with

  • forceSSL
    Optional
    Boolean; Forces connection over https if true

Examples

Authenticates all requests proxied through this service connector

 
                            
version: "2"
services:
  http_basic_auth:
    protocol: http
    listenOn: tcp://0.0.0.0:8080
    credentials:
      username: automation
      password:
        from: env
        get: BASIC_AUTH_PASSWORD
    config:
      authenticationStrategy: basic_auth
      authenticateURLsMatching:
        - .*
                        

Authenticate requests to a particular hostname

 
                            
version: "2"
services:
  http_basic_auth:
    protocol: http
    listenOn: tcp://0.0.0.0:8080
    credentials:
      username: automation
      password:
        from: env
        get: BASIC_AUTH_PASSWORD
    config:
      authenticationStrategy: basic_auth
      authenticateURLsMatching:
        - ^https\:\/\/password-protected.myorg.com\/.*
                        
 
9.7