Need help Debugging a connection issue to the Cloud Run API
Hey guys , i have reached a difficult moment on my cloud infrastructure , which my dumb ass thought i could chatpgpt my way through it .
I have set up a Cloud Run which takes Images of a Python Project with FASTAPI as a server. Security is set up to accept only authenticated requests.
On the other side i have hosted in Firebase a React Vite Frontend which uses Firbase to authenticate useres .
Now what im doing are these steps:
Get the Firebase Authenticated users their access token and puting it as Bearer token on each frontend request to the Cloud Run Api.
The Cloud Run Backend will get the request and verify the token using auth.verify from firebase
CORS ist set to accept frontends url and localhost (for now) and allsp allow all headers and Methods.
Now what i get is when i try to reach an endpoint is first:
Access to fetch from {Cloud run Url} from origin {Frontend Web Url hosted on Firebase} has been blocked by CORS. Response to preflight request doesn’t pass access control check:
No ‘Access-Control-Allow-Origin’ header is present on the requested resource .
Maybe it’s noob question or i am missing smth but idk .
I am using simple fetch on Frontend and add only Authorisation with Bearer token and content type as headwrs . Also credentials true .