I'm using a simple api call that needs Digest Auth:
const { default: AxiosDigestAuth } = require('@mhoc/axios-digest-auth');
exports.handler = async () => {
const digestAuth = new AxiosDigestAuth({
username: user,
password: pass,
});
await digestAuth.request({
headers: {
'Content-Type': 'application/json',
Connection: 'keep-alive',
Accept: 'application/json',
},
method: 'POST',
url: 'https://sms.voxbone.com:4443/sms/v1/',
data,
});
};
I thought the issue is with the digest library I'm using but after running this piece of code locally it worked like a charm, though when I run it in my AWS lambda function I end up getting a 401 Unauthorized
Is there a chance AWS is manipulating my headers? Or maybe an issue with the port used? (4443)?
I can't think of any other reasons to why this would work locally but not on an AWS Lambda