You can add authentication for a stream as shown:

{
  "id": 723456,
  "name": "DemostreamEdit",
  "format": "HLS",
  "cpcode": 123456,
  "ingestAccelerated": false,
  "dvrWindow": 10,
  "encoderZone": "US_EAST",
  "allowedIps": [
    "1.2.3.4",
    "2.5.6.7"
  ],
  "additionalEmailIds": [
    "xyz@akamai1.com",
    "efg@akamai.com"
  ],
  "origin": {
    "hostName": "demoHost.akamaiorigin.net"
  },
  "streamAuth": {
    "username": "ajones",
    "password": "123abc!",
    "algorithm": "MD5"
  }
}

If you want to rotate the authentication settings for a given stream, choose one of these options. You’re limited to two authentication keys for a stream, only one of which will be active.

🚧

Update your encoder

Make sure to update your encoder with the new authentication information within the auto-expiry time period. You’ll receive an Ingest Auth failure alert email if this expires.

Rotate the stream authentication settings and specify an expiration date in the payload:

{
  "id": 723456,
  "name": "DemostreamEdit",
  "format": "HLS",
  "cpcode": 123456,
  "ingestAccelerated": false,
  "dvrWindow": 10,
  "encoderZone": "US_EAST",
  "allowedIps": [
    "1.2.3.4",
    "2.5.6.7"
  ],
  "additionalEmailIds": [
    "xyz@akamai1.com",
    "efg@akamai.com"
  ],
  "origin": {
    "hostName": "demoHost.akamaiorigin.net"
  },
  "streamAuth": {
    "username": "newAuthSettings",
    "password": "123abc!",
    "algorithm": "MD5"
  },
  "streamAuthPrevious": {
    "expiryDate": "2020-10-02T23:59:59.999Z"
  }
}

Rotate the stream authentication settings without specifying an expiration date in the payload. By default, expiration is two days from the current time in UTC.

{
  "id": 723456,
  "name": "DemostreamEdit",
  "format": "HLS",
  "cpcode": 123456,
  "ingestAccelerated": false,
  "dvrWindow": 10,
  "encoderZone": "US_EAST",
  "allowedIps": [
    "1.2.3.4",
    "2.5.6.7"
  ],
  "additionalEmailIds": [
    "xyz@akamai1.com",
    "efg@akamai.com"
  ],
  "origin": {
    "hostName": "demoHost.akamaiorigin.net"
  },
  "streamAuth": {
    "username": "newAuthSettings",
    "password": "123abc!",
    "algorithm": "MD5"
  }
}

Once you’ve successfully rotated the initial authentication settings, you can subsequently edit them in one of these ways. Issue separate PUT requests for each operation.

Edit the current stream authentication settings by retaining the previous authentication settings:

{
  "id": 723456,
  "name": "DemostreamEdit",
  "format": "HLS",
  "cpcode": 123456,
  "ingestAccelerated": false,
  "dvrWindow": 10,
  "encoderZone": "US_EAST",
  "allowedIps": [
    "1.2.3.4",
    "2.5.6.7"
  ],
  "additionalEmailIds": [
    "xyz@akamai1.com",
    "efg@akamai.com"
  ],
  "origin": {
    "hostName": "demoHost.akamaiorigin.net"
  },
  "streamAuth": {
    "username": "newAuthSettingsEdited",
    "password": "123abc!",
    "algorithm": "SHA256"
  },
  "streamAuthPrevious": {
    "retain": true
  }
}

Edit the previous stream authentication setting’s expiration date, but retain the current authentication settings:

{
  "id": 723456,
  "name": "DemostreamEdit",
  "format": "HLS",
  "cpcode": 123456,
  "ingestAccelerated": false,
  "dvrWindow": 10,
  "encoderZone": "US_EAST",
  "allowedIps": [
    "1.2.3.4",
    "2.5.6.7"
  ],
  "additionalEmailIds": [
    "xyz@akamai1.com",
    "efg@akamai.com"
  ],
  "origin": {
    "hostName": "demoHost.akamaiorigin.net"
  },
  "streamAuth": {
    "username": "newAuthSettingsEdited",
    "algorithm": "SHA256"
  },
  "streamAuthPrevious": {
    "expiryDate": "2020-10-06T23:59:59.999Z"
  }
}

Delete the previous stream authentication settings. Will only take effect, if multiple keys are active:

{
  "id": 723456,
  "name": "DemostreamEdit",
  "format": "HLS",
  "cpcode": 123456,
  "ingestAccelerated": false,
  "dvrWindow": 10,
  "encoderZone": "US_EAST",
  "allowedIps": [
    "1.2.3.4",
    "2.5.6.7"
  ],
  "additionalEmailIds": [
    "xyz@akamai1.com",
    "efg@akamai.com"
  ],
  "origin": {
    "hostName": "demoHost.akamaiorigin.net"
  },
  "streamAuth": {
    "delete": true
  }
}

Delete and disable all stream authentication settings, including active as well as prior settings:

📘

During a password rotation period, two sets of authentication keys may be active at the same time. The server validates all incoming authorization headers against both sets, and issues a successful authorization response if validation of any incoming authorization header succeeds against any one of the active credentials.