Ryan_NR is encountering issues while attempting to create a new topic via the Discourse API. Initially, the API call returns a 307 redirect to a login page, which Falco attributes to a custom proxy setup. After bypassing the proxy, Ryan faces 403 BAD CSRF errors. blake confirms the cURL syntax is correct and suggests headers may be stripped by the proxy or web server (e.g., nginx), preventing Discourse from recognizing the request as an API call. Ryan confirms he’s hitting the backend directly and is on Discourse v2.3.10, which blake confirms still supports header-based auth. The issue likely lies in missing or stripped headers before reaching Discourse. Ryan plans to collaborate with his dev team to investigate further, possibly checking nginx logs or adding debug statements in Discourse’s auth provider code blake.
I just tested your example curl command locally and it is working fine for me so the syntax is all correct. Is is possible the proxy is stripping some headers? That could be why you are getting the BAD CSRF errors because it can no longer read/access the api credentials.
Our proxy is fully custom in house built and it’s a front layer to the public.
I’m VPN’d into our internal network & I’m not hitting the public URL, I’m hitting the backend (behind proxy) URL, so, the requests shouldn’t be going through the proxy.
Because this is a staging instance and not local you will have nginx or some other webserver running before it hits discourse. It’s possibly nginx is stripping some headers depending on your config. These may show up in the nginx logs.
This is the line where it reads the api credentials out of the request headers. You could also add some debug statements to this file to figure out if the headers are getting this far.