luis901101 / oauth_webauth

BSD 3-Clause "New" or "Revised" License
15 stars 16 forks source link

Flutter Web CORS Issues #9

Open tbwfdu opened 1 year ago

tbwfdu commented 1 year ago

Hi - Obviously aware of some of the issues surrounding CORS with flutter web etc. but cannot seem to find a way to resolve this with sending additional headers for your package.

I am using the OAuthWebView method for Flutter Web and this works fine when I disable chrome web security, but doing anything in a release build and uploading it to a web host will not successfully complete the return of the authentication token etc.

I have seen in your package that there are some options for sending headers on the OAuthWebScreen.start() method but your comments suggest it doesn't work for web.

Is there any other way that we can send the right headers to my OAuth Auth endpoint and then have the web server accept it?

luis901101 commented 1 year ago

Current implementation for web doesn’t allow headers because it is a simple redirect to the authorization url. Not sure right now how to set headers that way, I experienced the same issue with CORS in a project, I ended up configuring CORS in my authorization provider to accept requests from my web url.