Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

CORS Error: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. #201

Open
ZinkNotTheMetal opened this issue Dec 28, 2022 · 2 comments

Comments

@ZinkNotTheMetal
Copy link

ZinkNotTheMetal commented Dec 28, 2022

Describe the bug

Error in browser when attempting to sign-in

Access to XMLHttpRequest at 'https://cnc-ac-app-qa-southcentralus-001.azurewebsites.net/realms/clicknclose/protocol/openid-connect/token' from origin 'http://localhost:3000' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

A clear and concise description of what the bug is.

To Reproduce

  <ReactKeycloakProvider
    initOptions={{ flow: 'standard' }}
    authClient={keycloakClient}
    isLoadingCheck={() => true}
    onEvent={(event, error) => {
      // eslint-disable-next-line no-console
      console.log("onKeycloakEvent!!:", event, error);
    }}
  >

Keycloak setup

image

Expected behavior
No CORS error should happen when trying to log in

Screenshots
If applicable, add screenshots to help explain your problem.

image

image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Vivalidi & Chrome
  • Version 5.6.2867.50 (Stable channel) (64-bit)
@youjeongsue
Copy link

I have same issue TT

@sorieil
Copy link

sorieil commented Feb 9, 2023

I have same issue...
As a result of many attempts to solve the problem, I found that the value of Keycloak Client settings "Access type" should be changed to "public".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants