Worker + Service Token -> Zero Trust Access Application | Not working

What is the name of the domain?

gabe-projects.com

What is the error message?

SyntaxError Unexpected token ‘<’, "<!DOCTYPE "… is not valid JSON

What is the issue you’re encountering

I am trying to have a Cloudflare worker access data from a website that is protected under Zero Trust Access. I access the website through email authentication but that won’t work for a worker. So I setup Service Token, it’s been added to the header of my worker and the application policy. I can’t get it to work using the service token selector.

What steps have you taken to resolve the issue?

I tried to test the code with “curl -H “CF-Access-Client-Id: <CLIENT_ID>” -H “CF-Access-Client-Secret: <CLIENT_SECRET>” https://app.example.com” from Service tokens · Cloudflare Zero Trust docs. I received the following errors when I ran that curl request: “curl: (35) schannel: next InitializeSecurityContext failed: CRYPT_E_NO_REVOCATION_CHECK (0x80092012) - The revocation function was unable to check revocation for the certificate.”

When I disable Zero Trust Access, the code works fine to do what I need it to do. I am just struggling to get the HTTP headers with the service token information to work.

What are the steps to reproduce the issue?

It works every time I enable Zero Trust Access on the Application.