bhubr / react-simple-oauth2-login

Simple React component for OAuth2 login - Supports Authorization Code and Implicit Grant flows.
MIT License
49 stars 31 forks source link

When using code response, DOMException is silenced #19

Closed rsnyman closed 3 years ago

rsnyman commented 3 years ago

Note: I'm currently looking into this.

If you choose the "code" responseType (aka server-side) and your server is on a different domain to your React app, the popup window throws a DOMException "Blocked a frame with origin from access a cross-origin frame". This exception is then silenced in the popup window's poll() method.

There needs to be a better way to handle cross-origin requests. This is usually done through posting messages between the parent and child windows.

bhubr commented 3 years ago

Sorry, I'm just seeing now that you had put details in the issue, while I had only read the PR 😅 . Fair enough then... Still, that silenced exception didn't prevent the whole workflow to work for me, even with a React app on a different origin from the server's. If you're not in too much of a hurry, I'll look into this by the end of the week, since there's also been a recent feature request that I'd like to address soon.