I'm trying to implement OAuth2 authentication. When I try to send Authorization code I get this error:
XMLHttpRequest cannot load link1. Redirect from link1 to link2 has been blocked by CORS policy: Request requires preflight, which is disallowed to follow cross-origin redirect.
My req/rsp looks like this:
General: Request URL:link1 Request Method:OPTIONS Status Code:204 No Content Remote Address:
Response Headers: HTTP/1.1 204 No Content X-Powered-By: Express Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET,HEAD,PUT,PATCH,POST,DELETE Access-Control-Allow-Headers: content-type, sessionid Date:
Request Headers: OPTIONS /authorize HTTP/1.1 Host: host Connection: keep-alive Access-Control-Request-Method: POST Origin: origin_link User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36 Access-Control-Request-Headers: content-type, sessionid Accept: / Referer: origin_link/dialog Accept-Encoding: gzip, deflate, sdch, br Accept-Language: en-US,en;q=0.8