CORS credentials cannot use a wildcard allowed origin
Reason: Credential is not supported if the CORS header 'Access-Control-Allow-Origin' is '*'
The request uses credentials while the response allows every origin with a wildcard. Browsers reject that combination; the server must explicitly allow the trusted origin or the client must omit unneeded credentials.
Reason: Credential is not supported if the CORS header 'Access-Control-Allow-Origin' is '*'
Why it happens
fetch uses credentials: 'include' against a response containing Access-Control-Allow-Origin: *.
An XMLHttpRequest enables withCredentials while the server uses a public wildcard policy.
How to fix it
Check whether the endpoint actually needs cookies or other browser credentials. For an intentionally anonymous request, use credentials: 'omit' and ensure the application does not rely on a session.
If credentials are required, configure the server to return the exact allowlisted requesting origin instead of *. Return Access-Control-Allow-Credentials: true for the credentialed flow.
When choosing an allowed origin dynamically, validate it rather than reflecting any caller and add Vary: Origin for caches.
Retest preflight and actual responses. CORS permission does not override browser cookie restrictions, so investigate cookie policy separately if authentication still fails.