CSRF Failure in portal


I have set up Tyk with an API and dev portal. I have haproxy directing myportal.com to localhost:5000/{{ tyk_dashboard_org_id }}/portal/ and also redirecting the portal assets.
I can only sign it to the portal from myportal.com/login “Login” button.
If I add “” to navigation bar at the top i can sign in from the navbar also, but only on the /login and /register pages, as only then it has the {{ .Token }} there, on other pages (myportal.com, myportal.com/apis etc) it’s empty.

I saw the page https://tyk.io/troubleshooting/troubleshooting-tyk-dashboard/receive-csrf-error-developer-portal/
but if I’m already using haproxy then I don’t need to set/use CNAME in tyk, right?


“host_config” : {
“disable_org_slug_prefix”: true,
“portal_root_path”: “/”

Here is the organisation object:
“api_human_name”:“API default”,
“api_human_name”:“API previous”,










Hi Tarmo,

Though it can be configured in your HAProxy settings, you will still need to set the CNAME in the Dashboard as without it, the Dashboard will be unable to determine exactly which CNAME to look for. The advice in the Troubleshooting page you’ve linked to should still be valid in your case.

Hope that helps.

Kind regards,
Jess @ Tyk

Thank you for the reply.

So in org object I should put:

I tried that and restarted, but it still doesn’t work.

In my first post, the line that I added to navigation bar was:
<input type="hidden" name="csrf_token" value="{{ .Token }}">

Hi Tarmo,

Unfortunately there does seem to be an issue with the login form in the navigation bar at present. This is a known issue that we’re working to resolve but until a solution has been found, you should be able to log in using the form at myportal.com/login.

Apologies for any inconvenience that this may have caused.

Kind regards,
Jess @ Tyk