Re: Authentication Failed

Solved! Go to solution
APN_Engineering
Regular Visitor

Authentication Failed

Hi

I am trying to invoke Foreign Exchange rate API using privateKey and cert.pem file 

However i get error response 401:Authentication Failed.

My code is in nodejs 10.x.

 

below is  the code snippet

uri: "https://sandbox.api.visa.com/forexrates/v1/foreignexchangerates",
key: fs.readFileSync("./privateKey.pem"),
cert: fs.readFileSync("./cert.pem"),
ca: fs.readFileSync('./DigiCertGlobalRootCA.pem'),
agent: false,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic xyz'
},
body: { "destinationCurrencyCode": currency, "markUpRate": "0", "sourceAmount": "1", "sourceCurrencyCode": baseCurrency },

 

I have followed below link

https://developer.visa.com/pages/working-with-visa-apis/two-way-ssl

 

Please assist

5 REPLIES 5
API_Managers
Visa Developer Support Specialist

Re: Authentication Failed

Hey @APN_Engineering,

I've created case INC9148150 for the engineering team to investigate. We're currently working to resolve your issue and someone will get back to you soon.




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

API_Managers
Visa Developer Support Specialist

Re: Authentication Failed

Hey @APN_Engineering,

 

Can you please try again and let us know if the issue is still happening?

 




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

API_Managers
Visa Developer Support Specialist

Re: Authentication Failed

Hey @APN_Engineering,

 

I reached out to you previously and I haven't heard back. Can you please let us know if you're still experiencing an issue?




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

API_Managers
Visa Developer Support Specialist

Re: Authentication Failed

Hey @APN_Engineering

 

I've reached out to you previously but haven't heard back. Feel free to reach out to us if you're interested in working together in the future. 

 




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Caitlyn98
Regular Visitor

Re: Authentication Failed


@APN_Engineering wrote:

Hi

I am trying to invoke Foreign Exchange rate API using privateKey and cert.pem file 

However i get error response 401:Authentication Failed.

My code is in nodejs 10.x.

 

below is  the code snippet Tellpizzahut

uri: "https://sandbox.api.visa.com/forexrates/v1/foreignexchangerates",
key: fs.readFileSync("./privateKey.pem"),
cert: fs.readFileSync("./cert.pem"),
ca: fs.readFileSync('./DigiCertGlobalRootCA.pem'),
agent: false,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic xyz'
},
body: { "destinationCurrencyCode": currency, "markUpRate": "0", "sourceAmount": "1", "sourceCurrencyCode": baseCurrency },

 

I have followed below link

https://developer.visa.com/pages/working-with-visa-apis/two-way-ssl

 

Please assist


Did you ever find a solution for this? I'm in the same situation. Still getting same error message.