jso icon indicating copy to clipboard operation
jso copied to clipboard

no-cors: blocked by CORS policy: Response to preflight request doesn't pass access control check

Open AWqxKAWERbXo opened this issue 4 years ago • 1 comments

How can i fix this?

Some debug information

state {response_type: "code", state: "638fec32-xxxx-xxxx-xxxx-d9ebc9c5a232", redirect_uri: "http://www.example.org/xing/", client_id: "xxxxxx", scope: "https://api.xing.com/v1/users/me", …}client_id: "xxxxxxx" providerID: "xing"redirect_uri: "http://www.example.org/xing/"response_type: "code"scope: "https://api.xing.com/v1/users/me"scopes: ["https://api.xing.com/v1/users/me"]state: "638fec32-xxxx-xxxx-xxxx-d9ebc9c5a232"[[Prototype]]: Object
www.example.org/:1 Access to fetch at 'https://api.xing.com/auth/oauth2/token' from origin 'https://www.example.org' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
(Index):5736 POST https://api.xing.com/auth/oauth2/token net::ERR_FAILED
value @ (Index):5736
value @ (Index):5736
(anonym) @ (Index):5736
Promise.then (asynchron)
(anonym) @ (Index):5736
Promise.then (asynchron)
value @ (Index):5736
(anonym) @ (Index):5736
value @ (Index):5736
authorizePopup @ (Index):5804
(anonym) @ (Index):5771
dispatch @ (Index):5735
v.handle @ (Index):5735
```

```
(Index):5809 Error from passive loader TypeError: Failed to fetch
```

AWqxKAWERbXo avatar Aug 24 '21 10:08 AWqxKAWERbXo

You need to enable CORS on the server. This is done by allowing your domain (http://www.example.org?) to request the page on https://api.xing.com.

Specifically you need the remote server to include Access-Control-Allow-Origin: http://example.org in its headers.

michdorf avatar Sep 14 '21 11:09 michdorf