Who the browser lets call youbeginner
The browser, not your server, decides whether a page from one site may read a response from another — and the Access-Control-Allow-Origin header you send back is the only thing it goes on.
Works on every laptop, blocked in production, and the laptop version lets any website call the API as the signed-in user. Configure CORS once, properly, for every environment.
One named policy, origins from configuration, applied in every environment before auth, credentials only with explicit origins.
Published in full, before you start — every point is one of these and there is nothing else.
The browser, not your server, decides whether a page from one site may read a response from another — and the Access-Control-Allow-Origin header you send back is the only thing it goes on.
A hardcoded API secret is a secret in your git history; IOptions<T> binds configuration into a typed object your code asks for like anything else.