Cloudflare + auth0 + spring boot + shared auth token

I am using Cloudflare Tunnel to connect to my self-hosted home PC, where I host a spring boot + spring security website setup to use auth0 SAML2.

I want to protect the Cloudflare tunnel with SAML so my PC handles ONLY logged in users. Additionally, I want to implement authentication and authorisation within my Spring Boot

I want the same set of auth0 cookies to be used for both Cloudflare SAML and spring boot website.

The problem is that when I assign SAML to Cloudflare, a cookie is created for the Cloudflare domain .cloudflareaccess.com and another cookie is created for the spring boot website behind cloudflare. Which makes me login twice.

Also, when I log out, it logs me out only off the internal website, and not cloudflareaccess.com . I do make spring use auth0 logout url.

Need to note, auth0 uses cloudflareaccess.com/.../callback as a callback to put token in.

My question, how do i implement single login and single logout for both cloudflare and spring boot using auth0, so I dont need to login twice and clear cookies for
cloudflareaccess.com domain for logout

Hi Dmytro001 - I believe you meant to categorize this question in Help, rather than Fine Grained Authorization. You may need to recategorize or repost it in order for it to appear in the intended category for assistance.

1 Like