Error when calling bitmovinApi.encoding.encodings.muxings.fmp4.drm.speke.create

I encountered an error when trying to call bitmovinApi.encoding.encodings.muxings.fmp4.drm.speke.create(encoding.id!, muxing.id!, drm) using the Bitmovin API SDK.

Here is the relevant code:
function createFmp4SpekeDrm(
encoding: Encoding,
muxing: Muxing,
output: Output,
outputPath: string,
systemIds: string
): Promise {
const provider = new SpekeDrmProvider({
url: configProvider.getSpekeUrl(),
});

// if (configProvider.hasParameterByKey(‘SPEKE_ARN’)) {
// provider.roleArn = configProvider.getSpekeArn();
// provider.gatewayRegion = configProvider.getSpekeGatewayRegion();
// } else {
// provider.username = configProvider.getSpekeUsername();
// provider.password = configProvider.getSpekePassword();
// }

const drm = new SpekeDrm({
provider: provider,
outputs: [buildEncodingOutput(output, outputPath)],
systemIds: systemIds,
});

if (configProvider.hasParameterByKey(‘DRM_CONTENT_ID’)) {
drm.contentId = configProvider.getDrmContentId();
}

if (configProvider.hasParameterByKey(‘DRM_KEY_ID’)) {
drm.kid = configProvider.getDrmKeyId();
}

if (systemIds.includes(FAIRPLAY_SYSTEM_ID)) {
drm.iv = configProvider.getDrmFairplayIv();
}

return bitmovinApi.encoding.encodings.muxings.fmp4.drm.speke.create(encoding.id!, muxing.id!, drm);
}

I followed the Bitmovin example for SPEKE DRM integration and the Doverunner documentation, which states that since the KMS token is used for authentication, I don’t need to set additional authentication parameters such as setUsername, setPassword, or setRoleArn.
However, the SDK returned the following:

Additional Notes:

  • I am using the Bitmovin API SDK with the official SPEKE DRM example.

  • The KMS provider is Doverunner.

  • According to Doverunner’s documentation, authentication is handled via the enc-token query parameter in the URL.

    FYI: encodingId: 9869196f-a2ef-4b7f-9471-5a244971d5fd, muxingId: eebf960b-0a14-4d36-87e8-86a6f7e216be

Please help check why the API returns a 500 error with code 1004 for this call.

I also tried running the same flow (with basic authen) using the Axinom SPEKE provider instead of Doverunner, but I still get the same error.