**Issue: CORS Error with Medplum Client on Local D...
# support
a
Hope everyone is doing well.... I'm trying to get my self-hosted Medplum backend communicating w/ my localhost frontend. Environment: - Self-hosted Medplum on AWS through AWS Medplum CDK - Local development frontend on
https://localhost:5173
- Production API at
https://api.progressnotes.app
- Admin frontend works
https://app.progressnotes.app
Problem: I'm getting these pesky CORS errors when trying to authenticate against production API from local dev environment: ERRORS: Access to fetch at 'https://api.progressnotes.app/auth/method' from origin 'https://localhost:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Here's my Current Configuration: 1. AWS Parameter Store settings: - `/medplum/prod/appBaseUrl`:
https://app.progressnotes.app/
- `/medplum/prod/baseUrl`:
https://api.progressnotes.app/
- `/medplum/prod/allowedOrigins`:
*
2. Client Configuration (main.tsx): const medplum = new MedplumClient({ onUnauthenticated: () => (window.location.href = '/'), baseUrl: 'https://api.progressnotes.app/', }); What I've Tried: 1. Set
allowedOrigins
to
*
in AWS Parameter Store 2. Restarted the Medplum server after config changes 3. Verified all required parameters are set in AWS Parameter Store 4. Checked network tab - preflight OPTIONS request fails with CORS error 5. Confirmed server configuration is being loaded with correct values Request Headers: accept: application/fhir+json, /; q=0.1 content-type: application/fhir+json referer: https://localhost:5173/ Questions: 1. Is there additional CORS configuration needed beyond
allowedOrigins
? 2. Should I be setting additional headers in the MedplumClient configuration? 3. Are there any known issues with local development against production APIs? Any help would be greatly appreciated!
t
Hello, I have the same issue at the moment. Would greatly appreciate any help here 🙂
So just so you know here's what I did : Modified the Parameter store to add the allowedOrigins and then : > npx medplum login --base-url https://api.domainename > npx medplum aws update-server {env}
222 Views