Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Mealie OIDC CORS Policy Blocked #275

Open
mandopatriot opened this issue Jul 7, 2024 · 0 comments
Open

[BUG]: Mealie OIDC CORS Policy Blocked #275

mandopatriot opened this issue Jul 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mandopatriot
Copy link

What happened?

When trying to login with Cosmos OpenID into Mealie, it redirects back to the Mealie login screen and produces the browser error below.

I setup mealie from Market with a URL of https://recipes.mydomain in Cosmos, local auth works fine. Setup a client ID and set redirect URI to https://recipes.mydomain/login as directed by Mealie OpenID docs (https://docs.mealie.io/documentation/getting-started/authentication/oidc/).

Then I modified the environment variables based on Mealie backend docs (https://docs.mealie.io/documentation/getting-started/installation/backend-config/#openid-connect-oidc), setting OIDC_CONFIGURATION_URL to https://mydomain/.well-known/openid-configuration and the other relevant variables (Mealie does not ask for client secret). Restarted Mealie after all changes to be safe.

In an unused browser, I opened a private tab and navigated to https://recipes.mydomain. I select Login with Cosmos, it takes me to Cosmos login page, I auth and it asks for permissions, once I choose to login it redirects to Mealie login page and produces the below browser error.

I also tried setting the CORS option in the Mealie URL entry for either * or Mealie domain, but no change it outcome.

What should have happened?

Successful auth into Mealie

How to reproduce the bug?

Noted above.

Relevant log output

Access to XMLHttpRequest at 'https://mydomain/oauth2/token' from origin 'https://recipes.mydomain' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Other details

No response

System details

Cosmos Server - 0.15.7
Cosmos Host - Ubuntu 22.04
Mealie - 1.10.2

@mandopatriot mandopatriot added the bug Something isn't working label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant