Cloudflared Access - How to Clear Login Info

Hi All,

I have setup a Cloudflare Tunnel and add and TCP application to access our internal database. We are using this command : cloudflared access tcp --hostname internal-mysql.company.com --url localhost:3306.

When it ran for the first time, there will be a pop up in the browser tab and there is two possibilities , correct me if I am wrong :

  1. If we have already login into Cloudflare, we will be shown Approve or Deny
  2. If we don’t login to Cloudflare, we will be redirected to a page where we can enter our email address and we will get an OTP.

After that, I can connect to my internal database using localhost:3306. But next time when I run this command again : cloudflared access tcp --hostname internal-mysql.company.com --url localhost:3306, I don’t need to authenticate anymore. My question is : is there any way to logout/invalidate the login token? so for every new cloudflared session, we need to authenticate again.

Please advise. Thank you.

Regards,
Albert

Have you tried dropping the session duration for the access application? There is an option to expire immediately, which sounds like it might do what you want.

Assume that you are using Windows, I have a batch script to delete the entire .cloudflared folder within the user profile folder since it contains the session token:

del /S /Q "%USERPROFILE%/.cloudflared/"

However I think @Cyb3r-Jak3 answer is spot on.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.