How to configure digiRunner to support CORS in a frontend-backend separated architecture? #65
-
Hi team, I'm currently integrating digiRunner into a frontend-backend separated architecture. The frontend (e.g., running locally on localhost or 127.0.0.1) and the digiRunner API Gateway are deployed on different domains. As expected, I'm running into CORS (Cross-Origin Resource Sharing) issues with the browser. When inspecting the response headers from digiRunner running in Docker, I see the following:
I have a few questions:
My goal is to allow the frontend browser to call the digiRunner Gateway directly while handling CORS correctly. I appreciate any advice or guidance! |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
XXX and YYY are just placeholders that you can swap out. The four headers in the middle—Content‑Type, Authorization, SignCode, and Language—are mandatory and must not be changed, so we use clear placeholders to indicate the ones you’re free to adjust. You can modify XXX and YYY according to your needs. |
Beta Was this translation helpful? Give feedback.
-
Hi @Eddie-Las , |
Beta Was this translation helpful? Give feedback.
-
Thanks team, this is very helpful!
It seems there’s no UI in digiRunner to manage advanced CORS settings — am I missing something? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the feedback! You're absolutely right that digiRunner currently doesn't provide a UI interface for advanced CORS settings. We have already included this feature in our development roadmap and plan to provide a complete CORS management interface in future versions. You'll then be able to configure these advanced parameters directly through the UI. |
Beta Was this translation helpful? Give feedback.
-
@Eddie-Las Great follow-up, and thanks again for raising this important question! 🔍 What are XXX and YYY? The four headers in the middle — You can update the actual list of allowed headers in:
Look for this property: Let’s say your frontend uses a custom header like ⚙️ What about other CORS headers like Allow-Credentials? |
Beta Was this translation helpful? Give feedback.
-
Thanks again, team— this was exactly what I needed! |
Beta Was this translation helpful? Give feedback.
-
📌 Additional Note 🔹 DGR_CSP_VAL 🔹 DGR_CORS_VAL 🔹 DGR_HOST_HEADER
|
Beta Was this translation helpful? Give feedback.
@Eddie-Las Great follow-up, and thanks again for raising this important question!
Although digiRunner does not currently provide a UI interface for configuring CORS, if you need to apply settings urgently, here’s how you can do it manually:
🔍 What are XXX and YYY?
They're placeholders — markers in the default CORS header config to indicate that you can insert your own custom headers.
The four headers in the middle —
Content-Type
,Authorization
,SignCode
, andLanguage
— are required for digiRunner to function and should not be removed.
You can update the actual list of allowed headers in:
config/application.properties
Look for this property:
cors.allow.headers=YYY,Content-Type,Authorizati…