Not able to get request headers in http interceptors python fastapi while sending request using axios

The problem is in your origins = ["*", "http://localhost:3002"]. As far as I understand, when you have set allow_credentials=True in your Middleware, you cannot use the wildcard (i.e. "*") for allow_origins. Here is an excerpt from the docs.

allow_credentials - Indicate that cookies should be supported for cross-origin requests. Defaults to False. Also, allow_origins cannot be set to ['*'] for credentials to be allowed, origins must be specified.

Link to docs here: https://fastapi.tiangolo.com/tutorial/cors/