gdombiak / OctoPod

Free open source client for OctoPrint
Apache License 2.0
225 stars 42 forks source link

Cloudflare Service Token not working with new Additional headers in 3.28 #680

Open bkcberry opened 6 months ago

bkcberry commented 6 months ago

I'm accessing OctoPrint externally through a cloudflare ZT application and saw where you guys literally days ago added the ability for octopod to utilize this with service tokens. I created a new token and added it to my CF application, pasted the client id and secret in octopod and hit request, but it's telling me "The data couldn't be read because it isn't in the correct format"

My client id and key were pasted in exactly this format with spaces: CF-Access-Client-Id: 2ecxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.access, CF-Access-Client-Secret: 1axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Does anyone have any ideas? Please and thanks

gdombiak commented 6 months ago

Hi @bkcberry,

Thanks for reporting this issue. During the weekend I will spend some time looking into this. I will paste the exact same text you pasted above (I know it is fake but should be enough to see this error I think).

BTW, when and where do you get the error message "The data couldn't be read because it isn't in the correct format"?

Thanks, Gaston

bkcberry commented 6 months ago

Thanks! This was on the screen to add a new printer

bkcberry commented 6 months ago

Has anyone ever had a chance to look into this?

AdmiralMichael commented 3 months ago

I am having this issue as well

I have my cloudfare tunnel forwarding to NGINX Proxy Manager then to Octoprint (I run pihole and this allows me to keep the traffic local when on the LAN). So the domain I use resolves to the NGINX IP when on my wifi.

When I get the error I am on cellular data, when I am on my wifi it works but once I turn off wifi it stops working.

So it looks like the issue is with the CF tunnel setup.

AdmiralMichael commented 3 months ago

Nevermind I fixed it, I didn't select Service Auth under Action when creating the application. I had it as Allow.

gdombiak commented 3 months ago

@AdmiralMichael , good to hear you got it working. Let me know if I should update the documentation.

Is this still an issue for anyone else?

Thanks, Gaston

bkcberry commented 1 month ago

I've just tried this again, verified everything in the instructions, but am getting Invalid HTTP upgrade (302), which is not covered in the instructions