Is there a way to handle basic http authentication for a 3rd party feed?

Comments

Sorin Sarca’s picture

Hi,

in Edit source tab, take a look at the "Stream context options" field. Field content should be

{
  "http": {
    "header": "Authorization: Basic {replace-me}"
  }
}

and you'll have to replace the {replace-me} with username:password as base64 encoded string. You can create a simple php script to get the encoded string

  $user = "myuser";
  $pass = "mypass";
  $encoded = base64_encode($user . ":" . $pass);
  echo $encoded;

or you can simply use an online service such as https://www.base64encode.org.

Example: for user = "myuser" and password = "mypass" the encoded string will be bXl1c2VyOm15cGFzcw==, resulting

{
  "http": {
    "header": "Authorization: Basic bXl1c2VyOm15cGFzcw=="
  }
}

Hope it helps!

Sorin Sarca’s picture

Status: Active » Closed (fixed)

Please re-open if you need more info.