Blog

/

What a short-lived Cloudflare sign-in guarantees you

Flowmails asks for a Cloudflare sign-in in exactly one place:Your own sending account, when Cloudflare Email Sending is the transport. Receiving a domain needs no sign-in at all — two DNS records in your own zone are the whole of it. Where the sign-in does happen it lasts about an hour: Cloudflare issues a short-lived access token and returns no refresh token, you approve the scopes on Cloudflare’s own consent screen instead of pasting a secret, and your mail keeps flowing after it expires.

Cloudflare OAuth
One-hour grant
No pasted token

How long does the Cloudflare sign-in last?

About an hour — shorter than you are probably expecting, and Cloudflare offers no way to extend it.

Cloudflare signs third-party OAuth clients with a short-lived access token — about an hour — and returns no refresh token. Its scope catalogue has no offline_access, so there is nothing to ask for: after roughly an hour the bearer is spent and the only cure is a fresh consent.

We do not paper over that. The lifetime is enforced in four places, and none of them depends on you or on us remembering something:

  • The expiry is stamped into the stored record itself, capped to the token’s own lifetime rather than to anything longer.
  • Cloudflare’s key-value store deletes the grant when the window closes.
  • Nothing depends on you remembering to revoke anything, or on us running a cleanup job.
  • Nothing claims a duration longer than Cloudflare actually grants us.

What does the grant give you, and what does it touch?

A fixed scope list, shown on Cloudflare’s own consent screen — and nothing that ever becomes a secret in your clipboard.

  • Nothing is pasted. The old flow asked you to go to dash.cloudflare.com, hand-craft a permission list in a dashboard form, and then paste a secret into a web app. The OAuth path asks Cloudflare to show you its own consent screen listing the scopes, and you click approve.
  • Nothing is copied. The credential never touches your clipboard, your password manager, or a chat window.
  • Nothing long-lived is kept. Flowmails never stores a long-lived credential for your account.

The scope list itself is walked through in our permissions walkthrough. Nothing was loosened to make sign-in possible; the list is short because the shared-worker architecture needs far less than the old per-account worker did.

What breaks when the grant expires?

Nothing that carries mail — only the next action that has to reach into your account.

When the window closes, your mail keeps flowing. The shared worker and the thin sender worker both keep running. What stops working is the next action that needs to reach into your account:

  • Deploying the sender worker.
  • Turning sending on for a domain whose transport is Cloudflare Email Sending.
  • Repairing that domain’s sending DNS — the records Cloudflare re-applies for the sending subdomain.

At that point the dashboard offers you the same one-click sign-in again, and says plainly that it expired rather than claiming your credential was invalid.

Adding a domain is not on that list, and that is the point of the DNS-first flow: the two records go into your own zone, so the platform never needs your account to receive your mail.

Is the sign-in a refresh token?

No — it is not, and that is deliberate. One claim is worth retracting before you assume it.

  • It is not a refresh token. Some OAuth providers hand back a renewable credential so the user is never asked again. Cloudflare sends none, and Flowmails discards one if a future version ever does.
  • A stored refresh token would turn an hour-long credential into an indefinitely renewable one for anyone who ever read our key-value store.
  • That is a strictly worse outcome for you than re-clicking a consent screen.

Can you delete a domain after the grant has expired?

Yes. Deleting a domain finishes on our side whether or not a grant is live, and the only things that can be left behind are the ones that live in your Cloudflare account.

The delete has two halves. Ours removes the domain from the platform, takes its tenant out of the shared mailstore, retires the route table and schedules the mailbox’s purge — none of which needs a credential from you. Yours is whatever the grant exists for: the thin sender worker the platform deployed into your account, the sending subdomain’s DNS records, and, on a domain from the forwarding era, the provider-side rule that points the zone at a Flowmails routing address.

  • The delete completes and tells you what it could not finish, so an expired grant is never a locked door.
  • What is left behind keeps doing something. The sender worker still accepts the platform’s sends while it exists, and a legacy forwarding rule still routes mail — which is why the list matters rather than being a footnote.
  • The two inbound records are yours. They live in your zone and no credential of ours can touch them: remove the MX and the TTL’d TXT at your DNS host, and the domain is fully free of Flowmails.

Why does Flowmails not keep a long-lived credential for you?

Because a long-lived Cloudflare API token in our database is a standing liability, and the grant inverts that.

  • It survives your password rotation.
  • It outlives the person who pasted it.
  • A breach of our database would hand an attacker every account that ever connected.

The grant inverts that — the credential has a bounded lifetime, it is never persisted beyond that lifetime, and the platform’s own database holds no third-party secret at all.

Outbound sending needed the same treatment, which is why the platform deploys a ~120-line thin sender worker into your own account rather than asking you for an Email Sending permission on a shared credential. The sender worker holds the send_email binding and nothing else; the platform calls it over HTTPS with a bearer secret it minted at deploy time.

When is the sign-in asked for, and is there another way?

Only when you pick Cloudflare as the transport for a domain’s outgoing mail. Receiving never asks for it, and the Flowmails sending channel does not either.

  • Receiving a domain: no sign-in. Two records in your own zone, detected and verified over public DNS. Your DNS host can be Cloudflare, GoDaddy, Namecheap or anything else.
  • Cloudflare Email Sending: sign in with Cloudflare. That is the supported path for this transport, and it is the only credential the platform accepts for it: no secret to paste, no secret to rotate, no secret of yours sitting in a third party’s database.
  • Re-sign in when it expires. If you come back to the dashboard more than an hour later and an action needs your account, you will be offered the one-click consent again. That is the whole cost.

The sign-in happens inside the dashboard, and once a domain is connected the surface that consumes the grant is the API reference. The pricing page covers the platform layer the grant sits on top of.

TL;DR

  • Adding a domain? No sign-in at all: two DNS records in your own zone, verified over public DNS. The Cloudflare sign-in appears one step later, and only if you choose Cloudflare as the sending transport.
  • An action fails more than an hour after you signed in? Re-consent with the one-click sign-in; the dashboard says plainly that it expired.
  • Deleting a domain after the grant died? Let the delete finish, then work through the list of what is still installed on Cloudflare and remove it by hand.
  • Reviewing the credential posture? The platform keeps no long-lived Cloudflare secret of yours, and the sender worker lives in your own account.

Common questions

Straight answers to the four questions that come up after the walkthrough above.

Q: Will Flowmails keep working after my Cloudflare grant expires?

Yes for mail, no for the next setup action. Inbound mail goes to Flowmails' own mail server through the MX record, so it never touches your Cloudflare account and never stops. What stops is the next action that has to reach into that account: deploying the thin sender worker, or repairing a domain's Cloudflare Email Sending setup. The dashboard offers the one-click sign-in again.

Q: Can I keep the grant alive so I never have to sign in again?

No. Cloudflare's scope catalogue has no offline_access, so there is nothing to ask for, and a stored refresh token would turn an hour-long credential into an indefinitely renewable one. Flowmails discards a refresh token even if a future version ever receives one; the cost is a re-click of the consent screen.

Q: Does Flowmails store my Cloudflare token in its database?

No. The platform's own database holds no third-party secret at all. The grant is stored server-side with an expiry stamped into the record and is deleted when the window closes, and outbound sending uses a thin sender worker in your own account rather than a shared credential.

Q: How do I re-sign in after it expires?

The dashboard offers the same one-click sign-in again, and it says plainly that the grant expired rather than claiming your credential was invalid. The sign-in happens inside the dashboard, and once a domain is connected the surface that consumes the grant is the API reference.

Start here