LinkedIn API return 307 internal redirect with about:blank

I have a LinkedIn app. When I give authorization I receive code (their code needed in next step). With that code and other data I need to call their https://www.linkedin.com/oauth/v2/accessToken endpoint.

According to their docs: LinkedIn API docs it should be POST method.

It works using postman. It also works in browser when I enter the URL (which means it works with GET method too). I can get the accessToken

The trouble I have is that it doesn’t work while AJAX request. What I got from their API is Status Code: 307 Internal Redirect with a Header Location: about:blank ?‍♂️

The same happens when I call API api.linkedin.com/v2/me with accessToken (which I got using postman)

Has anyone made it work?

I have a secure connection with server hosted on https with SSL certificate:
enter image description here

Source: Ask Javascript Questions

LEAVE A COMMENT