I am attempting a “Hello World” with Okta, I’m using the below sample code that I am attempting to use with Okta my sandbox account:
I am running the node service on a local Linux VM with IP address: 192.168.100.118 on port 8080, the same Linux VM is serving files to the browser (index.html, main.js) on port 80.
I am presented with the Okta login, but my browser is throwing a CORS pre-flight error, wondering how I should be handling this. See attached screenshot:
Failed to load https://videatestamundo.okta.com/api/v1/sessions/me: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://192.168.100.118’ is therefore not allowed access.
So far, I have tried extending the nodejs service (index.js) with this express cors module:
with this: app.options(’*’, cors())
However, I am still getting the same error.
Appreciate any ideas or suggestions, thanks!