I am sending a request by looking at the criteria below. It results successfully, but there is no token in the response. I don't understand what am I missing.
const fetchLinkedinToken = linkedinCode => {
const requestedUrl = `${BASE_LINKEDIN_URL}?grant_type=authorization_code
&code=${linkedinCode}
&redirect_uri=${window.location.origin}/linkedin&client_id=${LINKEDIN_CLIENT_ID}
&client_secret=${LINKEDIN_CLIENT_SECRET}`;
fetch(requestedUrl, {
mode: 'no-cors',
method: 'POST',
'Content-Type': 'application/x-www-form-urlencoded',
})
.then((resp1, resp2) => {
console.log(resp1, resp2);
})
.catch(error => {
console.log(error);
});
If i call url in the web or postman, i can get the access_token
Also i tried Content-Type': 'application/x-www-form-urlencoded
in header also same result :(