My problem
I'm protecting my API's with oAuth JWT tokens. This is set when the user is logged in and stored in a localStorage afterwards. This token is then parsed as an Authentication header in the request.
This works fine on desktops browsers like Chrome and FireFox. However, this does not work from ISO Safari applicaiton.
Research
Based on my own investigation (Https requests with Authorization not working via Safari) the error could be with Safari overwritting the Authentication header. Thus, I tried to implement a custom header instead, but the result is the same.
I have confirmed that when logging in on ISO the JWT token is created correctly, so I know the problem is not with the generation of the token itself.
Used Technologies
I'm using Axios in my HTTP Request, VueJS in my frontend, Node.js on my serverside and MongoDB as a database. Below, I have copied my request statement where I parse the JWT in a custom header:
let token = localStorage.getItem("jwt")
axios({
method: 'post',
url: 'http://localhost:4000/test/',
headers: {
'Content-Type': 'application/json',
'token': 'Bearer ' + token
},
data: {
email: "test@test.com"
}
}).then(function (response) {
console.log(response);
}).catch(function (error) {
console.log(error);
});
}
Anyone know a solution for this? Based on my research of the problem, I can see others are facing the same, but the proposed solutions unfortunatly not helped me.
Thank you in advance.