I followed the example simple React-Okta SPA app as mentioned in documentation (Okta Sign-In Widget and React | Okta Developer). This works like butter in my local . But whenever I run this app in Ec2 or any cloud Vm , it simply stops working.
The login page in OktaSignin widget comes up , but never authenticated and redirects to the home page. I don’t see any error in the console nor in the okta event logs. In fact Okta event logs shows that it has received the request and have successfully authenticated it.
Note: I have correctly added the redirect url in the Okta portal. Also enabled CORS for the public cloud url.