I'm implementing a single page app that will run in the browser. The development happens on codeberg, and we will host our own instance of the app. Authentication happens through OIDC in an Authorization Code Flow with PKCE.
The authorization procedure appears to work as expected, e.g. when using GitLab as an OIDC provider. The plan is to use Codeberg as an OIDC provider for our own instance of the app though (because that's where the project lives anyway), and there the request from the browser to the https://codeberg.org/login/oauth/access_token POST endpoint fails with Reason: CORS Missing Allow Origin.
I set up a local Forgejo instance with very permissive CORS headers for testing (in this case a reverse proxy hands out the CORS headers), and the access token fetch works well there as well.
Not sure where exactly the CORS headers for the codeberg.org instance are added, whether it's Forgejo itself or the reverse proxy. I hope my use case is not too unusual, but still I would be surprised if I'm the first person to be affected by this. Please let me know if this is something that should be addressed directly to the Forgejo project. At a first glance this appears to be related to configuration more than the Forgejo implementation, because e.g. on https://v14.next.forgejo.org the browser already prevents access to the /.well-known/openid-configuration GET endpoint due to missing CORS headers.
### Comment
I'm implementing a single page app that will run in the browser. The development [happens on codeberg](https://codeberg.org/pib), and we will host our own instance of the app. Authentication happens through OIDC in an Authorization Code Flow with PKCE.
The authorization procedure appears to work as expected, e.g. when using GitLab as an OIDC provider. The plan is to use Codeberg as an OIDC provider for our own instance of the app though (because that's where the project lives anyway), and there the request from the browser to the `https://codeberg.org/login/oauth/access_token` **POST** endpoint fails with **Reason: CORS Missing Allow Origin**.
I set up a local Forgejo instance with very permissive CORS headers for testing (in this case a reverse proxy hands out the CORS headers), and the access token fetch works well there as well.
Not sure where exactly the CORS headers for the codeberg.org instance are added, whether it's Forgejo itself or the reverse proxy. I hope my use case is not too unusual, but still I would be surprised if I'm the first person to be affected by this. Please let me know if this is something that should be addressed directly to the Forgejo project. At a first glance this appears to be related to configuration more than the Forgejo implementation, because e.g. on <https://v14.next.forgejo.org> the browser already prevents access to the `/.well-known/openid-configuration` **GET** endpoint due to missing CORS headers.