CORS
An origin identifies an application's address in the browser: scheme, hostname and port. https://smartagt.example.test:9000 and https://smartagt.example.test are different origins. With HTTPS, an omitted port means 443.
The Frontend service checks the origins of browser requests. The same list protects operations including login and logout: a disallowed origin can cause a 403 response even when the page loads and its certificate is valid.
Frontend configuration
In /app/config/bff/smartagt-bff-core.yaml, or C:\app\config\bff\smartagt-bff-core.yaml on Windows, merge this fragment into the existing smartagt block. The http block sits under smartagt, at the same level as core: misplaced, it is ignored without error.
smartagt:
http:
cors:
allow_origins:
- "https://smartagt.example.test:9000"
Replace the example with the origin shown in your users' browser address bar. List multiple origins on separate lines. Then restart the Frontend service: Operations.
| Situation | Origin to declare |
|---|---|
Direct access to the Frontend on 9000 |
https://smartagt.example.test:9000 |
Public reverse proxy on 443, internal Frontend on 9000 |
https://smartagt.example.test |
| Another hostname used by your users | Its exact origin, alongside any other addresses still in use |
An entry contains only the scheme, hostname and, if needed, port: no path, query or fragment. Use neither *, subdomain wildcards nor the listening address 0.0.0.0. SmartAGT defines the methods, headers and cookie support; only allow_origins is configurable here.
The origin of the installation's public URL is also admitted automatically. The YAML adds origins to it; removing a YAML entry therefore does not revoke the public URL's origin. Declare a public address change in Platform > General, in the Platform public URL field.
When using SSO
The Backend also checks the Frontend origin for SSO. The public URL's origin is admitted automatically; for an additional address, add it to the Backend YAML, then restart the API:
smartagt:
iam:
oidc:
frontend_allowed_origins:
- "https://smartagt.example.test:9000"
Keep origins that are still in use. If the public address changes, also update the redirect URLs registered with the identity provider. The Frontend CORS setting and the Backend SSO list each have their own role: changing one does not change the other.
Verification
Open the Frontend at the declared address, log in, reload the page, then log out. If an operation is refused, compare the request's Origin header in the browser network tools with the admitted origins: the refused response carries the origin_refused reason. The Frontend service log writes each refusal as a WARNING, at most 10 per minute and per reason followed by a summary line, for example Refus (POST /auth/login) : 403, origin_refused. The reason gives the cause: origin_refused for an origin missing from the list, origin_missing without an Origin header, origin_multiple for several Origin headers, origin_malformed for an unreadable header. The first time in an hour, the log also names the refused origin. At startup, it lists the origins read from the YAML, after origines YAML=.
Resolve certificate trust issues with Install your certificates. Prepare listening port changes with Change the ports.