Skip to content
Jun 27 / Greg

HTTP Error 401 – Unauthorized with AWX and Oauth to Servicenow on Cloudflare

So I am running CIQ Ascender which is built from the upstream Ansible AWX project(holler at me if you are looking for support), and to protect it as well as give it an SSL cert I use Cloudflare. This works a treat because my install instantly has a valid cert and all is right with the world…until, that is, I tried to connect Servicenow(SNOW) to Ascender’s API via Oauth. I kept getting an “HTTP Error 401 – Unauthorized” message when trying to grab an Oauth token via the Rest Messages.
I have a couple of blog posts on configuring SNOW integration with AAP if you are interested: Order VMs via SNOW, read SNOW CMDB, write SNOW CMDB.

The fix is to make some adjustments in Cloudflare via Page Rules.
Once in Cloudflare, navigate to the domain in question, then click on the rules menu(from here it defaults to “Page Rules”, which is what we want).
In here create a new rule and fill it out as follows:
– Disable Security
– Browser Integrity Check: Off
– Security Level: Essentially Off
– Cache Level: Bypass

Good luck and happy Oauthing…LOL

Leave a Comment