fusionauth-issues icon indicating copy to clipboard operation
fusionauth-issues copied to clipboard

The CORS documentation is not accurate

Open glen-84 opened this issue 2 years ago • 4 comments

The CORS documentation is not accurate

Description

The CORS documentation states that CORS is enabled by default, but it's not.

I'm trying to use exchangeOAuthCodeForAccessTokenUsingPKCE, and it's failing due to CORS. I had expected that adding the origin to Authorized request origin URLs would automatically handle CORS, but that doesn't appear to be the case?

Affects versions

1.36.0

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to /admin/system-configuration/edit after installing with Docker.
  2. Note that CORS filter is not enabled.

Expected behavior

For this issue, for CORS to be enabled. However, handling it automatically based on Authorized request origin URLs would be better.

Screenshots

image

Platform

  • Device: Desktop
  • OS: Windows 11
  • Browser + version: Chrome 100.0.4896.88
  • Database: Default

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.

Additional context

n/a

glen-84 avatar Apr 12 '22 13:04 glen-84

Thanks for filing the issue @glen-84 ! Glad you figured it out. We'll get the docs updated.

mooreds avatar Apr 12 '22 13:04 mooreds

This is probably working as designed.

We have discussed automatically adding things to CORS for callbacks in SAML or OAuth2. To date, we've err'd on the side of not doing anything too magical, and just doing our best to document where possible that a CORS configuration may be required.

robotdan avatar Apr 15 '22 03:04 robotdan

If that's true, then this line should perhaps be changed?

Most of the time this works as designed, you do not need to think much about CORS configuration.

CORS will always be required when connecting from the client side.

glen-84 avatar Apr 15 '22 08:04 glen-84

@mooreds is there more doc or UI updates to make this for one, or can we close it out?

robotdan avatar Aug 31 '22 14:08 robotdan

Just filed a PR updating the doc, confirmed that by default, out of the box, CORS is disabled.

mooreds avatar Sep 02 '22 19:09 mooreds

@mooreds can I close this one out if we have updated the doc?

robotdan avatar Jan 09 '23 18:01 robotdan

Closing.

mooreds avatar Jan 09 '23 19:01 mooreds